/* --- Global Styles & Variables --- */
:root {
    --color-primary: #005A9C;
    --color-secondary: #28a745;
    --color-text: #333;
    --color-text-muted: #555;
    --color-background: #fff;
    --color-surface: #f9f9f9;
    --color-surface-card: #fff;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-border: #ccc;
    --color-header-bg: #fff;
    --color-footer-bg: #281f41;
    --color-footer-text: #ccc;
    --color-footer-heading: #fff;
    --color-overlay-why-us: rgba(249, 249, 249, 0.95);
    --color-overlay-services: rgba(255, 255, 255, 0.92);
    --color-overlay-modal: rgba(255, 255, 255, 0.96);
}

html {
    scroll-behavior: smooth; /* Adds a smooth scrolling effect */
    scroll-padding-top: 160px; /* Offset for the sticky header on desktop */
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

section {
    padding: 20px 5%;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--color-primary);
}

/* --- Header and Navigation --- */
.main-header {
    background-color: var(--color-header-bg);
    box-shadow: 0 2px 5px var(--color-shadow);
    padding: 0.25rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 0; /* Removes space between logo and nav links */
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo img {
    height: 150px;
    width: 225px;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--color-primary);
}

/* --- Hero Section --- */
.hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1573496277990-a3c37c6a5a13?q=80&w=2069&auto=format&fit=crop'); /* Professional stock photo */
    background-size: 120%;
    background-position: center;
    color: #fff; /* This text is on a dark image, so it should always be white */
    text-align: center;
    padding: 25px 20px;
}

.hero-content h1 {
    font-size: 3.2rem;
    margin-bottom: 0.5rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    padding: 14px 28px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--color-secondary);
    color: #fff;
    border-color: var(--color-secondary);
}
.btn-primary:hover {
    background-color: #218838;
    border-color: #218838;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: #fff;
    border: 2px solid #fff;
}
.btn-secondary:hover {
    background-color: #fff;
    color: var(--color-text);
}

.btn-whatsapp {
    background-color: #25D366;
    color: #fff;
    border-color: #25D366;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-whatsapp:hover {
    background-color: #1DAA53;
    border-color: #1DAA53;
    transform: translateY(-2px);
}

.btn-facebook {
    background-color: #1877F2; /* Facebook Blue */
    color: #fff;
    border-color: #1877F2;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-facebook:hover {
    background-color: #166fe5;
    border-color: #166fe5;
    transform: translateY(-2px);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Why Choose Us Section --- */
.why-us-section {
    background-image: linear-gradient(var(--color-overlay-why-us), var(--color-overlay-why-us)), url('Images/S&S Driving School Logo Original.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed; /* Creates a cool parallax effect */
}

.features-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item {
    background: var(--color-surface-card);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--color-shadow);
    text-align: center;
    flex: 1;
    min-width: 280px;
    max-width: 350px;
}

.feature-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.feature-item h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

/* --- Services Section --- */
.services-section {
    background-image: linear-gradient(var(--color-overlay-services), var(--color-overlay-services)), url('https://images.unsplash.com/photo-1503376780353-7e6692767b70?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Creates a cool parallax effect */
}

.service-cards-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.service-card {
    background-color: var(--color-surface-card);
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--color-shadow);
    max-width: 275px; /* Reduced to fit 4 cards in a row */
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid var(--color-primary);
    overflow: hidden; /* Keeps the image corners rounded */
    display: flex;
    flex-direction: column;
    flex: 1; /* Allow cards to grow if space is available */
    min-width: 250px; /* Prevent cards from becoming too narrow */
}

.service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.service-card-content {
    padding: 2rem;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.service-card h3 {
    color: var(--color-primary);
    margin-top: 0;
}

.price {
    display: block;
    margin-top: 1.5rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-secondary);
    font-family: 'Poppins', sans-serif;
}

/* --- Booking Modal --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    /* New background image with overlay */
    background: var(--color-surface-card);
    background-position: center;
    margin: 5vh auto; /* Use viewport height for better vertical centering */
    padding: 25px;
    border: none;
    width: 80%;
    max-width: 360px; /* Made the form more compact */
    border-radius: 8px;
    position: relative;
    animation: slide-down 0.4s ease-out;
    /* Added for internal scrolling on small screens */
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

@keyframes slide-down {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Added for form field animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-button {
    color: var(--color-text-muted);
    position: absolute; /* Better positioning than float */
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: var(--color-text);
    text-decoration: none;
}

#booking-form .form-group {
    margin-bottom: 15px;
    /* Animation for form fields */
    opacity: 0; /* Start hidden for animation */
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Staggered animation delays for a nice effect */
#booking-form .form-group:nth-of-type(1) { animation-delay: 0.1s; }
#booking-form .form-group:nth-of-type(2) { animation-delay: 0.2s; }
#booking-form .form-group:nth-of-type(3) { animation-delay: 0.3s; }
#booking-form .form-group:nth-of-type(4) { animation-delay: 0.4s; }
#booking-form .form-group:nth-of-type(5) { animation-delay: 0.5s; }

#booking-form label { display: block; margin-bottom: 5px; font-weight: 500; }
#booking-form input, #booking-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s;
    background-color: var(--color-background);
    color: var(--color-text);
}

/* Style for required fields that are not yet filled */
#booking-form input:invalid,
#booking-form textarea:invalid {
    border-left: 4px solid #e74c3c;
}

