/* ============================================
   FLASHCARD COMMON CSS
   Shared styles for all flashcard games
   App-specific overrides go in individual *-app.css files
   ============================================ */

/* ============================================
   QUESTION DISPLAY
   ============================================ */

/* Content wrapper - groups question + notation, centers them in available space */
.flashcard-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.question-label {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 600;
    text-align: center;
}

.question-text {
    font-size: 17px;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.highlight {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
    margin: 8px 4px;
    line-height: 1.2;
}

/* ============================================
   ANSWER REVEAL (Flashcard Back)
   ============================================ */

.answer-reveal {
    font-size: 52px;
    font-weight: 900;
    color: var(--green);
    margin-bottom: 8px;
}

.answer-label {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* ============================================
   ANSWER BUTTONS LAYOUT
   ============================================ */

.answer-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 40px;
    justify-content: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.answer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.row-label {
    font-size: 18px;
    font-weight: 700;
    min-width: 28px;
    flex-shrink: 0;
}

/* Row label colors by letter */
.row-label[data-letter="C"] { color: #3b82f6; }
.row-label[data-letter="D"] { color: #64748b; }
.row-label[data-letter="E"] { color: #10b981; }
.row-label[data-letter="F"] { color: #ef4444; }
.row-label[data-letter="G"] { color: #f59e0b; }
.row-label[data-letter="A"] { color: #64748b; }
.row-label[data-letter="B"] { color: #8b5cf6; }

.pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

/* ============================================
   PILL BUTTONS (Answer Choices)
   ============================================ */

.pill {
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 100px;
    border: 2px solid;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 52px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Pill colors by parent row letter */
.answer-row[data-letter="C"] .pill { border-color: #3b82f6; color: #3b82f6; }
.answer-row[data-letter="D"] .pill { border-color: #64748b; color: #64748b; }
.answer-row[data-letter="E"] .pill { border-color: #10b981; color: #10b981; }
.answer-row[data-letter="F"] .pill { border-color: #ef4444; color: #ef4444; }
.answer-row[data-letter="G"] .pill { border-color: #f59e0b; color: #f59e0b; }
.answer-row[data-letter="A"] .pill { border-color: #64748b; color: #64748b; }
.answer-row[data-letter="B"] .pill { border-color: #8b5cf6; color: #8b5cf6; }

/* Pill hover state */
.pill:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Pill correct/incorrect states */
.pill.correct {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
}

.pill.incorrect {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
}

.pill:disabled {
    cursor: wait;
    opacity: 0.4;
}

/* ============================================
   NOTATION CONTAINER (VexFlow/VexTab)
   ============================================ */

.notation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    margin: 8px 0;
}

.notation-container svg {
    max-width: 100%;
    height: auto;
}

/* ============================================
   DARK MODE
   ============================================ */

body.dark-mode .pill {
    background: var(--bg);
}

body.dark-mode .pill:hover:not(:disabled) {
    background: var(--border);
    border-color: var(--primary);
}

/* Invert SVG notation colors in dark mode */
body.dark-mode .notation-container svg,
body.dark-mode .vex-tabdiv svg {
    filter: invert(1) hue-rotate(180deg);
}

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

@media (max-width: 768px) {
    .highlight {
        font-size: 26px;
    }

    .answer-reveal {
        font-size: 44px;
    }

    .notation-container {
        min-height: 100px;
    }

    .answer-container {
        gap: 12px;
    }

    .answer-row {
        gap: 6px;
    }

    .pills {
        gap: 5px;
    }

    .pill {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 48px;
    }

    .row-label {
        font-size: 16px;
        min-width: 24px;
    }
}

@media (max-width: 480px) {
    .highlight {
        font-size: 24px;
    }

    .answer-reveal {
        font-size: 40px;
    }

    .notation-container {
        min-height: 80px;
        overflow-x: auto;
    }

    .pill {
        padding: 7px 10px;
        font-size: 13px;
        min-width: 44px;
    }

    .row-label {
        font-size: 15px;
        min-width: 22px;
    }
}

/* ============================================
   EDUCATIONAL CONTENT SECTION
   Placed below game footer for SEO purposes
   ============================================ */

.educational-content {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 48px 24px;
    margin-top: 32px;
}

.educational-content .content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    align-items: start;
}

/* Main guide section */
.educational-content .guide-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    color: var(--text);
}

.educational-content h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.educational-content h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 10px;
}

.educational-content p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 12px;
}

.educational-content ul,
.educational-content ol {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 12px;
    padding-left: 20px;
}

.educational-content li {
    margin-bottom: 6px;
}

/* Sidebar with related links */
.educational-content .related-tools {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 100px;
}

.educational-content .related-tools h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-top: 0;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'DM Sans', sans-serif;
}

.educational-content .related-tools h3:not(:first-child) {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.educational-content .related-tools ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.educational-content .related-tools li {
    margin-bottom: 8px;
}

.educational-content .related-tools a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    margin: 0 -12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.educational-content .related-tools a:hover {
    background: var(--bg-warm);
    color: var(--primary);
}

.educational-content .related-tools a::before {
    content: '→';
    color: var(--primary);
    font-weight: 600;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s;
}

.educational-content .related-tools a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* See All Tools link */
.educational-content .related-tools .see-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 12px;
    margin: 16px -12px 0;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.educational-content .related-tools .see-all-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.educational-content .related-tools .see-all-link::before {
    content: none; /* Override the arrow */
}

/* Responsive for educational content */
@media (max-width: 768px) {
    .educational-content {
        padding: 32px 16px;
    }

    .educational-content .content-wrapper {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .educational-content .related-tools {
        position: static;
    }

    .educational-content h2 {
        font-size: 22px;
    }

    .educational-content h3 {
        font-size: 17px;
    }
}
