/**
 * Study Plan Assessment Styles
 * Mobile-first, high-contrast, large touch targets for aphasia accessibility
 * 
 * File: assets/css/study-plan.css
 */

/* ============================================
   BASE STYLES & LAYOUT
   ============================================ */

.study-plan-root {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ============================================
   DISCLAIMER SCREEN - UPDATED
   ============================================ */

.assessment-disclaimer {
    text-align: center;
    padding: 40px 20px;
}

.warning-box {
    background: #FFF9E6;
    border: 3px solid #F1C40F;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.warning-header {
    text-align: center;
    margin-bottom: 24px;
}

.warning-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #F1C40F;
    border-radius: 50%;
    margin-bottom: 12px;
    font-size: 28px;
}

.warning-box h2 {
    color: #D35400;
    font-size: 24px;
    margin: 0;
    font-weight: 700;
}

/* IS / IS NOT Cards */
.disclaimer-points {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.disclaimer-point {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: left;
}

.point-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    margin-top: 2px;
}

.point-icon.positive {
    background: #d4edda;
    color: #28a745;
}

.point-icon.negative {
    background: #f8d7da;
    color: #dc3545;
}

.disclaimer-point p {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
    line-height: 1.5;
}

.disclaimer-point strong {
    font-weight: 600;
}

/* Checkbox - Inside Card */
.disclaimer-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #2c3e50;
    cursor: pointer;
    background: white;
    border: 2px solid #e8d5a3;
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.2s ease;
}

.disclaimer-checkbox:hover {
    border-color: #F1C40F;
}

.disclaimer-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #D35400;
}

/* ============================================
   INSTRUCTIONS SCREEN
   ============================================ */

.assessment-instructions {
    padding: 20px;
}

.assessment-instructions h2 {
    text-align: center;
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 40px;
}

