/* ============================================
   RAMAYAN EXAM - BLAZOR THEME
   Sanskruti Samvardhan Pratishthan
   ============================================ */

:root {
    --saffron: #E8860C;
    --saffron-light: #F5A623;
    --saffron-dark: #C26E00;
    --maroon: #7B1818;
    --maroon-deep: #5A0F0F;
    --maroon-light: #9C2828;
    --gold: #C49B2C;
    --gold-light: #D4AF37;
    --gold-dark: #A07D1C;
    --cream: #FDF6E3;
    --cream-dark: #F5E6C8;
    --parchment: #F8F0DD;
    --brown-dark: #2C1810;
    --white: #FFFFFF;
    --bg-primary: #FDF6E3;
    --bg-secondary: #F5EDD8;
    --text-primary: #2C1810;
    --text-secondary: #5A4230;
    --text-muted: #8B7355;
    --border: #E0D5C0;
    --shadow: rgba(44, 24, 16, 0.1);
    --shadow-lg: rgba(44, 24, 16, 0.15);
    --easy: #4A7C4F;
    --medium: #E8860C;
    --difficult: #C0392B;
    --very-difficult: #7B1818;
    --header-height: 65px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
}

.bg-texture {
    background-color: var(--cream);
    background-image: radial-gradient(circle at 25% 25%, rgba(232,134,12,0.03) 0%, transparent 50%),
                      radial-gradient(circle at 75% 75%, rgba(123,24,24,0.03) 0%, transparent 50%);
}

.hindi-text { font-family: 'Tiro Devanagari Hindi', serif; }
.hindi-title { font-family: 'Tiro Devanagari Hindi', serif; font-size: 2.5rem; }

h1, h2, h3, h4, h5, h6 { font-family: 'Cinzel', serif; color: var(--maroon); }

a { color: var(--saffron); text-decoration: none; }
a:hover { color: var(--saffron-dark); }

.hidden { display: none !important; }

/* ---- HEADER ---- */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem; height: var(--header-height);
    background: linear-gradient(135deg, var(--maroon-deep), var(--maroon));
    color: white; position: sticky; top: 0; z-index: 1000;
}
.header-logo { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.header-logo-img {
    height: 45px; width: auto; max-width: 400px;
    object-fit: contain; object-position: left center;
    background: rgba(255,255,255,0.95); border-radius: 6px; padding: 3px 10px;
}
.admin-badge {
    background: var(--saffron); color: white; padding: 0.25rem 0.75rem;
    border-radius: 6px; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
}
.org-name { font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.95rem; color: var(--gold-light); letter-spacing: 1px; text-transform: uppercase; }
.org-name-hindi { font-family: 'Tiro Devanagari Hindi', serif; font-size: 0.85rem; color: var(--cream-dark); }
.header-nav { display: flex; align-items: center; gap: 1.5rem; }
.header-nav a, .header-nav button {
    color: var(--cream-dark); font-size: 0.85rem; font-weight: 500;
    background: none; border: none; cursor: pointer; text-decoration: none;
    transition: var(--transition);
}
.header-nav a:hover, .header-nav button:hover { color: var(--gold-light); }
.nav-btn-primary {
    background: var(--saffron) !important; color: white !important;
    padding: 0.4rem 1.2rem; border-radius: 6px;
}

.pattern-border-bottom { border-bottom: 3px solid var(--gold); }
.pattern-border-top { border-top: 3px solid var(--gold); }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.65rem 1.5rem; border: none; border-radius: 8px;
    font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn-sm { padding: 0.45rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-primary { background: var(--saffron); color: white; }
.btn-primary:hover { background: var(--saffron-dark); color: white; }
.btn-maroon { background: var(--maroon); color: white; }
.btn-maroon:hover { background: var(--maroon-deep); color: white; }
.btn-secondary { background: rgba(255,255,255,0.15); color: white; border: 2px solid rgba(255,255,255,0.3); }
.btn-secondary:hover { background: rgba(255,255,255,0.25); color: white; }
.btn-success { background: var(--easy); color: white; }
.btn-success:hover { opacity: 0.9; color: white; }
.btn-danger { background: var(--difficult); color: white; }
.btn-danger:hover { opacity: 0.9; color: white; }
.btn-gold { background: var(--gold); color: white; }
.btn-gold:hover { background: var(--gold-dark); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--saffron); color: var(--saffron); }

/* ---- CARDS ---- */
.card {
    background: var(--white); border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow); overflow: hidden;
}
.card-header {
    padding: 1rem 1.5rem; font-family: 'Cinzel', serif; font-weight: 600;
    font-size: 1rem; color: var(--maroon);
    background: linear-gradient(to right, rgba(232,134,12,0.06), transparent);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.5rem; justify-content: space-between;
}
.card-body { padding: 1.5rem; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-weight: 600; font-size: 0.85rem; color: var(--text-secondary); }
.form-control {
    width: 100%; padding: 0.7rem 1rem; border: 2px solid var(--border);
    border-radius: 8px; font-family: 'Poppins', sans-serif; font-size: 0.9rem;
    background: var(--white); color: var(--text-primary);
    transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(232,134,12,0.15); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; }

