/* mains_tester.css - Apple-Inspired Mains Q&A Practice Lab */
:root {
    --desk-bg: #f3f4f6;
    --desk-grid: rgba(209, 213, 219, 0.6);
    --paper-bg: #fffdf8;
    --margin-line: rgba(239, 68, 68, 0.4);
    --note-line: rgba(59, 130, 246, 0.08);

    --page-bg: #f4f4f7;
    --ink-black: #1d1d1f;
    --text-secondary: #6e6e73;
    --ink-blue: #0066cc;
    --ink-blue-hover: #004499;
    --accent-gold: #d97706;
    --accent-gold-bg: #fef3c7;
    --card-bg: #f8fafc;
    --border-color: #e2e8f0;
    --badge-bg: #e0e7ff;
    --badge-text: #3730a3;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --radius-md: 12px;
    --radius-lg: 18px;
    --font-heading: 'Kalam', 'Patrick Hand', cursive, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--desk-bg);
    background-image: radial-gradient(var(--desk-grid) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    color: var(--ink-black);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0 1px;
}

.mains-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.notebook-container {
    width: 100%;
    max-width: 100%;
}

.paper-page {
    position: relative;
    background-color: var(--paper-bg);
    background-image:
        linear-gradient(90deg, transparent 66px, var(--margin-line) 66px, var(--margin-line) 68px, transparent 68px),
        linear-gradient(var(--note-line) 96%, transparent 96%);
    background-size: 100% 100%, 100% 32px;
    background-position: 0 0, 0 12px;
    border-radius: var(--radius-lg);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 36px 40px 36px 90px;
    min-height: 100vh;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

/* Spiral Binding Binder Holes */
.paper-page::before {
    content: '';
    position: absolute;
    top: 40px;
    bottom: 40px;
    left: 20px;
    width: 14px;
    background-image: radial-gradient(circle, #374151 55%, transparent 63%);
    background-size: 14px 32px;
    background-repeat: repeat-y;
    background-position: 0 12px;
    opacity: 0.8;
    mix-blend-mode: multiply;
    z-index: 10;
}

/* Metal Spiral Rings */
.paper-page::after {
    content: '';
    position: absolute;
    top: 36px;
    bottom: 44px;
    left: 6px;
    width: 32px;
    background-image: linear-gradient(180deg,
        transparent 0px,
        transparent 4px,
        #9ca3af 4px,
        #e5e7eb 8px,
        #ffffff 10px,
        #d1d5db 12px,
        #4b5563 16px,
        transparent 16px,
        transparent 32px);
    background-size: 32px 32px;
    background-repeat: repeat-y;
    background-position: 0 12px;
    z-index: 11;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.18));
}

/* Header Navbar */
.mains-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--ink-blue);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    background: rgba(0, 102, 204, 0.08);
    transition: all 0.2s ease;
}

.back-link-btn:hover {
    background: rgba(0, 102, 204, 0.16);
    color: var(--ink-blue-hover);
}

.mains-title {
    font-family: var(--font-heading);
    font-size: 32px;
    color: var(--ink-black);
    margin-bottom: 4px;
}

.mains-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Views Switcher */
.view-panel {
    display: none;
}

.view-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Subject Grid View */
.subject-grid-title {
    margin-bottom: 20px;
}

.subject-grid-title h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--ink-black);
}

.subject-grid-title p {
    color: var(--text-secondary);
    font-size: 14px;
}

.mains-subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.mains-subject-card {
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 170px;
    box-shadow: var(--shadow-sm);
}

.mains-subject-card.active-card {
    border: 2px solid var(--ink-blue);
    background: rgba(239, 246, 255, 0.5);
}

.mains-subject-card.active-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 102, 204, 0.15);
    background: rgba(239, 246, 255, 0.8);
}

.mains-subject-card.disabled-card {
    opacity: 0.75;
    background: #f8fafc;
    cursor: not-allowed;
}

.card-subject-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-subject-icon {
    font-size: 32px;
}

.badge-coming-soon {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    background: #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
}

.badge-active-subject {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0066cc;
    background: #dbeafe;
    padding: 3px 8px;
    border-radius: 4px;
}

.card-subject-title {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--ink-black);
    margin-bottom: 6px;
}

.card-subject-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Sub-nav Bar inside Questions View */
.sub-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sub-back-btn {
    background: #e2e8f0;
    color: #334155;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: background 0.2s;
}

.sub-back-btn:hover {
    background: #cbd5e1;
}

.active-subject-badge {
    font-weight: 700;
    font-size: 14px;
    color: var(--ink-blue);
    background: #dbeafe;
    padding: 6px 14px;
    border-radius: 8px;
}

