/**
 * FRCR Modern Theme - Shared Styles
 * Light/Dark theme support for all FRCR pages
 */

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

:root {
    /* Light theme (default) */
    --frcr-bg-primary: #FFFFFF;
    --frcr-bg-secondary: #F8FAFC;
    --frcr-bg-tertiary: #F1F5F9;
    --frcr-text-primary: #0F172A;
    --frcr-text-secondary: #475569;
    --frcr-text-muted: #94A3B8;
    --frcr-accent-purple: #667eea;
    --frcr-accent-purple-dark: #764ba2;
    --frcr-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --frcr-border: #E2E8F0;
    --frcr-shadow: 0 1px 3px rgba(0,0,0,0.05);
    --frcr-shadow-hover: 0 10px 40px rgba(0,0,0,0.1);
    --frcr-shadow-lg: 0 20px 60px rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] {
    --frcr-bg-primary: #0A0F1E;
    --frcr-bg-secondary: #111827;
    --frcr-bg-tertiary: #1F2937;
    --frcr-text-primary: #F9FAFB;
    --frcr-text-secondary: #D1D5DB;
    --frcr-text-muted: #9CA3AF;
    --frcr-border: rgba(255, 255, 255, 0.1);
    --frcr-shadow: 0 4px 6px rgba(0,0,0,0.3);
    --frcr-shadow-hover: 0 20px 60px rgba(59, 130, 246, 0.2);
    --frcr-shadow-lg: 0 20px 60px rgba(102, 126, 234, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--frcr-bg-secondary);
    color: var(--frcr-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
.frcr-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--frcr-border);
    transition: background 0.3s ease;
}

[data-theme="dark"] .frcr-header {
    background: rgba(10, 15, 30, 0.9);
}

.frcr-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.frcr-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--frcr-text-primary);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.frcr-logo:hover {
    opacity: 0.8;
}

.frcr-logo img {
    height: 40px;
    width: 40px;
    border-radius: 8px;
}

.frcr-nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
}

.frcr-nav-link {
    color: var(--frcr-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.frcr-nav-link:hover {
    color: var(--frcr-text-primary);
}

.frcr-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--frcr-border);
    background: var(--frcr-bg-tertiary);
    color: var(--frcr-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.frcr-theme-toggle:hover {
    transform: scale(1.05);
    background: var(--frcr-bg-primary);
}

.frcr-btn-header {
    padding: 0.6rem 1.5rem;
    background: var(--frcr-gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.frcr-btn-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Main Content */
.frcr-main-content {
    padding-top: 80px;
    min-height: calc(100vh - 200px);
}

/* Container */
.frcr-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.frcr-container-narrow {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.frcr-hero {
    padding: 4rem 2rem;
    background: var(--frcr-bg-primary);
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
}

.frcr-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.08), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.08), transparent 50%);
    z-index: 0;
}

[data-theme="dark"] .frcr-hero-bg {
    background: 
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.15), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.15), transparent 50%);
}

.frcr-hero-content {
    position: relative;
    z-index: 1;
}

.frcr-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--frcr-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.frcr-breadcrumb:hover {
    color: var(--frcr-accent-purple);
}

.frcr-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--frcr-text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.frcr-hero-highlight {
    background: var(--frcr-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.frcr-hero p {
    font-size: 1.125rem;
    color: var(--frcr-text-secondary);
    max-width: 700px;
    line-height: 1.6;
}

/* Cards */
.frcr-card {
    background: var(--frcr-bg-primary);
    border: 1px solid var(--frcr-border);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--frcr-shadow);
}

.frcr-card:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: var(--frcr-shadow-hover);
    transform: translateY(-5px);
}

.frcr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.frcr-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--frcr-text-primary);
}

.frcr-card-body {
    color: var(--frcr-text-secondary);
    line-height: 1.6;
}

/* Buttons */
.frcr-btn {
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.frcr-btn-primary {
    background: var(--frcr-gradient);
    color: white;
}

.frcr-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--frcr-shadow-lg);
}

.frcr-btn-secondary {
    background: var(--frcr-bg-tertiary);
    border: 1px solid var(--frcr-border);
    color: var(--frcr-text-primary);
}

