/* Variables */
:root {
    --primary-color: #3D85C6;
    /* Updated Blue */
    --secondary-color: #fc0f36;
    /* Updated Red */
    --accent-color: #F9A825;
    /* Gold/Yellow */
    --text-color: #333333;
    --light-bg: #F5F7FA;
    --white: #FFFFFF;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --font-main: 'Outfit', sans-serif;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

/* Prevent scrolling when mobile menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-transform: uppercase;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.bg-light {
    background-color: var(--light-bg);
}

/* Buttons */
.btn-primary,
.btn-submit,
.btn-hero {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover,
.btn-submit:hover,
.btn-hero:hover {
    background-color: #001a3a;
    transform: translateY(-2px);
}

/* Navigation */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: 80px;
    display: flex;
    align-items: center;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    white-space: nowrap;
    /* Prevent text wrapping */
}

.logo img {
    height: 50px;
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.navbar .btn-primary {
    color: var(--white) !important;
}

.nav-link:hover {
    color: var(--secondary-color);
}

.menu-toggle {
    display: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    position: relative;
}

.menu-toggle svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    transition: opacity 0.2s ease-in-out;
}

.menu-toggle .hamburger-icon {
    opacity: 1;
}

.menu-toggle .close-icon {
    opacity: 0;
}

.menu-toggle.active .hamburger-icon {
    opacity: 0;
}

.menu-toggle.active .close-icon {
    opacity: 1;
}

/* Hero Section */
.hero {
    height: 100vh;
    background-image: url('images/hero-banner.png');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-top: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 40%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 5%;
    /* Add some left padding */
}

.hero h1 {
    margin-bottom: 30px;
    /* Increased from 20px */
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
    /* Added spacing */
}

.hero-title-main {
    font-size: 5rem;
    color: var(--primary-color);
    font-weight: 800;
    display: block;
}

.hero-title-sub {
    font-size: 5rem;
    color: var(--secondary-color);
    font-weight: 800;
    display: block;
}

.hero-socials {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    /* Reduced to separate from buttons */
    justify-content: center;
    /* Center social icons */
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--white);
    border-radius: 5px;
    transition: var(--transition);
}

.social-icon.fb {
    background-color: #1877F2;
}