/* Controls & Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
    align-items: center;
    background: rgba(241, 245, 249, 0.8);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 240px;
}

.filter-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.select-input, .search-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    background: #ffffff;
    color: var(--ink-black);
    outline: none;
    transition: border-color 0.2s;
}

.select-input:focus, .search-input:focus {
    border-color: var(--ink-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* Mains Q&A Cards List */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mains-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mains-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.card-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.topic-tag {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-blue);
    background: rgba(0, 102, 204, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

.badge-row {
    display: flex;
    gap: 8px;
}

.badge-marks {
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    padding: 4px 10px;
    border-radius: 6px;
}

.badge-words {
    font-size: 12px;
    font-weight: 600;
    color: #065f46;
    background: #d1fae5;
    padding: 4px 10px;
    border-radius: 6px;
}

.mains-question-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink-black);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Accordion Trigger */
.answer-toggle-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink-blue);
    cursor: pointer;
    transition: background 0.2s ease;
}

.answer-toggle-btn:hover {
    background: #f1f5f9;
}

.toggle-arrow {
    transition: transform 0.3s ease;
}

.mains-card.open .toggle-arrow {
    transform: rotate(180deg);
}

/* Model Answer Drawer */
.answer-drawer {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

.mains-card.open .answer-drawer {
    display: block;
}

.answer-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ans-intro-block {
    background: #eff6ff;
    border-left: 4px solid var(--ink-blue);
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    font-size: 14.5px;
    color: #1e3a8a;
    line-height: 1.6;
}

.ans-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink-black);
    margin-top: 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}

.ans-points-list {
    list-style-type: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ans-point-item {
    font-size: 14px;
    color: #334155;
    position: relative;
    padding-left: 20px;
    line-height: 1.55;
}

.ans-point-item::before {
    content: "•";
    position: absolute;
    left: 4px;
    color: var(--ink-blue);
    font-size: 18px;
    line-height: 1;
}

.ans-conclusion-block {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    font-size: 14.5px;
    color: #14532d;
    line-height: 1.6;
}

/* Natural Handwritten Paper Sheet */
.handwritten-paper-sheet {
    background-color: #fffdf7;
    border: 1px solid #f1f5f9;
    border-left: 3px solid #ef4444;
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.handwritten-p {
    font-family: 'Patrick Hand', cursive;
    font-size: 19px;
    line-height: 1.6;
    color: #1e293b;
    margin-bottom: 12px;
}

.handwritten-subheading {
    font-family: 'Kalam', cursive;
    font-size: 19.5px;
    font-weight: 700;
    color: #1e3a8a;
    margin-top: 14px;
    margin-bottom: 8px;
}

.handwritten-list {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 14px;
}

.handwritten-list li {
    font-family: 'Patrick Hand', cursive;
    font-size: 18.5px;
    line-height: 1.55;
    color: #334155;
    position: relative;
    padding-left: 24px;
    margin-bottom: 6px;
}

.handwritten-list li::before {
    content: "✍️";
    position: absolute;
    left: 0;
    font-size: 13px;
    top: 2px;
}

/* Realistic Highlighter Colors */
.hl-yellow {
    background: linear-gradient(100deg, rgba(254, 240, 138, 0.7) 0%, rgba(253, 224, 71, 0.9) 70%, rgba(254, 240, 138, 0.4) 100%);
    padding: 2px 6px;
    border-radius: 4px;
    color: #0f172a;
}

.hl-pink {
    background: linear-gradient(100deg, rgba(251, 207, 232, 0.7) 0%, rgba(244, 114, 182, 0.8) 70%, rgba(251, 207, 232, 0.4) 100%);
    padding: 2px 6px;
    border-radius: 4px;
    color: #831843;
}

.hl-blue {
    background: linear-gradient(100deg, rgba(191, 219, 254, 0.7) 0%, rgba(96, 165, 250, 0.8) 70%, rgba(191, 219, 254, 0.4) 100%);
    padding: 2px 6px;
    border-radius: 4px;
    color: #1e3a8a;
}

.hl-green {
    background: linear-gradient(100deg, rgba(187, 247, 208, 0.7) 0%, rgba(74, 222, 128, 0.8) 70%, rgba(187, 247, 208, 0.4) 100%);
    padding: 2px 6px;
    border-radius: 4px;
    color: #064e3b;
}

/* Empty State */
.no-results {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-secondary);
    font-style: italic;
}

@media (max-width: 600px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
    }
    .notebook-container {
        padding: 0 !important;
    }
    .paper-page {
        padding: 24px 10px;
        background-image: linear-gradient(var(--note-line) 96%, transparent 96%);
        background-size: 100% 32px;
        background-position: 0 12px;
        border-radius: 0 !important;
        border: none !important;
    }
    .paper-page::before,
    .paper-page::after {
        display: none !important;
    }
    .filter-bar {
        flex-direction: column;
    }
    .mains-title {
        font-size: 24px;
    }
}