.frcr-btn-secondary:hover {
    background: var(--frcr-bg-primary);
    border-color: rgba(102, 126, 234, 0.5);
}

.frcr-btn-outline {
    background: transparent;
    border: 2px solid var(--frcr-border);
    color: var(--frcr-text-primary);
}

.frcr-btn-outline:hover {
    border-color: var(--frcr-accent-purple);
    background: rgba(102, 126, 234, 0.05);
}

/* Badge */
.frcr-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.875rem;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.frcr-badge-purple {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.frcr-badge-easy {
    background: #dcfce7;
    color: #166534;
}

.frcr-badge-medium {
    background: #fef3c7;
    color: #92400e;
}

.frcr-badge-hard {
    background: #fee2e2;
    color: #991b1b;
}

[data-theme="dark"] .frcr-badge-easy {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

[data-theme="dark"] .frcr-badge-medium {
    background: rgba(251, 191, 36, 0.2);
    color: #fde047;
}

[data-theme="dark"] .frcr-badge-hard {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Stats Grid */
.frcr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.frcr-stat-card {
    background: var(--frcr-bg-primary);
    border: 1px solid var(--frcr-border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.frcr-stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: var(--frcr-shadow-hover);
}

.frcr-stat-label {
    font-size: 0.875rem;
    color: var(--frcr-text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.frcr-stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--frcr-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* List Items */
.frcr-list {
    display: grid;
    gap: 1rem;
}

.frcr-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: var(--frcr-bg-primary);
    border: 1px solid var(--frcr-border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--frcr-text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.frcr-list-item:hover {
    background: var(--frcr-bg-tertiary);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateX(8px);
    box-shadow: var(--frcr-shadow-hover);
}

.frcr-list-item-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.frcr-list-item-icon {
    width: 48px;
    height: 48px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--frcr-accent-purple);
    font-size: 1.25rem;
}

.frcr-list-item-text h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--frcr-text-primary);
}

.frcr-list-item-text p {
    color: var(--frcr-text-muted);
    font-size: 0.9rem;
}

.frcr-list-item-arrow {
    color: var(--frcr-text-muted);
    transition: all 0.3s ease;
    font-size: 1.25rem;
}

.frcr-list-item:hover .frcr-list-item-arrow {
    transform: translateX(5px);
    color: var(--frcr-accent-purple);
}

/* Progress Bar */
.frcr-progress {
    width: 100%;
    height: 8px;
    background: var(--frcr-bg-tertiary);
    border-radius: 50px;
    overflow: hidden;
}

/* Result Badges for Statements */
.frcr-result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.75rem;
}

.frcr-result-correct {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .frcr-result-correct {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.frcr-result-wrong {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .frcr-result-wrong {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Statement Item Answered States */
.frcr-statement-item.answered-correct {
    border-color: #16a34a !important;
    background: rgba(34, 197, 94, 0.03);
}

[data-theme="dark"] .frcr-statement-item.answered-correct {
    border-color: #4ade80 !important;
    background: rgba(34, 197, 94, 0.05);
}

.frcr-statement-item.answered-wrong {
    border-color: #dc2626 !important;
    background: rgba(239, 68, 68, 0.03);
}

[data-theme="dark"] .frcr-statement-item.answered-wrong {
    border-color: #f87171 !important;
    background: rgba(239, 68, 68, 0.05);
}

/* Explanation Section Visibility */
.frcr-explanation-section {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.frcr-explanation-section.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Quiz Two-Column Grid Layout */
.frcr-quiz-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto !important;
    gap: 2rem;
    padding: 2rem;
    width: 100%;
}

@media (max-width: 968px) {
    .frcr-quiz-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

.frcr-question-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.frcr-statements-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Adjust sections within the grid */
.frcr-quiz-grid .frcr-question-section {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.frcr-quiz-grid .frcr-options-section {
    padding: 0;
    background: transparent;
    border-top: none;
}

.frcr-quiz-grid .frcr-question-header {
    margin-bottom: 1.5rem;
}

/* Statement cards in grid layout */
.frcr-quiz-grid .frcr-statement-item {
    background: var(--frcr-bg-primary);
    border: 1px solid var(--frcr-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.frcr-quiz-grid .frcr-statement-item:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Remove statement number badge in grid, use smaller numbering */
.frcr-quiz-grid .frcr-statement-number {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.frcr-progress-bar {
    height: 100%;
    background: var(--frcr-gradient);
    border-radius: 50px;
    transition: width 0.5s ease;
}

/* Footer */
.frcr-footer {
    max-width: 1400px;
    margin: 4rem auto 0;
    padding: 2rem;
    text-align: center;
    color: var(--frcr-text-muted);
    border-top: 1px solid var(--frcr-border);
}

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

.frcr-fade-in {
    animation: fadeInUp 0.6s ease both;
}

/* Responsive */
@media (max-width: 768px) {
    .frcr-header-container {
        padding: 1rem;
    }

    .frcr-nav-menu {
        gap: 1rem;
    }

    .frcr-nav-link {
        display: none;
    }

    .frcr-main-content {
        padding-top: 70px;
    }

    .frcr-container,
    .frcr-container-narrow {
        padding: 1rem;
    }

    .frcr-hero {
        padding: 2rem 1rem;
    }

    .frcr-hero h1 {
        font-size: 1.75rem;
    }

    .frcr-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .frcr-card {
        padding: 1.5rem;
    }

    .frcr-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* ============================================
   ANATOMY MODULE STYLES
   ============================================ */

/* Anatomy Marker Row */
.anatomy-marker-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--frcr-bg-primary);
    border: 1px solid var(--frcr-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.anatomy-marker-row:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .anatomy-marker-row:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

/* Anatomy Marker Number */
.anatomy-marker-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--frcr-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    margin-top: 0.125rem;
}

/* Anatomy Marker Input */
.anatomy-marker-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--frcr-border);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--frcr-text-primary);
    background: var(--frcr-bg-primary);
    transition: all 0.3s ease;
}

.anatomy-marker-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.anatomy-marker-input::placeholder {
    color: var(--frcr-text-muted);
}

.anatomy-marker-input.correct {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

[data-theme="dark"] .anatomy-marker-input.correct {
    background: rgba(16, 185, 129, 0.1);
}

.anatomy-marker-input.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

[data-theme="dark"] .anatomy-marker-input.incorrect {
    background: rgba(239, 68, 68, 0.1);
}

/* Anatomy Reveal Button */
.anatomy-reveal-btn {
    padding: 0.625rem 1.25rem;
    background: var(--frcr-bg-secondary);
    border: 1px solid var(--frcr-border);
    border-radius: 8px;
    color: var(--frcr-text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.anatomy-reveal-btn:hover {
    background: var(--frcr-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.anatomy-reveal-btn.revealed {
    background: #10b981;
    color: white;
    border-color: #10b981;
    cursor: default;
    pointer-events: none;
}

.anatomy-reveal-btn.revealed:hover {
    transform: none;
    box-shadow: none;
}

/* Anatomy Feedback */
.anatomy-feedback {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    min-height: 1.25rem;
}

.anatomy-feedback-correct {
    color: #10b981;
}

.anatomy-feedback-incorrect {
    color: #ef4444;
}

[data-theme="dark"] .anatomy-feedback-correct {
    color: #34d399;
}

[data-theme="dark"] .anatomy-feedback-incorrect {
    color: #f87171;
}

/* Anatomy Two-Column Grid Layout */
.frcr-anatomy-grid {
    display: grid !important;
    grid-template-columns: 60fr 40fr !important;
    gap: 1.5rem;
    align-items: start;
    padding: 1.5rem;
}

.frcr-anatomy-question-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.frcr-anatomy-markers-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Adjust marker rows in grid layout */
.frcr-anatomy-grid .anatomy-marker-row {
    margin-bottom: 0.75rem;
    padding: 0.875rem;
}

.frcr-anatomy-grid .anatomy-marker-input {
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
}

.frcr-anatomy-grid .anatomy-reveal-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.frcr-anatomy-grid .anatomy-marker-number {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.8125rem;
}

/* Responsive adjustments for anatomy module */
@media (max-width: 968px) {
    .frcr-anatomy-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .anatomy-marker-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .anatomy-reveal-btn {
        width: 100%;
        justify-content: center;
    }
}
