:root {
    /* School Theme - "Classic Thai Pink" (Vibrant Pink & Dark Pink) */

    /* Primary: Vibrant Pink */
    --primary-main: #E91E63;
    /* Pink 500 */
    --primary-light: #F48FB1;
    /* Pink 200 */
    --primary-dark: #C2185B;
    /* Pink 700 */

    /* Secondary: Dark Pink / Burgundy Text */
    --secondary-main: #880E4F;
    /* Pink 900 */
    --secondary-light: #AD1457;
    /* Pink 800 */

    /* Backgrounds */
    --primary-bg: #FFF5F7;
    /* Very Light Pink bg */
    --sidebar-bg: linear-gradient(180deg, #FFFFFF 0%, #FFF0F5 100%);
    /* White to Lavender Blush */

    /* Text */
    --text-primary: #880E4F;
    /* Dark Pink */
    --text-secondary: #AD1457;
    /* Medium Pink */
    --text-light: #F06292;

    /* Neutrals */
    --white: #FFFFFF;
    --gray-100: #FFF0F5;
    /* Light Pinkish Gray */
    --gray-200: #F8BBD0;
    /* Pink 100 */
    --gray-300: #F48FB1;
    /* Pink 200 */

    /* Functional Colors */
    --success: #4CAF50;
    /* Green */
    --warning: #FFC107;
    /* Amber */
    --error: #D32F2F;
    /* Red */

    /* Glassmorphism & Cards */
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: 1px solid rgba(233, 30, 99, 0.2);
    --glass-shadow: 0 4px 6px -1px rgba(233, 30, 99, 0.1), 0 2px 4px -1px rgba(233, 30, 99, 0.05);

    /* Spacing & Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --header-height: 70px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Prompt', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Clean gradient check pattern overlay or just solid */
    background: linear-gradient(to bottom, #FFFFFF, #F8F9FA);
    position: relative;
    /* For pseudo-element absolute positioning */
}

/* Watermark */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    /* Adjust size as needed */
    height: 600px;
    background-image: url('assets/logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.04;
    /* Very subtle */
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--secondary-main);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.2rem;
    color: var(--secondary-main);
    /* Removed Gradient text for cleaner look */
    background: none;
    -webkit-text-fill-color: initial;
}

/* Layout Compontnets */
.container {
    max-width: 1100px;
    /* Slightly narrower for focus */
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

/* Pink Glass Card */
.glass-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    /* Soft Pink Border */
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.05);
    /* Pinkish Shadow */
    transition: all var(--transition-smooth);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(233, 30, 99, 0.15);
    border-color: var(--primary-main);
}

/* Refined Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    /* Tighter radius */
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.95rem;
    gap: 8px;
    letter-spacing: 0.3px;
    text-transform: none;
    /* Removed uppercase */
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-main), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(233, 30, 99, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary-main);
    border: 1px solid var(--primary-light);
    padding: 10px 24px;
    border-radius: var(--radius-lg);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.btn-secondary:hover {
    background: var(--gray-100);
    color: var(--primary-dark);
    border-color: var(--primary-main);
}

.btn-block {
    width: 100%;
}

/* Tabs */
.tab-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 0;
}

.tab-btn {
    background: white;
    border: 1px solid var(--primary-light);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.tab-btn.active {
    background: var(--primary-main);
    color: white;
    border-color: var(--primary-main);
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.tab-btn:hover:not(.active) {
    background: var(--primary-light);
    color: var(--primary-main);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--gray-100);
    border: 1px solid transparent;
    /* No border initially */
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    background: var(--white);
    border-color: var(--primary-main);
    box-shadow: 0 0 0 3px rgba(255, 128, 171, 0.1);
}

/* Logo Utilities */
.logo-icon {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo-large {
    height: 100px;
    width: auto;
    object-fit: contain;
    margin-bottom: 24px;
    /* Removed drop-shadow for cleaner look */
}

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

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

.animate-enter {
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.text-navy {
    color: var(--secondary-main);
}

/* Removed Blobs */

/* Tables (Upcoming) */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background: var(--secondary-main);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
}

th:first-child {
    border-top-left-radius: var(--radius-md);
}

th:last-child {
    border-top-right-radius: var(--radius-md);
}

td {
    padding: 16px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    color: var(--text-primary);
}

tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-md);
}

tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-md);
}

tr:hover td {
    background: #FAFAFA;
}

/* Specific Layouts */
.lesson-grid {
    display: grid;
    grid-template-columns: 3.5fr 1fr;
    gap: 30px;
}

.login-card {
    max-width: 550px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: 50px 40px;
}

/* --- Responsive Design (iPad & Mobile First) --- */

/* Tablet (iPad Portrait & Landscape: 768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 20px;
        max-width: 95%;
        /* Use more width on tablets */
    }

    h1 {
        font-size: 1.8rem;
        /* Slightly smaller heading */
    }

    /* Ensure grids don't get too squished */
    .glass-card {
        padding: 30px;
        /* Reduce padding slightly */
    }

    /* Force 2 columns on tablet for dashboard grids */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Stack Lesson View on Tablet/iPad to give video full width */
    .lesson-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .login-card {
        padding: 40px 30px;
        /* Reduce padding on tablet */
    }
}

/* Mobile (iPhone: < 768px) */
@media (max-width: 768px) {
    .main-content {
        padding: 20px 15px;
        /* Less horizontal padding */
        align-items: flex-start;
        /* Top align on mobile */
    }

    .glass-card {
        padding: 25px 20px;
        border-radius: 16px;
        /* Slightly smaller radius */
    }

    .login-card {
        padding: 30px 20px;
        /* Further reduce padding on mobile */
        max-width: 100%;
    }

    h1 {
        font-size: 1.6rem;
    }

    /* Stack everything on mobile */
    div[style*="display: grid"],
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Flex headers should stack */
    div[style*="justify-content: space-between"] {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Full width buttons */
    .btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
        /* Larger touch target */
    }

    /* Adjust inputs for touch */
    .form-control {
        font-size: 16px;
        /* Prevent iOS zoom */
        padding: 14px;
    }
}

/* Touch Target Optimization */
@media (hover: none) {

    .btn,
    .form-control,
    button {
        min-height: 48px;
        /* Ensure strictly clickable */
    }
}