/* ---- ALERTS ---- */
.alert-error {
    padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem;
    background: rgba(192,57,43,0.1); border: 1px solid var(--difficult);
    color: var(--difficult); font-size: 0.85rem;
}
.alert-info {
    padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem;
    background: rgba(232,134,12,0.1); border: 1px solid var(--saffron);
    color: var(--saffron-dark); font-size: 0.85rem;
}

/* ---- HERO ---- */
.hero {
    background: linear-gradient(135deg, rgba(90,15,15,0.82), rgba(123,24,24,0.75), rgba(44,24,16,0.8)),
                url('../images/hero-bg.png') center/cover no-repeat;
    padding: 5rem 2rem; text-align: center; color: white;
    position: relative; overflow: hidden; min-height: 500px;
    display: flex; align-items: center; justify-content: center;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(232,134,12,0.12) 0%, transparent 60%),
                radial-gradient(circle at 80% 50%, rgba(196,155,44,0.08) 0%, transparent 60%);
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero-badge {
    display: inline-block; padding: 0.4rem 1.5rem; border-radius: 50px;
    background: rgba(232,134,12,0.2); border: 1px solid rgba(232,134,12,0.4);
    color: var(--gold-light); font-size: 0.85rem; font-weight: 500; margin-bottom: 1.5rem;
}
.hero h1 { font-size: 2.5rem; color: var(--gold-light); margin-bottom: 0.25rem; }
.hero-subtitle { font-size: 1.05rem; color: var(--cream-dark); max-width: 600px; margin: 1rem auto 0; line-height: 1.7; }
.hero-cta { margin-top: 2rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---- INFO SECTIONS ---- */
.info-section { padding: 3rem 2rem; max-width: 1100px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 1.5rem; }
.section-header h2 { font-size: 1.75rem; }
.decorative-divider { text-align: center; margin: 1rem 0 2rem; font-size: 1.5rem; color: var(--saffron); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.info-card {
    background: var(--white); padding: 1.5rem; border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow); text-align: center;
    transition: var(--transition);
}
.info-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px var(--shadow-lg); }
.info-card .icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.info-card h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.info-card .value { font-size: 1.8rem; font-weight: 800; color: var(--saffron); display: block; margin-top: 0.5rem; }

/* ---- AUTH ---- */
.auth-container { display: flex; justify-content: center; padding: 2rem; }
.auth-card {
    background: var(--white); border-radius: 16px; width: 100%; max-width: 480px;
    box-shadow: 0 8px 30px var(--shadow-lg); overflow: hidden;
}
.auth-header {
    background: linear-gradient(135deg, var(--maroon-deep), var(--maroon));
    padding: 2rem; text-align: center; color: white;
}
.auth-header h2 { color: var(--gold-light); font-size: 1.5rem; }
.auth-header p { color: var(--cream-dark); font-size: 0.9rem; margin-top: 0.25rem; }
.auth-body { padding: 2rem; }

/* ---- TOAST ---- */
.toast-container { position: fixed; top: 80px; right: 1rem; z-index: 9999; display: grid; gap: 0.5rem; }
.toast {
    padding: 0.75rem 1.5rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500;
    box-shadow: 0 4px 15px var(--shadow-lg); animation: slideIn 0.3s ease;
    background: var(--white); border-left: 4px solid var(--saffron);
}
.toast-success { border-left-color: var(--easy); }
.toast-error { border-left-color: var(--difficult); }

/* ---- FOOTER ---- */
.footer {
    background: linear-gradient(135deg, var(--brown-dark), var(--maroon-deep));
    padding: 2rem; text-align: center; color: var(--cream-dark);
}

/* ---- ADMIN LAYOUT ---- */
.admin-layout { display: flex; min-height: calc(100vh - var(--header-height)); }
.admin-sidebar {
    width: 240px; background: linear-gradient(180deg, var(--maroon-deep), var(--brown-dark));
    padding: 1rem 0; flex-shrink: 0;
}
.sidebar-menu { list-style: none; }
.sidebar-menu li a, .sidebar-menu li .active {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1.5rem; color: var(--cream-dark); font-size: 0.88rem;
    text-decoration: none; transition: var(--transition); border-left: 3px solid transparent;
}
.sidebar-menu li a:hover { background: rgba(255,255,255,0.08); color: var(--gold-light); }
.sidebar-menu li a.active, .sidebar-menu li .active {
    background: rgba(232,134,12,0.15); color: var(--gold-light);
    border-left-color: var(--saffron); font-weight: 600;
}
.menu-icon { font-size: 1.1rem; }
.admin-content { flex: 1; padding: 2rem; background: var(--bg-primary); overflow-y: auto; }
.admin-page-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem;
}
.admin-page-header h2 { font-size: 1.5rem; }

