/* Basic Reset & Defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Updated Root Variables from TeachAtHome */
:root {
    --primary: #4CAF50;  /* Green */
    --secondary: #FF6B6B; /* Coral - Not used heavily in this merge yet */
    --dark: #333;
    --light: #f9f9f9;
    --white: #fff; /* Added white for clarity */
    --container-max-width: 1200px;
    /* Using Font stack from TeachAtHome */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --base-font-size: 16px;
    --border-radius: 10px; /* Consistent rounded corners */
    --button-border-radius: 30px; /* Specific for buttons */
}

body {
    font-family: var(--font-family);
    font-size: var(--base-font-size);
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--white);
}

.container {
    width: 90%; /* Use percentage for better flexibility */
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 15px; /* Adjusted padding */
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

h1, h2, h3, h4 {
    line-height: 1.3;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

h1 { font-size: 2.8rem; /* Adjusted size */ }
h2 { font-size: 2rem; text-align: center; margin-bottom: 2.5rem; /* Increased bottom margin */ }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

section {
    padding: 60px 0;
}

/* Updated Button Styles from TeachAtHome */
.btn {
    display: inline-block; /* Ensure buttons behave correctly */
    padding: 12px 24px;
    border-radius: var(--button-border-radius); /* Rounded buttons */
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-align: center; /* Center text in button */
    font-size: var(--base-font-size); /* Ensure consistent font size */
    text-decoration: none; /* Remove underline from button links */
    line-height: normal; /* Ensure text aligns vertically */
}
.btn:hover {
     text-decoration: none; /* Remove underline on hover too */
     opacity: 0.9; /* Slight feedback on hover */
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

/* Inverted button for dark backgrounds */
.btn-primary-inverted {
    background-color: var(--white);
    color: var(--primary);
}
.btn-primary-inverted:hover {
     background-color: #eee; /* Slightly darker white on hover */
}

/* Header & Navigation */
header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0; /* Adjusted padding */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem; /* Increased size slightly */
    font-weight: bold;
    color: var(--primary); /* Use primary color for logo */
}
.logo:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 20px;
}

/* Updated Nav Link Style */
.nav-links a {
    color: var(--dark);
    font-weight: 400; /* Regular weight for links */
}
.nav-links a:not(.btn):hover { /* Exclude buttons from underline hover */
    color: var(--primary);
    text-decoration: underline;
}
/* Style Login link differently */
.nav-links a[href="/login.html"] {
    font-weight: bold; /* Make login slightly bolder */
}
.nav-links .btn { /* Ensure buttons in nav align well */
    margin-left: 10px;
}


.mobile-menu-button {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--dark);
}

/* Hero Section - Updated Styles */
.hero-section {
    /* Added background image and gradient */
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), url('https://images.unsplash.com/photo-1588072432836-e10032774350?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1472&q=80') center center/cover no-repeat;
    height: 500px; /* Set height */
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--white); /* Text color white for contrast */
    padding: 40px 0; /* Reduced padding slightly */
}
.hero-content {
    max-width: 700px; /* Limit width of content */
    margin: 0 auto; /* Center content */
}

.hero-section h1 {
    margin-bottom: 1rem;
    font-size: 3rem; /* Adjusted hero h1 size */
}

.hero-section p {
    font-size: 1.2rem; /* Adjusted hero p size */
    margin-bottom: 2rem;
    font-weight: 300; /* Lighter weight for subtitle */
}

/* Hero Buttons Container */
.hero-btns {
    margin-top: 30px;
}
.hero-btns .btn {
    margin: 0 10px; /* Spacing between buttons */
    min-width: 150px; /* Give buttons some minimum width */
}
/* Make hero outline button stand out on dark background */
.hero-section .btn-outline {
    border-color: var(--white);
    color: var(--white);
}
.hero-section .btn-outline:hover {
    background: var(--white);
    color: var(--primary);
}

/* Search Section (Added) */
.search-section {
    background-color: var(--light); /* Light background */
    padding: 40px 0;
}
.search-section h2 {
    margin-bottom: 1.5rem;
}
.tutor-search-form {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping */
    gap: 15px; /* Spacing between elements */
    max-width: 800px; /* Limit width */
    margin: 0 auto; /* Center form */
}

.tutor-search-form input[type="text"] {
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius); /* Consistent radius */
    font-size: 1rem;
    min-width: 220px; /* Adjust as needed */
    flex-grow: 1;
}

.tutor-search-form button {
     padding: 12px 25px;
     flex-shrink: 0; /* Prevent button from shrinking too much */
}

/* How It Works Section - Updated Styles */
.how-it-works-section {
    background-color: var(--white);
}
.steps { /* Using class from TeachAtHome */
    display: flex;
    justify-content: space-around;
    text-align: center;
    flex-wrap: wrap; /* Wrap steps */
    gap: 30px; /* Spacing between steps */
    margin-top: 50px; /* Spacing from heading */
}
.step {
    flex-basis: 30%; /* Aim for 3 columns */
    min-width: 250px; /* Minimum width before wrapping */
}
.step-icon { /* Style from TeachAtHome */
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
}
.step h3 {
    margin-bottom: 0.5rem;
}

