/* 
 * Attain Paper 2 Answer Coach 
 * Premium Mobile-First Styles 
 */

.paper-2-dashboard {
    font-family: 'Inter', 'Outfit', sans-serif;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 99999;
}

/* Progress Indicator */
.sticky-header {
    position: sticky;
    top: 10px;
    z-index: 100;
    margin-bottom: 25px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.p2-progress-micro-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 700;
    /* text-transform: uppercase; */
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    /* text-align: center; */
}

.p2-progress-steps-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.p2-step-compact {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.p2-step-compact.active {
    color: #8b5cf6;
    /* purple */
    font-weight: 700;
}

.p2-step-compact.completed {
    color: #10b981;
    /* green */
}

.p2-step-compact .icon {
    font-size: 14px;
}

.p2-step-compact.active .icon {
    font-size: 16px;
}

.p2-step-arrow {
    color: #cbd5e1;
    font-size: 10px;
}

/* Screens */
.p2-screen {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.p2-screen.active {
    display: block;
}

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

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

/* Hero Section */
.p2-hero {
    margin-bottom: 30px;
}

.p2-hero h2 {
    font-size: 32px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    margin-bottom: 10px;
    letter-spacing: -0.5px !important;
    color: #1e293b;
}

.p2-hero .p2-highlight {
    color: #10b981;
    /* Attain Green */
}

.p2-hero .p2-highlight-alt {
    color: #ec4899;
    /* Pink accent */
}

.p2-hero p {
    color: #64748b;
    font-size: 16px;
    margin-top: 5px;
}

/* Starter Card */
.p2-starter-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
    border: 1px solid #f1f5f9;
}

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

.p2-badge-flame {
    background: #fff7ed;
    color: #ea580c;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.p2-time {
    color: #94a3b8;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.p2-time .material-symbols-outlined {
    font-size: 16px;
}

.p2-starter-question {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 20px;
}

.p2-starter-meta {
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
    margin-bottom: 20px;
}

.p2-starter-meta p {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 10px;
}

.p2-starter-meta p strong {
    color: #4f46e5;
}

.p2-starter-meta ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 15px;
}

.p2-starter-meta li {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #64748b;
}

.p2-feedback-card .material-symbols-outlined {
    font-size: 1.2em;
    vertical-align: middle;
}

/* =========================================
   Interactive Question Highlights
   ========================================= */
.p2-highlight-word {
    background-color: #fef08a;
    /* yellow-200 */
    border-bottom: 2px dashed #fbbf24;
    /* amber-400 */
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    margin: 1px;
}

.p2-highlight-word:hover,
.p2-highlight-word.active {
    background-color: #fde047;
    /* yellow-300 */
    border-bottom-color: #f59e0b;
    /* amber-500 */
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

/* =========================================
   Bottom Sheet Components
   ========================================= */
.p2-bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.5);
    /* gray-900 */
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.p2-bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.p2-bottom-sheet-surface {
    background: #ffffff;
    width: 100%;
    max-height: 80vh;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.p2-bottom-sheet-overlay.active .p2-bottom-sheet-surface {
    transform: translateY(0);
}

.p2-sheet-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.p2-sheet-handle {
    width: 40px;
    height: 5px;
    background: #d1d5db;
    /* gray-300 */
    border-radius: 3px;
    margin-bottom: 15px;
}

.p2-sheet-close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.p2-sheet-close-btn:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.p2-sheet-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.p2-explanation-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.p2-explanation-phrase {
    font-size: 1.1em;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
    display: inline-block;
    background: #fef08a;
    padding: 4px 8px;
    border-radius: 6px;
    border-bottom: 2px dashed #fbbf24;
}

/* =========================================
   Deep Dive Tray Styles
   ========================================= */
.attain-highlight {
    background: #fff3a3;
    color: #2d2600;
    border-radius: 6px;
    padding: 1px 4px;
    cursor: pointer;
    box-shadow: inset 0 -2px 0 rgba(255, 204, 0, 0.45);
    transition: all 0.2s ease;
    display: inline;
}

.attain-highlight.active,
.attain-highlight:hover {
    background: #fde047;
    box-shadow: inset 0 -3px 0 rgba(245, 158, 11, 0.6);
}

.deep-dive-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin: 10px 0;
    text-align: center;
}