/* ---- STATS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stat-card {
    background: var(--white); padding: 1.25rem; border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow); display: flex; align-items: center; gap: 1rem;
}
.stat-card-icon {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.stat-card-icon.saffron { background: rgba(232,134,12,0.1); }
.stat-card-icon.maroon { background: rgba(123,24,24,0.1); }
.stat-card-icon.green { background: rgba(74,124,79,0.1); }
.stat-card-icon.gold { background: rgba(196,155,44,0.1); }
.stat-card-info h3 { font-size: 1.5rem; font-family: 'Poppins', sans-serif; }
.stat-card-info p { font-size: 0.8rem; color: var(--text-muted); }

/* ---- DATA TABLE ---- */
.data-table-container { background: var(--white); border-radius: 12px; box-shadow: 0 2px 12px var(--shadow); overflow: hidden; }
.data-table-header { padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; border-bottom: 1px solid var(--border); }
.filter-bar { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.search-box input { padding: 0.5rem 1rem; border: 2px solid var(--border); border-radius: 8px; font-size: 0.85rem; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    padding: 0.75rem 1rem; text-align: left; font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
    background: var(--bg-secondary); border-bottom: 2px solid var(--border);
}
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.data-table tr:hover { background: rgba(232,134,12,0.03); }
.question-preview { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 0.5rem; }
.badge-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; background: var(--saffron); color: white;
    border-radius: 50px; font-size: 0.7rem; font-weight: 700; padding: 0 6px;
}

/* ---- DIFFICULTY BADGES ---- */
.difficulty-badge {
    display: inline-block; padding: 0.2rem 0.75rem; border-radius: 50px;
    font-size: 0.75rem; font-weight: 600;
}
.difficulty-easy { background: rgba(74,124,79,0.1); color: var(--easy); }
.difficulty-medium { background: rgba(232,134,12,0.1); color: var(--medium); }
.difficulty-difficult { background: rgba(192,57,43,0.1); color: var(--difficult); }
.difficulty-very-difficult { background: rgba(123,24,24,0.1); color: var(--very-difficult); }

/* ---- MODAL ---- */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 2000; justify-content: center; align-items: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--white); border-radius: 16px; width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); max-height: 90vh; overflow-y: auto;
}
.modal-header {
    padding: 1.25rem 1.5rem; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; display: flex; justify-content: flex-end; gap: 0.75rem; border-top: 1px solid var(--border); }

/* ---- IMPORT ---- */
.import-template { background: var(--bg-secondary); border-radius: 8px; padding: 1rem; margin: 1rem 0; font-size: 0.8rem; }
.import-template code { display: block; background: var(--white); padding: 0.75rem; border-radius: 6px; overflow-x: auto; font-size: 0.78rem; margin-top: 0.5rem; }

/* ---- EXAM INTERFACE ---- */
.exam-layout { padding: 0; }
.exam-timer-bar {
    background: linear-gradient(135deg, var(--maroon-deep), var(--maroon));
    padding: 0.75rem 2rem; color: white; position: sticky; top: var(--header-height); z-index: 100;
}
.timer-info { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; }
.timer-danger { color: #ff4444; animation: pulse 1s infinite; }
.exam-content-grid { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; padding: 1.5rem 2rem; max-width: 1200px; margin: 0 auto; }
.exam-question-panel { min-width: 0; }
.exam-palette { position: sticky; top: calc(var(--header-height) + 55px); height: fit-content; }

.option-card {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.85rem 1.25rem; margin-bottom: 0.6rem;
    border: 2px solid var(--border); border-radius: 10px;
    cursor: pointer; transition: var(--transition);
}
.option-card:hover { border-color: var(--saffron); background: rgba(232,134,12,0.03); }
.option-card.selected { border-color: var(--saffron); background: rgba(232,134,12,0.1); }
.option-label {
    width: 32px; height: 32px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem;
    background: var(--bg-secondary); color: var(--text-secondary); flex-shrink: 0;
}
.option-card.selected .option-label { background: var(--saffron); color: white; }

.palette-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
.palette-btn {
    width: 40px; height: 40px; border-radius: 8px; border: 2px solid var(--border);
    background: var(--white); font-weight: 600; font-size: 0.8rem; cursor: pointer;
    transition: var(--transition);
}
.palette-btn.current { border-color: var(--saffron); background: var(--saffron); color: white; }
.palette-btn.answered { background: var(--easy); color: white; border-color: var(--easy); }
.palette-btn.flagged { position: relative; }
.palette-btn.flagged::after { content: '🚩'; position: absolute; top: -4px; right: -4px; font-size: 0.6rem; }

/* ---- ANIMATIONS ---- */
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .header { padding: 0 1rem; }
    .header-logo-img { max-width: 200px; height: 35px; }
    .admin-badge { display: none; }
    .hero h1 { font-size: 1.75rem; }
    .hindi-title { font-size: 1.75rem; }
    .info-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .admin-content { padding: 1rem; }
    .exam-content-grid { grid-template-columns: 1fr; }
    .exam-palette { position: static; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
