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

/* Settings Panel */
.settings-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 12px;
    padding: 16px 20px;
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.setting-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.setting-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.setting-btn:hover {
    color: var(--text);
    background: var(--card);
}

.setting-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.25);
}

.setting-btn.disabled,
.setting-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Flashcard container override - taller for this app */
.flashcard-container {
    min-height: 240px;
}

.flashcard {
    height: 240px;
}

/* ============================================
   ABSOLUTE POSITIONING PATTERN
   For apps with large notation that can overflow
   ============================================ */

/* Question text - positioned at top */
.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;
}

/* Flip button - positioned at bottom */
.hint-controls {
    position: absolute;
    bottom: 2px;
    left: 12px;
    right: 12px;
    z-index: 2;
    background: linear-gradient(to top, var(--card) 60%, transparent);
    padding: 16px 16px 8px;
    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 key signatures */
.notation-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

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

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

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

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

/* Answer layout - custom for key signatures */
.answer-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.row-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    min-width: 70px;
    text-align: right;
}

.pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Pill base styling - app-specific sizing */
.pill {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 24px;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 72px;
    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;
}

/* Sharp keys - warm colors */
.answer-row[data-type="sharps"] .pill {
    border-color: #f59e0b;
    color: #b45309;
}
.answer-row[data-type="sharps"] .pill:hover:not(:disabled) {
    background: #fef3c7;
}

/* Flat keys - cool colors */
.answer-row[data-type="flats"] .pill {
    border-color: #3b82f6;
    color: #1d4ed8;
}
.answer-row[data-type="flats"] .pill:hover:not(:disabled) {
    background: #dbeafe;
}

/* Natural key (C/Am) - neutral */
.answer-row[data-type="natural"] .pill {
    border-color: #10b981;
    color: #047857;
}
.answer-row[data-type="natural"] .pill:hover:not(:disabled) {
    background: #d1fae5;
}

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

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

body.dark-mode .answer-row[data-type="sharps"] .pill {
    border-color: #fbbf24;
    color: #fcd34d;
}

body.dark-mode .answer-row[data-type="flats"] .pill {
    border-color: #60a5fa;
    color: #93c5fd;
}

body.dark-mode .answer-row[data-type="natural"] .pill {
    border-color: #34d399;
    color: #6ee7b7;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .settings-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .setting-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .setting-toggle {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .setting-btn {
        flex: 1;
        min-width: 60px;
        text-align: center;
    }

    .flashcard-container {
        min-height: 220px;
    }

    .flashcard {
        height: 220px;
    }

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

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

    .answer-container {
        gap: 10px;
    }

    .row-label {
        min-width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }

    .pill {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 64px;
    }
}

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

    .flashcard {
        height: 200px;
    }

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

    .question-label {
        font-size: 13px;
    }

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

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

    .setting-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}