#booking-form input:focus,
#booking-form textarea:focus {
    border-color: var(--color-primary);
    outline: none;
}

    .phone-input-group {
        display: flex;
        gap: 0.5rem;
    }

    .phone-input-group select {
        padding: 10px;
        border: 1px solid var(--color-border);
        border-radius: 4px;
        background-color: var(--color-background);
        color: var(--color-text);
        transition: border-color 0.3s;
        flex-shrink: 0; /* Prevent the select from shrinking */
    }

    .phone-input-group select:focus {
        border-color: var(--color-primary);
        outline: none;
    }

    .phone-input-with-flag {
        /* This wrapper will act like the input field */
        display: flex;
        align-items: center;
        flex-grow: 1;
        border: 1px solid var(--color-border);
        border-radius: 4px;
        background-color: var(--color-background);
        transition: border-color 0.3s;
    }

    /* When the input inside is focused, highlight the whole wrapper */
    .phone-input-with-flag:focus-within {
        border-color: var(--color-primary);
    }

    img#phone-flag-display {
        /* Using an img tag now */
        width: 25px;
        height: auto;
        margin: 0 8px 0 12px;
    }

    /* The actual input field should be transparent and borderless */
    .phone-input-with-flag input#phone {
        border: none;
        outline: none;
        padding: 10px 10px 10px 0; /* Remove left padding */
        width: 100%;
        background-color: transparent;
    }

.form-buttons { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 20px; opacity: 0; animation: fadeInUp 0.5s ease-out forwards; animation-delay: 0.6s; }
.btn-cancel { background-color: #6c757d; color: white; border: none; cursor: pointer; }
.btn-confirm { background-color: var(--color-secondary); color: white; border: none; cursor: pointer; }

/* --- Contact Page Section --- */
.contact-page-section {
    background-color: var(--color-surface);
    padding-top: 20px;
    padding-bottom: 20px;
}

/* Override default h2 color for this section */
.contact-page-section h2 {
    color: var(--color-text);
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
    background: var(--color-surface-card);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--color-shadow);
}

.contact-info, .contact-areas {
    flex: 1;
    min-width: 300px;
}

.contact-info h3, .contact-areas h3 {
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-secondary);
    display: inline-block;
}

.info-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-items-container .info-item {
    flex: 1;
    min-width: 160px; /* Ensures items don't get too squished */
}

.info-item-group {
    flex: 1;
    min-width: 160px;
}

.info-item-group .info-item:last-child {
    margin-bottom: 0;
}

.info-item {
    margin-bottom: 1.5rem;
}

.info-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--color-text);
}

.info-item p, .info-item a {
    margin: 0;
    color: var(--color-text-muted);
    text-decoration: none;
    line-height: 1.7;
}

.info-item a:hover {
    color: var(--color-primary);
}

.service-area-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.service-area-list li {
    background-color: var(--color-surface);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.contact-page-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* --- Footer --- */
.main-footer {
    background-color: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-column {
    flex: 1;
    min-width: 280px; /* Prevents columns from getting too squished */
}

.footer-center {
    text-align: center;
}

.footer-right {
    text-align: right;
}

.footer-right p {
    display: inline-block;
    text-align: left;
}

.main-footer p:first-child strong {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    color: var(--color-footer-heading);
}

.main-footer a {
    color: var(--color-footer-heading);
    text-decoration: none;
}

.main-footer a:hover {
    text-decoration: underline;
}

.footer-copyright {
    flex-basis: 100%;
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 992px) {
    .main-footer {
        flex-direction: column;
        text-align: center;
    }

    .footer-column {
        min-width: auto;
    }

    .footer-right {
        text-align: center;
    }
}

/* --- Floating Social Icons --- */
.social-float {
    position: fixed;
    width: 60px;
    height: 60px;
    right: 30px;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.25);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.social-float:hover {
    transform: scale(1.1);
}

.whatsapp-float {
    bottom: 30px;
    background-color: #25D366;
}

.facebook-float {
    bottom: 100px;
    background-color: #1877F2; /* Facebook Blue */
}

/* --- Hamburger Menu --- */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--color-text);
}

/* --- Responsive Media Query --- */
@media(max-width: 768px) {
    html {
        scroll-padding-top: 92px; /* Adjusts offset for the smaller mobile header */
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .navbar {
        flex-direction: row;
        justify-content: space-between;
    }

    .logo img {
        height: 60px; width: auto;
    }

    .main-header {
        padding: 1rem 5%;
    }

     .nav-menu {
         position: fixed;
         left: -100%;
         top: 92px; /* Adjust based on header height */
         gap: 0;
         flex-direction: column;
         background-color: var(--color-header-bg);
         width: 100%;
         text-align: center;
         transition: 0.3s;
         box-shadow: 0 10px 27px var(--color-shadow);
         z-index: 999; /* Ensure it's above other content but below the header */
     }
 
     .nav-menu.active {
         left: 0;
     }
 
     .nav-item {
         padding: 1rem 0;
     }
}