.instructions-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.instruction-section {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.instruction-section:hover {
    border-color: #3498DB;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.section-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.instruction-section h3 {
    font-size: 22px;
    color: #2c3e50;
    margin: 0 0 12px 0;
}

.instruction-section p {
    font-size: 16px;
    color: #7f8c8d;
    line-height: 1.6;
    margin: 0;
}

.time-estimate {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #EBF5FB;
    border-radius: 8px;
}

.time-estimate p {
    font-size: 18px;
    color: #2c3e50;
    margin: 8px 0;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-container {
    margin-bottom: 30px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.progress-labels span {
    font-size: 14px;
    color: #95a5a6;
    font-weight: 600;
}

.progress-labels span.completed {
    color: #2ECC71;
}

.progress-labels span.active {
    color: #3498DB;
    font-weight: 700;
}

.progress-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498DB 0%, #2ECC71 100%);
    transition: width 0.5s ease;
    border-radius: 6px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 600;
}

/* ============================================
   SECTION TITLE
   ============================================ */

.section-title {
    text-align: center;
    margin-bottom: 30px;
}

.section-title h2 {
    font-size: 28px;
    color: #2c3e50;
    margin: 0;
}

/* ============================================
   QUESTION CARD
   ============================================ */

.question-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.question-image {
    text-align: center;
    margin-bottom: 30px;
}

.question-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.question-prompt {
    font-size: 22px;
    color: #2c3e50;
    text-align: center;
    margin: 0 0 30px 0;
    font-weight: 600;
    line-height: 1.5;
}

.target-word {
    font-size: 28px;
    color: #3498DB;
    text-align: center;
    font-weight: 700;
    margin: 20px 0;
    padding: 20px;
    background: #EBF5FB;
    border-radius: 8px;
}

/* ============================================
   SPEAKING QUESTION
   ============================================ */

.recording-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.btn-record {
    background: #2ECC71;
    color: white;
    border: none;
    font-size: 20px;
    padding: 20px 40px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-record:hover {
    background: #27AE60 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.btn-record:active {
    background: #3498DB !important;
    color: white !important;
    transform: translateY(0);
}

.recording-indicator {
    text-align: center;
    padding: 30px;
}

.recording-pulse {
    width: 80px;
    height: 80px;
    background: #E74C3C;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.recording-indicator p {
    font-size: 20px;
    color: #E74C3C;
    font-weight: 700;
    margin: 20px 0;
}

.transcription-result {
    width: 100%;
    text-align: center;
}

.transcription-result > p:first-child {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0 0 12px 0;
}

.transcribed-text {
    font-size: 24px;
    color: #2c3e50;
    font-weight: 600;
    padding: 20px;
    background: #F8F9FA;
    border-radius: 8px;
    margin: 0 0 20px 0;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   WRITING QUESTION
   ============================================ */

.typing-input {
    width: 100%;
    font-size: 24px;
    padding: 20px;
    border: 3px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.typing-input:focus {
    outline: none;
    border-color: #3498DB;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.typing-input::placeholder {
    color: #bdc3c7;
}

.question-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

/* ============================================
   MATCHING QUESTION
   ============================================ */

.btn-play-audio {
    background: #9B59B6;
    color: white;
    margin: 0 auto 30px;
    display: block;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-play-audio:hover {
    background: #8E44AD !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.4);
}

.matching-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.option-card {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-card:hover {
    border-color: #3498DB;
    background-color: white !important;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.3);
}

.option-card:active {
    border-color: #2ECC71;
    background-color: #E8F8F5 !important;
    transform: translateY(-2px);
}

.option-card img {
    max-width: 100%;
    max-height: 140px;
    border-radius: 8px;
}

/* ============================================
   BUTTONS - COMPREHENSIVE STYLING
   ============================================ */

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Prevent any element inside buttons from capturing clicks */
button * {
    pointer-events: none;
}

/* Primary buttons - Main action buttons */
.btn-primary {
    background: #2ECC71;
    color: white;
    padding: 16px 32px;
    font-size: 18px;
    min-height: 56px;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: #27AE60 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.btn-primary:active:not(:disabled) {
    background: #3498DB !important;
    color: white !important;
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #bdc3c7;
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Secondary buttons - Alternative actions */
.btn-secondary {
    background: #3498DB;
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 18px;
    min-height: 56px;
}

.btn-secondary:hover {
    background: #2980B9 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn-secondary:active {
    background: #2ECC71 !important;
    color: white !important;
    transform: translateY(0);
}

/* Large buttons */
.btn-large {
    padding: 20px 40px;
    font-size: 20px;
    min-height: 64px;
    min-width: 200px;
}

/* Skip button - subtle, centered */
.btn-skip {
    background: transparent;
    color: #7f8c8d;
    border: 2px solid #bdc3c7;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 6px;
    display: block;
    margin: 20px auto 0;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-skip:hover {
    background: #ecf0f1 !important;
    color: #34495e !important;
    border-color: #95a5a6;
    transform: translateY(-2px);
}

.btn-skip:active {
    background: #dfe4e8 !important;
    color: #2c3e50 !important;
}

/* Back button */
.btn-back {
    background: transparent;
    color: #3498DB;
    border: 2px solid #3498DB;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #3498DB !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-back:active {
    background: #2980B9 !important;
    color: white !important;
    transform: translateY(0);
}

/* Navigation buttons container */
.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Remove focus outline artifacts */
button:focus {
    outline: none;
}

/* But keep accessibility focus for keyboard users */
button:focus-visible {
    outline: 3px solid #3498DB;
    outline-offset: 2px;
}

/* ============================================
   RESULTS SCREEN
   ============================================ */

.assessment-results {
    padding: 20px;
}

.results-title {
    font-size: 36px;
    color: #2ECC71;
    text-align: center;
    margin-bottom: 40px;
}

.results-scores {
    margin-bottom: 40px;
}

.results-scores h3 {
    font-size: 24px;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 24px;
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.score-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.score-card h4 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0 0 12px 0;
}

.score-dots {
    font-size: 32px;
    color: #3498DB;
    margin: 12px 0;
    letter-spacing: 4px;
}

.score-card p {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
}

.results-recommendations {
    background: #F8F9FA;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.results-recommendations h3 {
    font-size: 24px;
    color: #2c3e50;
    margin: 0 0 12px 0;
}

.results-recommendations > p {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 24px;
}

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

.recommendation-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
}

.recommendation-card h4 {
    font-size: 20px;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.recommendation-card p {
    font-size: 16px;
    color: #7f8c8d;
    margin: 8px 0;
}

.recommendation-reason {
    font-style: italic;
    color: #95a5a6 !important;
}

.recommendation-card button {
    margin-top: 16px;
    background: #2ECC71;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recommendation-card button:hover {
    background: #27AE60 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

/* ============================================
   PROCESSING SCREEN
   ============================================ */

.assessment-processing {
    text-align: center;
    padding: 80px 20px;
}

.processing-spinner {
    width: 64px;
    height: 64px;
    border: 6px solid #e0e0e0;
    border-top-color: #3498DB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.assessment-processing h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 12px;
}

.assessment-processing p {
    font-size: 18px;
    color: #7f8c8d;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (min-width: 768px) {
    .instructions-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .scores-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .recommendations-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 767px) {
    .study-plan-root {
        padding: 12px;
    }
    
    .warning-box {
        padding: 20px;
    }
    
    .warning-icon {
        font-size: 48px;
    }
    
    .warning-box h2 {
        font-size: 22px;
    }
    
    .disclaimer-text {
        font-size: 16px;
    }
    
    .assessment-instructions h2 {
        font-size: 24px;
    }
    
    .section-icon {
        font-size: 40px;
    }
    
    .instruction-section h3 {
        font-size: 18px;
    }
    
    .question-card {
        padding: 20px;
    }
    
    .question-prompt {
        font-size: 18px;
    }
    
    .target-word {
        font-size: 22px;
        padding: 16px;
    }
    
    .typing-input {
        font-size: 20px;
        padding: 16px;
    }
    
    .matching-options {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .btn-large {
        width: 100%;
        padding: 18px 24px;
        font-size: 18px;
        min-width: auto;
    }
    
    .result-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .result-actions button {
        width: 100%;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    .navigation-buttons button {
        width: 100%;
    }
    
    .results-title {
        font-size: 28px;
    }
    
    .scores-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .question-card,
    .instruction-section,
    .score-card,
    .recommendation-card {
        border-width: 3px;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-back,
    .btn-skip {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .recording-pulse {
        animation: none;
        opacity: 1;
    }
}

/* Touch target sizing for mobile */
@media (pointer: coarse) {
    button {
        min-height: 56px;
        min-width: 56px;
    }
    
    .option-card {
        min-height: 200px;
    }
}