.social-icon.insta {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.social-icon.whatsapp {
    background-color: #25D366;
}

.social-icon:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {

    /* Enable smooth scroll with proximity snapping (not mandatory) */
    html {
        scroll-behavior: smooth;
        scroll-snap-type: y proximity;
    }

    body {
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }

    /* Make sections full height with proximity snap points */
    section {
        scroll-snap-align: start;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 40px 20px;
    }

    .hero-content {
        padding: 0 20px;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .hero-title-main {
        font-size: 3rem;
    }

    .hero-title-sub {
        font-size: 3rem;
    }

    /* Navigation indicators */
    .mobile-nav-dots {
        position: fixed;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 100;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .nav-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: rgba(0, 45, 98, 0.3);
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .nav-dot.active {
        background-color: var(--primary-color);
        height: 24px;
        border-radius: 4px;
    }
}

/* Desktop: hide mobile nav dots */
@media (min-width: 1025px) {
    .mobile-nav-dots {
        display: none;
    }
}

/* About Section */
.about-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card h3 {
    color: var(--primary-color);
    margin: 15px 0;
}

/* Headmaster Section */
.headmaster-profile {
    display: flex;
    align-items: center;
    gap: 50px;
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.headmaster-image {
    flex: 1;
    max-width: 400px;
}

.headmaster-image img {
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.headmaster-info {
    flex: 1.5;
}

.headmaster-info h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.credentials-list {
    list-style: disc;
    padding-left: 20px;
}

.credentials-list li {
    margin-bottom: 10px;
    color: #555;
}

/* Classes Section */
.tabs-container {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: #f0f0f0;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
}

.tabs-content {
    padding: 40px;
    display: grid;
    /* Stack all children in the same cell */
}

.tab-pane {
    grid-area: 1 / 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    /* Ensure it takes up space but is hidden */
    display: block;
}

.tab-pane.active {
    opacity: 1;
    pointer-events: auto;
    display: block;
}

.class-details {
    display: flex;
    gap: 40px;
    align-items: center;
}

.class-text {
    flex: 1;
}

.class-text h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.class-text p {
    margin-bottom: 15px;
}

.class-image {
    flex: 1;
}

.class-image img {
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Branches Section */
.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 350px));
    gap: 30px;
    justify-content: center;
}

.branch-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border-top: 5px solid var(--secondary-color);
    overflow: hidden;
}

/* Add variety to branch card borders */
.branch-card:nth-child(2n) {
    border-top-color: var(--primary-color);
}

.branch-card:nth-child(3n) {
    border-top-color: var(--accent-color);
}

.branch-card:hover {
    transform: translateY(-5px);
}

.branch-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.branch-card address {
    font-style: normal;
    color: #666;
    margin-bottom: 0;
    /* Removed bottom margin as it's now wrapped */
    flex-grow: 1;
}

.address-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.address-link:hover {
    color: var(--primary-color);
}

.address-link svg {
    width: 20px;
    height: 20px;
    color: var(--secondary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.branch-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-whatsapp {
    background-color: var(--white);
    color: #25D366;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-whatsapp:hover {
    background-color: #25D366;
    color: var(--white);
}

.btn-timetable {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-timetable:hover {
    background-color: #001a3a;
}

/* Contact Form */
.trial-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 45, 98, 0.1);
}

.btn-submit {
    width: 100%;
}

.disclaimer-text {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 20px;
    text-align: justify;
    line-height: 1.4;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    color: var(--white);
}

.footer-section p {
    color: var(--white);
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--white);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent-color);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.footer-links a {
    color: var(--white);
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    opacity: 0.6;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .section-title {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-dot {
        margin: 10px 0;
    }
}

/* Morley Branch Specific UI Refinements */
.action-row {
    display: flex;
    gap: 10px;
}

.action-row .btn-whatsapp {
    flex: 1;
    justify-content: center;
}

.downloads-section {
    margin-top: 15px;
    margin-bottom: 10px;
}

.downloads-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #AAA;
    /* Muted gray for label */
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
    display: block;
}

.btn-download {
    background-color: #F8F9FA;
    /* Very light gray */
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 500;
    /* Slightly less heavy than primary actions */
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    /* Spacing between stacked buttons */
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-download:hover {
    background-color: #E9ECEF;
    color: var(--primary-color);
}

.btn-download svg {
    width: 18px;
    /* Slightly smaller icon */
    height: 18px;
    color: #6c757d;
    /* Muted icon color */
}

.btn-download:hover svg {
    color: var(--primary-color);
}

@media (max-width: 1024px) {
    .nav-menu {
        gap: 0;
        /* Override desktop gap */
        padding: 10px 0;
        /* Reduced padding */
    }

    .nav-menu li {
        margin: 15px 0;
        margin-left: auto;
        margin-right: auto;
    }

    .dropdown-options li[data-value="all"] {
        display: none !important;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }


    /* Modal Styles */
    .headmaster-profile {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .headmaster-image {
        max-width: 100%;
    }

    .credentials-list {
        text-align: left;
    }

    .class-details {
        flex-direction: column-reverse;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Fix tabs for mobile */
    .tabs-header {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .tab-btn {
        flex: 1 1 calc(50% - 5px);
        min-width: calc(50% - 5px);
        padding: 15px 10px;
        font-size: 0.85rem;
    }

    .tabs-content {
        padding: 20px;
    }

    /* Mobile footer adjustments */
    .footer-links {
        gap: 15px;
        font-size: 0.9rem;
    }
}

/* Medium screen optimization - hide Home to prevent overflow */
@media (min-width: 769px) and (max-width: 1100px) {
    .nav-menu li:first-child {
        display: none;
        /* Hide Home link */
    }
}


/* Custom Dropdown */
.custom-dropdown {
    position: relative;
    display: inline-block;
    width: 140px;
    /* Reduced from 160px */
    font-size: 0.9rem;
    font-weight: 600;
}

.dropdown-selected {
    background-color: var(--white);
    color: var(--primary-color);
    padding: 8px 12px;
    /* Reduced padding */
    border-radius: 5px;
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.dropdown-selected span {
    display: flex;
    /* Ensure flag aligns with text */
    align-items: center;
    gap: 8px;
}

.dropdown-selected:hover {
    border-color: var(--secondary-color);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    width: 12px;
    height: auto;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--white);
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    overflow: hidden;
    display: none;
    z-index: 100;
    list-style: none;
    padding: 0;
}

.custom-dropdown.open .dropdown-options {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-options li {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-color);
    display: flex;
    /* Added for alignment */
    align-items: center;
    /* Added for alignment */
    gap: 8px;
    /* Added spacing */
}

.dropdown-options li:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

.dropdown-options li.selected {
    background-color: var(--primary-color);
    color: var(--white);
}

/* SVG Flags */
.flag-icon-mini {
    width: 24px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Subtle border for visibility */
    background-color: #fff;
    /* Ensure contrast */
}

/* Hero Location Buttons */
.hero-location-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    /* Increased to separate from CTA */
    justify-content: center;
    /* Center */
}

.btn-location {
    background-color: var(--primary-color);
    /* Navy Blue background */
    border: 2px solid var(--primary-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 30px;
    /* Pill shape */
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.95rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    /* Added for alignment */
    align-items: center;
    /* Added for alignment */
    gap: 8px;
    /* Added spacing */
}

.btn-location:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-location.active {
    background-color: var(--secondary-color);
    /* Red for active */
    border-color: var(--secondary-color);
    color: var(--white);
}

.hero-socials {
    justify-content: center;
    /* Center social icons */
}

@media (max-width: 768px) {
    .location-toggle-item {
        margin: 15px 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .custom-dropdown {
        width: 160px;
        /* Reduced from 200px */
        z-index: 1001;
        /* Above mobile menu */
    }

    .dropdown-options {
        z-index: 1001;
        /* Ensure dropdown options are visible */
        max-height: 300px;
        overflow-y: auto;
    }

    .hero-location-buttons {
        justify-content: center;
        /* Center on mobile */
    }
}

.hidden-loc {
    display: none !important;
}

/* Badges */
.headmaster-image {
    position: relative;
}

.flag-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--white);
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.flag-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--white);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    margin-bottom: 20px;
    display: inline-flex;
    padding: 15px;
    border-radius: 50%;
    background-color: rgba(37, 211, 102, 0.1);
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.modal-content p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.modal-content button {
    min-width: 150px;
}