:root {
    --text-main: #2d3748;
    --text-light: #718096;
    --bg-light: #f8fafc;
    --bg-black:  #020100;
    --bg-brown:  #251e00;
    --bg-grey: #64748b;
    --color-green: #4ade80;
    --color-red: #f87171;
    --color-blue: #38bdf8;
    --color-purple: #a855f7;
    --color-yellow: #facc15;
    --color-black:  #020100;
    --color-brown:  #251e00;
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: relative;
    /*top: 0; left: 0; width: 100%;*/
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    /*z-index: 100;*/
    padding: 15px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #1e293b;
}

.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

.btn {
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-header {
    background-color: #334155;
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-header:hover { background-color: #1e293b; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    padding: 60px 0 80px 0;
    position: relative;
    border-bottom-left-radius: 50px;
    border-bottom-right-radius: 50px;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 2;
}

.hero-image-container {
    flex: 1;
    position: relative;
}

.hero-image-container::before {
    content: '';
    position: absolute;
    top: -20px; left: -20px; right: 20px; bottom: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 40px 100px 40px 100px;
    z-index: -1;
}

.hero-img {
    width: 100%;
    max-width: 400px;
    border-radius: 40px 100px 40px 100px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: block;
}

.hero-text {
    flex: 1.2;
    color: white;
}

.hero-text h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    opacity: 0.95;
}

.btn-hero {
    background-color: #334155;
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
    margin-top: 10px;
    display: inline-block;
}

.btn-hero:hover { background-color: #1e293b; }

/* About */
.about { padding-top: 80px; 
    padding-bottom: 80px;
    max-width: 900px; }
.about h2 { font-size: 2rem; margin-bottom: 30px; color: #1e293b; }
.about p { font-size: 1.05rem; color: #475569; margin-bottom: 20px; }

/* Subjects */
.subjects { padding-top: 40px;
    padding-bottom:60px; }
.subjects h2 { font-size: 1.8rem; margin-bottom: 30px; color: #1e293b; }

.subject-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    padding: 10px 5px;
}

.subject-card {
    flex: 0 0 280px;
    height: 180px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 20px;
    scroll-snap-align: start;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.subject-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 15px 20px -5px rgba(0,0,0,0.15);
}

.bg-green { background-color: var(--color-green); }
.bg-red { background-color: var(--color-red); }
.bg-blue { background-color: var(--color-blue); }
.bg-purple { background-color: var(--color-purple); }
.bg-yellow { background-color: var(--color-yellow); color: #422006; }
.bg-black { background-color: var(--color-black); }
.bg-grey { background-color: #64748b; }
.bg-brown { background-color: var(--color-brown);}

/* Reviews */
.reviews { padding-top: 40px;
    padding-bottom: 80px; }
.reviews h2 { font-size: 1.8rem; margin-bottom: 30px; color: #1e293b; }

.review-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.review-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    position: relative;
}

.border-green { border-left: 6px solid var(--color-green); }
.border-red { border-left: 6px solid var(--color-red); }
.border-blue { border-left: 6px solid var(--color-blue); }
.border-purple { border-left: 6px solid var(--color-purple); }

.review-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

/* Updated Avatar for Reviews */
.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e2e8f0;
}

.review-header h3 { font-size: 1.1rem; color: #334155; }
.review-card p { color: #475569; font-size: 0.95rem; }

/* Form Section */
.form-section {
    background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
    padding: 80px 0;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
}

.form-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    color: white;
}

.form-container h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 40px;
    line-height: 1.3;
}

form { text-align: left; }

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #ffffff;
    color: #333;
    outline: none;
}

.form-group input::placeholder { color: #94a3b8; }

/* Schedule Grid */
.schedule-wrapper {
    margin: 25px 0;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
}

.schedule-wrapper h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: white;
}

.schedule-grid-container {
    overflow-x: auto;
    padding-bottom: 10px;
}

.schedule-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 650px;
    text-align: center;
    font-size: 0.85rem;
    color: white;
    table-layout: fixed; 
}

.schedule-table th {
    padding: 5px 0;
    font-weight: 600;
    opacity: 0.8;
}

.schedule-table td {
    padding: 8px 0;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

/* Set exact width for 18 hour columns + 1 day column */
.schedule-table th, .schedule-table td {
    width: calc(100% / 19);
}

.schedule-table td:hover { background: rgba(255,255,255,0.2); }

.schedule-table td.selected {
    background-color: #ffffff;
    color: #166534;
    font-weight: bold;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.day-label {
    text-align: left !important;
    padding-left: 10px !important;
    font-weight: bold;
    white-space: nowrap;
    width: 60px !important; /* Fixed width for day names */
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.checkbox-group input {
    width: 20px !important;
    height: 20px !important;
    margin-top: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group a {
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.btn-submit {
    width: 100%;
    background-color: #166534;
    color: white;
    padding: 18px;
    font-size: 1.1rem;
    border-radius: 10px;
    margin-top: 10px;
}

.btn-submit:hover { background-color: #14532d; }
.form-message { margin-top: 15px; font-weight: bold; text-align: center; }

/* Footer */
.footer {
    background-color: #f8fafc;
    text-align: center;
    padding: 30px 0;
    font-size: 0.85rem;
    color: #64748b;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    position: relative;
}

/* Legal Modals */
.legal-modal .modal-content {
    max-width: 800px;
    max-height: 85vh;
    padding: 30px;
}

.text-left { text-align: left; }

.scroll-text {
    max-height: 65vh;
    overflow-y: auto;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #334155;
    padding-right: 15px;
}
.scroll-text h3 { margin: 20px 0 10px 0; color: #0f172a; font-size: 1.2rem; }
.scroll-text h4 { margin: 15px 0 5px 0; color: #334155; font-size: 1rem; }
.scroll-text p { margin-bottom: 10px; line-height: 1.6; }

.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
    z-index: 10;
}

.modal-content h2 { margin-bottom: 15px; color: #16a34a; }
.modal-content p { margin-bottom: 25px; color: #475569; }

/* Responsive */
@media (max-width: 768px) {
    .hero-content { flex-direction: column; text-align: center; padding-top: 40px; }
    .hero-image-container::before { display: none; }
    .form-row { flex-direction: column; gap: 0; }
    .legal-modal .modal-content { padding: 20px; }

        .header-content {
        gap: 10px;
    }
        .btn-header {
        padding: 8px 12px; /* Makes the button slightly smaller */
        font-size: 0.8rem; /* Shrinks the text inside the button */
        white-space: normal; /* Allows text to wrap if needed, instead of overflowing */
        text-align: center;
        line-height: 1.2;
    }
    
    .logo span {
        font-size: 1rem;
    }

        .hide-on-mobile {
        display: none;
    }
}

/* Payment Section */
.payment-section {
    padding: 60px 0 100px 0;
    background-color: #f8fafc;
}

.payment-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.payment-box h2 {
    color: #1e293b;
    margin-bottom: 10px;
}

.payment-box > p {
    margin-bottom: 30px;
    color: #475569;
}

.payment-content {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.payment-left {
    flex: 1;
}

.payment-left label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}

.payment-left input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.1rem;
    margin-bottom: 20px;
    outline: none;
}

.payment-left input:focus {
    border-color: #3b82f6;
}

.btn-pay {
    display: block;
    width: 100%;
    background-color: #3b82f6; /* Blue */
    color: white;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-pay:hover {
    background-color: #2563eb;
}

.payment-note {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 15px;
    font-style: italic;
}

.payment-right {
    flex: 0 0 250px;
}

.qr-code {
    width: 100%;
    max-width: 250px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 10px;
}

@media (max-width: 768px) {
    .payment-content {
        flex-direction: column;
    }
    .payment-right {
        flex: 1;
        width: 100%;
        margin-top: 20px;
    }
}

/* --- Portal Auth & Dashboard Styles --- */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    margin: 0;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.auth-box h2 { color: #1e293b; margin-bottom: 10px; }
.auth-box p { color: #64748b; margin-bottom: 20px; }
.auth-box input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
}
.alert { padding: 10px; border-radius: 8px; margin-bottom: 15px; }
.alert-error { background: #fee2e2; color: #b91c1c; }

.dash-nav {
    background: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logout-btn {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

.dash-container {
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.dash-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-top: 4px solid #3b82f6;
}

.dash-card h3 { margin-bottom: 10px; color: #1e293b; }
.dash-card p { color: #475569; margin-bottom: 20px; }

.dash-btn {
    display: block;
    text-align: center;
    background: #3b82f6;
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s;
}
.dash-btn:hover { background: #2563eb; }
.text-muted { color: #94a3b8; font-style: italic; }

/* --- New Header Layout --- */
.header {
    position: relative; 
    background: #ffffff; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px 0; 
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows wrapping on mobile */
    gap: 15px;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #3b82f6; /* Blue hover */
}

.nav-right .btn-login {
    text-decoration: none;
    color: #1e293b;
    font-weight: 700;
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-right .btn-login:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Mobile Header Adjustments */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
    }
    .nav-left, .nav-right {
        width: 100%;
        text-align: center;
    }
    .btn-header, .btn-login {
        display: block;
        width: 100%;
    }
    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        font-size: 0.85rem;
    }
}

/* --- Fix Broken Hero Image --- */
.hero-img {
    width: 100%;
    max-width: 400px;
    min-height: 400px; /* Prevents it from collapsing if image is missing */
    background-color: #cbd5e1; /* Grey fallback background */
    border-radius: 40px 100px 40px 100px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: block;
    object-fit: cover;
}

/* Back to Top Button */
#backToTop {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    font-size: 24px;
    border: none;
    outline: none;
    background-color: #3b82f6;
    color: white;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s, transform 0.3s;
}

#backToTop:hover {
    background-color: #2563eb;
    transform: translateY(-5px);
}