/* ============================================
   MUSIC NOTATION APP - APP SPECIFIC CSS
   Only styles unique to this app
   Common styles moved to shared.css
   ============================================ */

/* Flashcard container override - taller for this app */
.flashcard-container {
    min-height: 220px;
    /* Prevent CLS by ensuring container doesn't change size */
    height: 220px;
}

.flashcard {
    height: 220px;
}

/* Ensure flashcard front and back have fixed dimensions */
.flashcard-front,
.flashcard-back {
    height: 220px;
}

.question-label {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: absolute;
    top: 2px;
    left: 12px;
    right: 40px; /* Account for 28px dog-ear + margin */
    text-align: center;
    background: linear-gradient(to bottom, var(--card) 60%, transparent);
    padding: 8px 16px 16px;
    z-index: 2;
    border-radius: 10px 0 0 0;
}

.hint-controls {
    position: absolute;
    bottom: 2px;
    left: 12px;
    right: 12px;
    text-align: center;
    background: linear-gradient(to top, var(--card) 60%, transparent);
    padding: 16px 16px 8px;
    z-index: 2;
    margin: 0;
    border-radius: 0 0 10px 10px;
}

/* Dark mode gradient backgrounds */
body.dark-mode .question-label {
    background: linear-gradient(to bottom, var(--card) 60%, transparent);
}

body.dark-mode .hint-controls {
    background: linear-gradient(to top, var(--card) 60%, transparent);
}
/* VexFlow Notation Container - specific width for music notation */
.notation-container {
    width: 100%;
    max-width: 380px;
    min-height: 160px; /* VexFlow renders 380x160 - prevents CLS */
    display: flex;
    justify-content: center;
    align-items: center;
}

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

/* Dark mode notation adjustments */
body.dark-mode .notation-container svg {
    filter: invert(1) hue-rotate(180deg);
}

body.dark-mode .notation-container svg text {
    fill: var(--text);
}

.answer-reveal {
    font-size: 72px;
    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 layout - responsive note buttons */
.answer-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

/* Desktop/Mobile layout wrappers */
.note-buttons-desktop {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-buttons-mobile {
    display: none;
    flex-direction: column;
    gap: 6px;
}

.answer-row.note-row {
    display: flex;
    justify-content: center;
}

.answer-row.note-row .pills {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.answer-row.note-row.last-row {
    justify-content: center;
}

/* Pill base styling */
.pill {
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 48px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    background: var(--card);
}

.pill:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.pill:active:not(:disabled) {
    transform: scale(0.96);
}

.pill:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Note colors - bordered style based on note letter */
/* C notes - Blue */
.answer-row.note-row .pill[data-note^="C"] {
    border-color: #60a5fa;
    color: #2563eb;
}
.answer-row.note-row .pill[data-note^="C"]:hover:not(:disabled) {
    background: #dbeafe;
}

/* D notes - Gray */
.answer-row.note-row .pill[data-note^="D"] {
    border-color: #9ca3af;
    color: #4b5563;
}
.answer-row.note-row .pill[data-note^="D"]:hover:not(:disabled) {
    background: #f3f4f6;
}

/* E notes - Green */
.answer-row.note-row .pill[data-note^="E"] {
    border-color: #34d399;
    color: #059669;
}
.answer-row.note-row .pill[data-note^="E"]:hover:not(:disabled) {
    background: #d1fae5;
}

/* F notes - Red */
.answer-row.note-row .pill[data-note^="F"] {
    border-color: #f87171;
    color: #dc2626;
}
.answer-row.note-row .pill[data-note^="F"]:hover:not(:disabled) {
    background: #fee2e2;
}

/* G notes - Yellow/Orange */
.answer-row.note-row .pill[data-note^="G"] {
    border-color: #fbbf24;
    color: #d97706;
}
.answer-row.note-row .pill[data-note^="G"]:hover:not(:disabled) {
    background: #fef3c7;
}

/* A notes - Dark Gray */
.answer-row.note-row .pill[data-note^="A"] {
    border-color: #6b7280;
    color: #374151;
}
.answer-row.note-row .pill[data-note^="A"]:hover:not(:disabled) {
    background: #f3f4f6;
}

/* B notes - Teal */
.answer-row.note-row .pill[data-note^="B"] {
    border-color: #2dd4bf;
    color: #0d9488;
}
.answer-row.note-row .pill[data-note^="B"]:hover:not(:disabled) {
    background: #ccfbf1;
}

/* Dark mode adjustments */
body.dark-mode .pill {
    background: var(--bg);
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .flashcard-container {
        min-height: 200px;
        height: 200px;
    }

    .flashcard {
        height: 200px;
    }

    .flashcard-front,
    .flashcard-back {
        padding: 20px;
        height: 200px;
    }

    .notation-container {
        max-width: 320px;
    }

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

/* Mobile: switch to 4-row layout */
@media (max-width: 600px) {
    .note-buttons-desktop {
        display: none;
    }

    .note-buttons-mobile {
        display: flex;
    }

    .answer-row.note-row .pill {
        min-width: 44px;
        padding: 10px 6px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .flashcard-container {
        min-height: 170px;
        height: 170px;
    }

    .flashcard {
        height: 170px;
    }

    .flashcard-front,
    .flashcard-back {
        height: 170px;
    }

    .notation-container {
        max-width: 280px;
        margin: 4px 0;
    }

    .question-label {
        font-size: 12px;
        top: 6px;
    }

    .hint-controls {
        bottom: 6px;
    }

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