/**
 * Gap Questionnaire Custom Styles
 * ================================
 * 
 * Tailwind handles most styling. This file contains:
 * - Custom animations
 * - Component-specific styles
 * - Accessibility enhancements
 */

/* Cascade Animation for Branching Questions */
@keyframes cascadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.branch-cascade {
    animation: cascadeIn 0.3s ease-out;
}


/* Focus Visible (Accessibility) */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}


/* High Contrast for WCAG AA */
.ai-feedback {
    color: #1f2937;
    background-color: #eff6ff;
}

.ai-feedback a {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Success Page */
.success-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.success-icon-wrap {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    background: #dcfce7;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon {
    width: 28px;
    height: 28px;
    color: #16a34a;
}

/* AI Feedback Card (Readability) */
.ai-feedback-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.ai-feedback-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ai-feedback-icon {
    width: 20px;
    height: 20px;
    color: #2563eb;
    flex-shrink: 0;
}

.ai-feedback-title {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 15px;
}

.ai-feedback-body {
    color: #1f2937;
    font-size: 14.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-feedback-body p {
    margin: 6px 0 10px;
}

.ai-feedback-body strong {
    color: #0f172a;
    font-weight: 700;
}

.ai-feedback-body .ai-feedback-heading {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 10px 0 6px;
}

.ai-feedback-body .ai-feedback-list {
    margin: 6px 0 10px 18px;
    padding: 0;
}

.ai-feedback-body .ai-feedback-list li {
    margin: 4px 0;
}

.ai-feedback-body .ai-feedback-spacer {
    height: 6px;
}

.ai-feedback-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 12px;
    font-size: 13.5px;
    color: #111827;
}

.ai-feedback-table th,
.ai-feedback-table td {
    border: 1px solid #dbeafe;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}

.ai-feedback-table th {
    background: #dbeafe;
    font-weight: 700;
}

.ai-feedback-table tr:nth-child(even) td {
    background: #f8fafc;
}

.ai-feedback-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #2563eb;
}


/* Loading Spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 1s linear infinite;
}


/* Touch Target Sizing (Mobile) */
@media (max-width: 767px) {
    button,
    a.button,
    input[type="radio"] + label,
    input[type="checkbox"] + label {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}


/* Sticky Footer Navigation (Mobile) */
.sticky-footer {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1rem;
    z-index: 30;
}


/* AI Feedback Gutter (Desktop) */
@media (min-width: 768px) {
    .ai-gutter {
        position: sticky;
        top: 2rem;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }
}


/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}


/* ========================================================================
   SWOT ANALYSIS IMPROVEMENTS
   ======================================================================== */

/* Two-line MCQ Options */
.mcq-option {
    display: flex;
    flex-direction: column;
    padding: 12px;
    min-height: 44px; /* Touch-friendly tap target */
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.mcq-option:hover {
    background: #f0f9ff;
    border-color: #93c5fd;
}

.mcq-label {
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.4;
}

.mcq-subtext {
    font-size: 0.875rem;
    color: #666;
    margin-top: 4px;
    line-height: 1.4;
}

/* Prominent Context Hints */
.context-hint-prominent {
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #1e40af;
    border-radius: 4px;
    line-height: 1.5;
}

/* Character Counter */
.char-counter {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
    display: block;
}

.char-counter.text-green-600 {
    font-weight: 500;
}

/* Pre-submit Quality Warnings */
.quality-warning {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.quality-warning-title {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
}

.quality-warning-suggestion {
    font-size: 0.875rem;
    color: #78350f;
    margin-top: 4px;
}


/* ========================================================================
   MOBILE RESPONSIVENESS (THREAT 1 MITIGATION)
   ======================================================================== */

@media (max-width: 640px) {
    /* Larger tap targets on mobile */
    .mcq-option {
        padding: 16px 12px;
    }
    
    /* Better readability for wrapped text */
    .mcq-label {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .mcq-subtext {
        font-size: 0.8rem;
        margin-top: 6px;
        line-height: 1.4;
    }
    
    /* Context hints on mobile */
    .context-hint-prominent {
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    
    /* Textarea on mobile */
    textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Character counter on mobile */
    .char-counter {
        font-size: 0.7rem;
    }
}
