@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #059669; /* Rich Emerald */
    --primary-glow: rgba(5, 150, 105, 0.15);
    --primary-dark: #047857;
    --secondary: #d97706; /* Amber Gold */
    --secondary-glow: rgba(217, 119, 6, 0.15);
    --bg-light: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(226, 232, 240, 0.8);
    --border-glow: rgba(5, 150, 105, 0.1);
    --text-main: #334155; /* Slate-700 */
    --text-muted: #64748b; /* Slate-500 */
    --text-dark: #0f172a; /* Slate-900 */
    --success: #10b981;
    --danger: #ef4444;
    --info: #3b82f6;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(5, 150, 105, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(217, 119, 6, 0.04) 0%, transparent 40%),
        linear-gradient(rgba(248, 250, 252, 0.85), rgba(241, 245, 249, 0.92)),
        url('bg-hero.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Glassmorphism Containers */
.glass-container {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    padding: 2.5rem;
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
}

.glass-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(0, 0, 0, 0.01),
        transparent
    );
    transform: rotate(30deg);
    pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-dark);
}

.text-gradient {
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 60%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Logo and Header Styling */
.header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.logo-school {
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
    margin-bottom: 1rem;
    transition: var(--transition);
}

.logo-school:hover {
    transform: scale(1.05);
}

.title-main {
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.subtitle-main {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Progress Steps */
.progress-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
    padding: 0 1rem;
}

.progress-stepper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(15, 23, 42, 0.05);
    z-index: 1;
    transform: translateY(-50%);
}

.progress-bar-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    z-index: 1;
    transform: translateY(-50%);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px var(--primary-glow);
}

.step-indicator {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(15, 23, 42, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-muted);
    position: relative;
    z-index: 2;
    transition: var(--transition);
    cursor: pointer;
    user-select: none;
}

.step-indicator.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 12px var(--primary-glow);
    transform: scale(1.15);
}

.step-indicator.completed {
    border-color: var(--secondary);
    background: var(--secondary);
    color: #ffffff;
    box-shadow: 0 0 12px var(--secondary-glow);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    color: var(--text-dark);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control option {
    background: #ffffff;
    color: var(--text-dark);
}

/* Buttons */
.btn-premium {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: white;
    padding: 0.9rem 2rem;
    font-weight: 600;
    font-family: var(--font-heading);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-premium:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: var(--text-main);
    padding: 0.9rem 2rem;
    font-weight: 600;
    font-family: var(--font-heading);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(5, 150, 105, 0.05);
    color: var(--primary);
}

.btn-danger-custom {
    background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%);
    border: none;
    color: white;
    padding: 0.9rem 2rem;
    font-weight: 600;
    font-family: var(--font-heading);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.button-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    gap: 1rem;
}

/* Card Quiz Selector */
.quiz-question-box {
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.quiz-text {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.poem-box {
    background: rgba(5, 150, 105, 0.03); /* Soft green tint for readability */
    border-left: 5px solid var(--primary);
    padding: 1.75rem;
    border-radius: var(--radius-sm);
    font-style: normal;
    white-space: pre-wrap;
    margin-bottom: 2.25rem;
    max-height: 400px;
    overflow-y: auto;
    font-size: 1.05rem;
    font-family: var(--font-body);
    color: var(--text-dark);
    line-height: 1.75;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.01);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.option-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
}

.option-card:hover {
    background: rgba(5, 150, 105, 0.02);
    border-color: rgba(5, 150, 105, 0.25);
    transform: translateX(5px);
}

.option-card.selected {
    background: rgba(5, 150, 105, 0.06);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.05);
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: var(--transition);
}

.option-card.selected .option-letter {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 6px var(--primary-glow);
}

.option-text {
    flex: 1;
    font-size: 1rem;
    color: var(--text-main);
}

/* Result Dashboard */
.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.result-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.result-score-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.result-score-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
}

.result-score-card.gold::before {
    background: var(--secondary);
}

.result-score-val {
    font-size: 3rem;
    font-weight: 800;
    font-family: var(--font-heading);
    margin: 0.5rem 0;
    color: var(--text-dark);
}

.learning-badge {
    background: linear-gradient(135deg, var(--secondary) 0%, #d97706 100%);
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 700;
    display: inline-block;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.2);
}

.learning-description {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
}

/* Admin Dashboard layout */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    width: 100%;
}

.admin-sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: relative;
    width: 100%;
    min-height: 100vh;
    z-index: 10;
    box-shadow: 4px 0 15px rgba(15, 23, 42, 0.02);
}

.admin-content {
    padding: 2.5rem;
    width: 100%;
    overflow-x: hidden;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
}

.admin-nav-link:hover, .admin-nav-link.active {
    color: var(--primary);
    background: rgba(5, 150, 105, 0.06);
    border-left: 3px solid var(--primary);
}

.admin-nav-link.logout-link {
    margin-top: 5rem;
    color: var(--danger);
}

.admin-nav-link.logout-link:hover {
    background: rgba(239, 68, 68, 0.06);
    border-left: 3px solid var(--danger);
    color: var(--danger);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.02);
}

.stat-val {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: var(--font-heading);
    margin-top: 0.5rem;
    color: var(--text-dark);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.03);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.admin-table th {
    background: rgba(15, 23, 42, 0.02);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-family: var(--font-heading);
}

.admin-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    color: var(--text-main);
    vertical-align: middle;
}

.admin-table tr:hover {
    background: rgba(15, 23, 42, 0.015);
}

/* Badge colors */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.badge-primary {
    background: rgba(5, 150, 105, 0.08);
    color: var(--primary);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-warning {
    background: rgba(217, 119, 6, 0.08);
    color: var(--secondary);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Tabs */
.tabs-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-family: var(--font-heading);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--text-dark);
    background: rgba(15, 23, 42, 0.03);
    border-bottom: 2px solid var(--primary);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Modal and Utility */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
    transform: scale(0.9);
    transition: var(--transition);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-backdrop.show .modal-content {
    transform: scale(1);
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        display: flex;
        flex-direction: column;
    }
    .admin-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 1.5rem;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        border-right: none;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    }
    .admin-sidebar > div {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        justify-content: center;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        padding-bottom: 0.75rem;
    }
    .admin-sidebar img {
        height: 35px !important;
        margin-bottom: 0 !important;
    }
    .admin-sidebar h4, .admin-sidebar p {
        display: inline-block;
        margin: 0 !important;
    }
    .admin-nav {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 0.35rem;
        width: 100%;
        justify-content: center;
    }
    .admin-nav-link {
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
    }
    .admin-nav-link:hover, .admin-nav-link.active {
        border-left: none;
        border-bottom: 2px solid var(--primary);
    }
    .admin-nav-link[style*="margin-top"] {
        margin-top: 0 !important;
    }
    .admin-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem 1rem;
    }
    .glass-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    .progress-stepper {
        padding: 0;
    }
}

/* Print CSS Stylesheet */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    .print-sheet {
        background: #ffffff !important;
        color: #000000 !important;
        border: none !important;
        box-shadow: none !important;
        padding: 2cm !important;
        page-break-after: always;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .print-sheet:last-child {
        page-break-after: avoid;
    }
    
    .print-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 1rem !important;
    }
    
    .print-table th, .print-table td {
        border: 1px solid #000000 !important;
        padding: 8px !important;
        color: #000000 !important;
    }
}