/* Subjects Section - Added Styles */
.subjects-section {
    padding: 50px 0;
    background: var(--light);
}
.subjects-section h2 {
    margin-bottom: 30px; /* Space below heading */
}
.subject-grid {
    display: grid;
    /* Responsive grid: columns fill available space, minimum 180px */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px; /* Space between cards */
}
.subject-card {
    background: var(--white);
    padding: 25px 20px; /* More padding */
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); /* Subtle shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.subject-card:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 8px 15px rgba(0,0,0,0.12);
}
.subject-card i { /* Style Font Awesome icons */
    font-size: 2.5rem; /* Icon size */
    color: var(--primary); /* Icon color */
    margin-bottom: 15px; /* Space below icon */
    display: block; /* Ensure margin works */
}
.subject-card h3 {
    font-size: 1.1rem; /* Slightly smaller heading */
    font-weight: 600;
}


/* Benefits Section - Updated background */
.benefits-section {
     background-color: var(--white); /* Changed to white */
}
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}
.benefit-item {
    background-color: var(--light); /* Use light background for items */
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid #eee; /* Add subtle border */
}
.benefit-item h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Testimonials Section - Updated background and card style */
.testimonials-section {
    background-color: var(--light); /* Use light background */
}
.testimonial {
    background-color: var(--white); /* White card */
    padding: 25px;
    border-left: 5px solid var(--primary);
    margin-bottom: 25px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0; /* Keep radius */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Add subtle shadow */
}
.testimonial blockquote {
    font-style: italic;
    margin-bottom: 10px;
    color: #555;
    font-size: 1.05rem; /* Slightly larger quote */
}
.testimonial cite {
    display: block;
    text-align: right;
    font-weight: 600;
    color: var(--dark);
}

/* Become Tutor Section - Updated background */
.become-tutor-section {
    background-color: var(--primary); /* Use primary color */
    color: var(--white);
    text-align: center;
}
.become-tutor-section h2 {
    color: var(--white); /* Ensure heading is white */
}
.become-tutor-section p {
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300; /* Lighter paragraph */
}
/* Use inverted button style here */
.become-tutor-section .btn {
    background-color: var(--white);
    color: var(--primary);
}
.become-tutor-section .btn:hover {
     background-color: #eee;
}


/* Footer - Updated styles */
footer {
    background: var(--dark);
    color: var(--light);
    padding: 40px 0;
    text-align: center;
}
.footer-links {
    margin-bottom: 20px; /* More space */
}
.footer-links a {
    color: var(--light);
    margin: 0 12px; /* Slightly more spacing */
    font-size: 0.9rem;
    transition: color 0.3s ease; /* Smooth color transition */
}
.footer-links a:hover {
    color: var(--primary); /* Highlight hover with primary color */
    text-decoration: underline;
}
.copyright {
    font-size: 0.85rem;
    color: #aaa;
    margin-top: 10px; /* Space above copyright */
}


/* --- Responsive Design --- */

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.8rem; }
    .hero-section { height: auto; min-height: 450px; } /* Adjust height */
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    :root { --base-font-size: 15px; }
    h1 { font-size: 2.2rem; }
    .hero-section h1 { font-size: 2.4rem; } /* Adjust hero h1 */
    .hero-section p { font-size: 1.1rem; } /* Adjust hero p */
    section { padding: 40px 0; } /* Reduce section padding */

    /* Mobile Menu */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 70px; /* Adjust based on actual header height */
        left: 0;
        background-color: var(--white);
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 15px 0;
        border-top: 1px solid #eee;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 12px 0; /* Increase spacing */
        width: 100%; /* Full width list items */
        text-align: center;
    }

    .nav-links a {
        padding: 8px 0; /* Add padding to links for easier tapping */
        display: block; /* Make links block-level */
    }

    .nav-links .btn {
        display: block;
        margin: 10px auto; /* Center buttons */
        width: 80%;
    }
    .nav-links .btn-outline {
        margin-left: auto; /* Reset specific margins */
    }

    .mobile-menu-button {
        display: block;
    }

    .tutor-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .tutor-search-form input[type="text"] {
        min-width: auto;
        width: 100%;
    }
     .tutor-search-form button {
        width: 100%;
    }

    .steps {
        flex-direction: column;
        align-items: center;
    }
    .step {
        flex-basis: auto;
        width: 90%; /* Increase width on mobile */
        margin-bottom: 30px;
    }

    .benefits-grid {
         grid-template-columns: 1fr; /* Stack grid items */
    }
    .subject-grid {
        /* Adjust grid for smaller screens */
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .hero-btns .btn {
        margin: 8px 5px; /* Adjust button margin */
        width: calc(50% - 10px); /* Try to fit side-by-side */
        min-width: 0; /* Remove min-width */
        padding: 10px 15px; /* Adjust padding */
    }
    .hero-btns {
        display: flex; /* Use flexbox for better control */
        flex-wrap: wrap;
        justify-content: center;
    }

    footer { padding: 30px 0; }
    .footer-links a {
        display: block;
        margin-bottom: 10px;
    }
}