.deep-dive-section {
    margin-bottom: 24px;
}

.deep-dive-simple {
    font-size: 1.1rem;
    color: #334155;
    line-height: 1.6;
    margin: 0;
}

.deep-dive-section h4 {
    font-size: 1.1rem;
    color: #0f172a;
    margin-bottom: 12px;
    font-weight: 700;
}

.deep-dive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.deep-dive-list li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 10px;
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.5;
}

.deep-dive-list .material-symbols-outlined {
    color: #8b5cf6;
    font-size: 1.1rem;
    margin-top: 3px;
}

.deep-dive-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

.deep-dive-card strong {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.deep-dive-card p {
    margin: 0;
    color: #334155;
    font-size: 1rem;
    line-height: 1.5;
}

/* Card Variations */
.deep-dive-card.exam-value {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.deep-dive-card.exam-value strong {
    color: #1d4ed8;
}

.deep-dive-card.starter {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.deep-dive-card.starter strong {
    color: #15803d;
}

.deep-dive-card.starter p {
    font-style: italic;
    font-weight: 600;
    color: #166534;
}

.deep-dive-card.mistake {
    background: #fff1f2;
    border-color: #fecdd3;
}

.deep-dive-card.mistake strong {
    color: #e11d48;
}

.deep-dive-card.mistake p {
    color: #be123c;
}

.deep-dive-card.sample {
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.deep-dive-card.sample strong {
    color: #6d28d9;
}

.deep-dive-card.sample p {
    color: #5b21b6;
}

.deep-dive-section.try-it {
    background: #fffbeb;
    border: 1px dashed #fcd34d;
    padding: 16px;
    border-radius: 12px;
}

.deep-dive-section.try-it h4 {
    color: #b45309;
    margin-top: 0;
}

.deep-dive-section.try-it p {
    color: #92400e;
    margin: 0;
    font-weight: 500;
}

.p2-explanation-text {
    font-size: 1.05em;
    color: #4b5563;
    line-height: 1.6;
}

.p2-btn-starter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #10b981, #059669) !important;
    /* Attain green button */
}

.p2-btn-starter .arrow {
    transition: transform 0.2s ease;
}

.p2-btn-starter:hover .arrow {
    transform: translateX(4px);
}

.p2-starter-stats {
    display: flex;
    gap: 15px;
}

.stat-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

.stat-icon {
    font-size: 28px;
}

.stat-icon.green {
    color: #10b981;
}

.stat-icon.purple {
    color: #8b5cf6;
}

.stat-text {
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
}

.stat-text strong {
    color: #1e293b;
    font-size: 13px;
}

/* Divider */
.p2-divider {
    text-align: center;
    position: relative;
    margin-bottom: 25px;
}

.p2-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
}

.p2-divider span {
    background: #fff;
    padding: 0 15px;
    color: #94a3b8;
    font-size: 14px;
    position: relative;
    z-index: 2;
}

/* Upload Own Question */
.p2-upload-own {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    background: #fafaf9;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.p2-upload-own:hover {
    border-color: #10b981;
    background: #ecfdf5;
}

.upload-own-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.upload-icon-small {
    color: #10b981;
    font-size: 32px;
}

.upload-text {
    flex-grow: 1;
}

.upload-text strong {
    display: block;
    color: #1e293b;
    font-size: 16px;
    margin-bottom: 2px;
}

.upload-text p {
    color: #64748b;
    font-size: 13px;
    margin: 0;
}

.upload-arrow {
    color: #94a3b8;
}

/* Manual Accordion */
.p2-manual-accordion {
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    background: #fff;
}

.accordion-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
}

.accordion-header-left strong {
    font-size: 15px;
}

.accordion-header .expand-icon {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.accordion-body {
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.p2-footer-note {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.p2-footer-note .lock-icon {
    font-size: 14px;
}

#p2-manual-question {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 15px;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

#p2-manual-question:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Question Breakdown */
.p2-question-card {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    border-left: 4px solid #4f46e5;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.p2-question-card.refined {
    border-left: none;
    border-top: 4px solid #8b5cf6;
}

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

.p2-q-label {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.p2-q-tag {
    font-size: 12px;
    font-weight: 600;
    color: #8b5cf6;
    background: #f5f3ff;
    padding: 4px 10px;
    border-radius: 20px;
}

.p2-q-confidence {
    margin-top: 15px;
    font-size: 13px;
    color: #ea580c;
    font-weight: 500;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
}

.p2-question-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    color: #1e293b;
}

.breakdown-hint {
    background: #fff;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.breakdown-hint h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #4f46e5;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 18px !important;
}

.breakdown-hint h4 .material-symbols-outlined {
    font-size: 20px;
}

.breakdown-hint.warning h4 {
    color: #ea580c;
}

.p2-command-words,
.p2-mistakes {
    margin: 0;
    padding-left: 0;
    color: #475569;
}

.p2-command-words li,
.p2-mistakes li {
    margin-bottom: 5px;
}

/* Answer Screen */
.p2-answer-context {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #334155;
    border-left: 3px solid #94a3b8;
}

.p2-textarea-wrapper {
    position: relative;
    margin-bottom: 20px;
}

#p2-student-answer {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 20px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

#p2-student-answer:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02), 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.p2-word-count {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 12px;
    color: #94a3b8;
    background: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    pointer-events: none;
}

/* Feedback Screen */
.p2-feedback-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.p2-score-circle {
    width: 80px;
    height: 80px;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: #eee;
    stroke-width: 3.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out, stroke 0.5s ease;
}

.percentage {
    fill: #333;
    font-family: inherit;
    font-size: 8px;
    font-weight: bold;
    text-anchor: middle;
}

.p2-feedback-summary h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.p2-feedback-summary p {
    color: #64748b;
    font-size: 14px;
}

.p2-feedback-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.p2-feedback-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.p2-feedback-card.success h4 {
    color: #10b981;
}

.p2-feedback-card.warning h4 {
    color: #f59e0b;
}

.p2-feedback-card ul {
    margin: 0;
    padding-left: 20px;
    color: #475569;
    line-height: 1.6;
}

.p2-feedback-card ul li {
    margin-bottom: 8px;
}

/* Model Answer Toggle */
.model-answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.model-answer-header h4 {
    color: #4f46e5;
    margin-bottom: 0;
}

.model-answer-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
    color: #334155;
    line-height: 1.7;
}

/* Leaderboard */
.p2-leaderboard-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.p2-my-rank {
    background: #f8fafc;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    border-left: 3px solid #4f46e5;
}

.p2-lb-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.p2-lb-list li {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.p2-lb-list li:last-child {
    border-bottom: none;
}

.p2-lb-list li.is-me {
    font-weight: 700;
    color: #4f46e5;
}

.lb-rank {
    width: 40px;
    font-weight: 600;
    color: #94a3b8;
}

.is-me .lb-rank {
    color: #4f46e5;
}

.lb-name {
    flex-grow: 1;
}

.lb-score {
    font-weight: 600;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
}

/* Buttons */
.attain-btn.p2-full-width {
    width: 100%;
    display: block;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    text-align: center;
}

button.attain-btn.ghost.p2-btn-back {
    border: none !important;
    background: none !important;
}

/* Loading Overlay */
.p2-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.p2-loader-content {
    text-align: center;
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 350px;
}

.p2-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.p2-loader-content h3 {
    margin-bottom: 10px;
    font-size: 20px;
    color: #1e293b;
}

.p2-loader-content p {
    color: #64748b;
    font-size: 14px;
}

/* =========================================
   Step 3: Answer Screen Enhancements
   ========================================= */

.starter-pill {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.starter-pill:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
    transform: translateY(-1px);
}

.starter-pill .material-symbols-outlined {
    font-size: 14px;
}

.p2-mode-toggle {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.p2-mode-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.p2-mode-btn.active {
    background: white;
    color: #4f46e5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.p2-outline-bullet-row {
    display: flex;
    align-items: flex-start;
}

.p2-outline-input::placeholder {
    color: #94a3b8;
}