/* Attain Crash Course - Premium Rescue Engine Styles (CAPE Level) */

:root {
    --attain-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --attain-glass: rgba(255, 255, 255, 0.75);
    --attain-glass-border: rgba(255, 255, 255, 0.5);
    --attain-glass-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);

    --priority-High: #ef4444;
    --priority-High-bg: #fee2e2;
    --priority-Medium: #f59e0b;
    --priority-Medium-bg: #fef3c7;
    --priority-Low: #10b981;
    --priority-Low-bg: #d1fae5;
}

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

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

.animate-in {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.animate-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.glass-panel {
    background: var(--attain-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--attain-glass-border);
    border-radius: 24px;
    box-shadow: var(--attain-glass-shadow);
    padding: 24px;
}

/* SMART PLAN SCREEN */
.smart-plan-screen {
    text-align: center;
    max-width: 500px;
    margin: 40px auto;
}

.screen-header h1 {
    font-size: 2.4em;
    font-weight: 900;
    line-height: 1.1;
    margin: 15px 0;
    background: var(--attain-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    background: #f3f4f6;
    border-radius: 100px;
    font-size: 0.8em;
    font-weight: 700;
    color: #4b5563;
}

.plan-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 30px 0;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-card .val {
    font-size: 2em;
    font-weight: 800;
    color: #1f2937;
}

.stat-card .lab {
    font-size: 0.75em;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 700;
}

.plan-summary-box {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.plan-summary-box ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0;
}

.plan-summary-box li {
    padding: 8px 0;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-summary-box li::before {
    content: "✔";
    color: #6366f1;
    font-weight: 900;
}

/* TIMETABLE SCREEN */
.day-cards-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

.day-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.day-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

.day-card.active {
    border-color: #6366f1;
    background: #fff;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.day-meta .day-label {
    font-size: 1.25em;
    font-weight: 800;
}

.day-progress-pill {
    padding: 4px 12px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 100px;
    font-size: 0.8em;
    font-weight: 700;
}

.day-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.day-stats .stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: #666;
    font-weight: 600;
}

.rebuild-plan-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding: 20px;
    background: #111827;
    color: #fff;
    border-radius: 20px;
}

.rebuild-plan-cta h4 {
    margin: 0 0 5px;
    color: #fff;
}

.rebuild-plan-cta p {
    margin: 0;
    font-size: 0.85em;
    opacity: 0.8;
}

/* TOPIC STUDY SCREEN */
.study-content-header {
    margin-bottom: 30px;
}

.study-content-header h1 {
    font-size: 2.2em;
    font-weight: 900;
    margin-bottom: 15px;
}

.topic-meta-badges {
    display: flex;
    gap: 10px;
}

.topic-meta-badges .badge {
    padding: 6px 16px;
    border-radius: 8px;
}

.badge.priority-High {
    background: var(--priority-High-bg);
    color: var(--priority-High);
}

.badge.priority-Medium {
    background: var(--priority-Medium-bg);
    color: var(--priority-Medium);
}

.badge.priority-Low {
    background: var(--priority-Low-bg);
    color: var(--priority-Low);
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.point-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: relative;
    border-radius: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.point-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.point-card.is-done {
    opacity: 0.8;
    background: rgba(240, 253, 244, 0.4);
}

.point-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.point-no {
    font-size: 0.75em;
    font-weight: 800;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.done-icon {
    color: #10b981;
}

.point-title {
    font-size: 1.25em;
    font-weight: 800;
    margin-bottom: 10px;
    color: #111827;
}

.point-summary {
    font-size: 0.9em;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 20px;
}

.point-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.est-min {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8em;
    font-weight: 700;
    color: #6b7280;
}

.est-min .material-symbols-outlined {
    font-size: 1.4em;
}

/* ACADEMIC STUDY MODE (Bottom Sheet) */
.academic-mode {
    padding-bottom: 100px;
}

.study-section {
    margin-bottom: 40px;
}

.section-label {
    display: block;
    font-size: 0.75em;
    font-weight: 800;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.lead {
    font-size: 1.25em;
    font-weight: 500;
    line-height: 1.5;
    color: #374151;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
    font-weight: 800;
    margin-bottom: 20px;
    color: #111827;
}

.table-intro-text {
    font-size: 0.95em;
    line-height: 1.6;
    color: #6b7280;
    margin-bottom: 20px;
    font-style: italic;
}

.definitions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}

.def-item {
    padding: 15px;
}

.def-item strong {
    display: block;
    margin-bottom: 5px;
    color: #6366f1;
}

.def-item p {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
    color: #4b5563;
}

.table-container {
    overflow-x: auto;
    padding: 0;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container th {
    text-align: left;
    padding: 15px;
    background: rgba(99, 102, 241, 0.05);
    font-weight: 800;
    color: #4338ca;
}

.table-container td {
    padding: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.95em;
}

.examples-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.example-box h5 {
    margin: 0 0 10px;
    color: #111827;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    color: #4b5563;
}

.wysiwyg-content {
    padding: 25px;
    line-height: 1.7;
    color: #374151;
}

.wysiwyg-content h3 {
    margin-top: 0;
}

.insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.insight-card {
    padding: 25px;
    border-radius: 20px;
}

.insight-card.mistake {
    background: #fff1f2;
    border: 1px solid #fecaca;
}

.insight-card.tip {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.insight-card h5 {
    margin: 0 0 15px;
    text-transform: uppercase;
    font-size: 0.8em;
    font-weight: 900;
    letter-spacing: 1px;
}

.insight-card.mistake h5 {
    color: #be123c;
}

.insight-card.tip h5 {
    color: #1d4ed8;
}

.insight-card ul {
    padding-left: 18px;
    margin: 0;
}

.insight-card li {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.recall-box {
    background: #111827 !important;
    color: #fff;
    border: none;
}

.recall-box h4 {
    color: #fff;
    margin-top: 0;
}

.recall-box li {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
}

/* MCQ QUICK TEST */
.mcq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mcq-item .question {
    font-weight: 700;
    margin-bottom: 15px;
    color: #111827;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.option-btn {
    text-align: left;
    padding: 12px 18px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-wrap: auto;
}

.option-btn:hover {
    border-color: #6366f1;
    background: #f5f3ff;
}

.option-btn.selected {
    border-color: #6366f1;
    background: #f5f3ff;
}

.option-btn.correct {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.option-btn.incorrect {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.feedback-area {
    margin-top: 12px;
    font-size: 0.85em;
    font-weight: 800;
}

.txt-success {
    color: #10b981;
}

.txt-error {
    color: #ef4444;
}

/* UTILITY */
.attain-btn {
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f3f4f6;
    color: #111827;
}

.attain-btn.primary-gradient {
    background: var(--attain-gradient);
    color: #fff;
}

.attain-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.attain-btn.large {
    padding: 18px 32px;
    font-size: 1.1em;
    border-radius: 16px;
}

.full-width {
    width: 100%;
}

.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    align-items: flex-end;
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet-overlay.active {
    visibility: visible;
    opacity: 1;
}

.bottom-sheet-surface {
    width: 100%;
    background: #fff;
    border-radius: 32px 32px 0 0;
    padding: 40px 30px;
    max-height: 95%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.sheet-footer {
    margin-top: auto;
    padding-top: 20px;
    padding-bottom: 20px;
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 10;
    border-top: 1px solid #f3f4f6;
}

@media (max-width: 768px) {
    .insights-grid {
        grid-template-columns: 1fr;
    }

    .points-grid {
        grid-template-columns: 1fr;
    }
}

/* WIZARD & FORMS */
.step-screen {
    width: 100%;
}
.paper-2-card {
    background: rgba(99, 102, 241, 0.05);
    border-left: 4px solid #6366f1;
    margin-bottom: 20px;
}
.encouragement {
    font-size: 0.9em;
    color: #6366f1;
    font-weight: 700;
    margin-top: 10px;
}
.attain-textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    background: #f9fafb;
}
.attain-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #fff;
}
.wizard-nav {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
}
#wizard-next-btn {
    margin-left: auto;
}
.dictation-active {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.feedback-box {
    padding: 20px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.feedback-box h4 {
    margin-top: 0;
    color: #0f172a;
}
.score-badge {
    display: inline-block;
    padding: 8px 16px;
    background: #10b981;
    color: white;
    border-radius: 100px;
    font-weight: 800;
    font-size: 1.2em;
    margin-bottom: 15px;
}
.image-preview-item {
    display: inline-block;
    position: relative;
    margin-right: 10px;
}
.image-preview-item img {
    height: 80px;
    border-radius: 8px;
    border: 1px solid #ccc;
}
.image-preview-item .remove-img {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Question Breakdown Interactive UI */
.qb-question-text {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 24px;
    color: #1f2937;
}

.qb-highlight {
    background-color: #fef3c7;
    border-bottom: 2px dashed #f59e0b;
    border-radius: 4px;
    padding: 0 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qb-highlight:hover {
    background-color: #fde68a;
}

.qb-highlight.active {
    background-color: #f59e0b;
    color: #fff;
    border-bottom: 2px solid #b45309;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.qb-cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.qb-card {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    opacity: 0.6;
    transform: scale(0.98);
    transition: all 0.3s ease;
}

.qb-card.active {
    opacity: 1;
    transform: scale(1);
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.qb-card-title {
    font-weight: 700;
    font-size: 1em;
    color: #4f46e5;
    margin-bottom: 8px;
}

.qb-card-body {
    font-size: 0.95em;
    color: #4b5563;
    margin-bottom: 8px;
}

.qb-card-bullets {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9em;
    color: #374151;
}

.qb-card-bullets li {
    margin-bottom: 4px;
}

.qb-success-message {
    display: none;
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    margin-top: 16px;
    animation: fadeIn 0.5s ease;
}

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

.guided-outline-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.guided-field label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 5px;
}

.guided-field textarea {
    width: 100%;
    margin: 0;
    transition: all 0.2s ease-in-out;
}

.outline-error-highlight {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.2) !important;
}

.flex-gap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.secondary-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.secondary-btn:hover {
    background: #e5e7eb;
}