/**
 * Chord Progression Generator Styles
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --accent-happy: #10b981;
    --accent-sad: #3b82f6;
    --accent-energetic: #f59e0b;
    --accent-dreamy: #ec4899;
    --accent-tense: #ef4444;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

html {
    background: #0f172a;
    color-scheme: dark;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Main Navigation */
.main-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 20px 20px;
    margin: 0 auto 20px auto;
    max-width: 1200px;
    border-bottom: 2px solid var(--surface-light);
    flex-wrap: wrap;
}

.nav-link {
    padding: 10px 20px;
    background: var(--surface-light);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    animation: fadeInDown 0.6s ease;
}

.header-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Header Links */
.header-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.header-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--surface-light);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.header-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Controls Section */
.controls {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.input-section {
    margin-bottom: 30px;
}

.input-section label,
.filter-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 1rem;
}

#note-selector {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    background: var(--surface-light);
    color: var(--text-primary);
    border: 2px solid var(--surface-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#note-selector:hover {
    border-color: var(--primary-color);
}

#note-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Mood Filters */
.mood-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mood-filter {
    padding: 10px 20px;
    background: var(--surface-light);
    color: var(--text-secondary);
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mood-filter:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.mood-filter.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Results Section */
.results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.progression-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.progression-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.star-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.6;
    transition: all 0.2s ease;
    z-index: 10;
}

.star-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.star-btn.starred {
    opacity: 1;
}

.progression-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Mood Tags */
.mood-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.mood-tag {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.mood-happy {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-happy);
}

.mood-uplifting {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
}

.mood-sad,
.mood-melancholic {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-sad);
}

.mood-dreamy {
    background: rgba(236, 72, 153, 0.2);
    color: var(--accent-dreamy);
}

.mood-unsettling {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-energetic);
}

.mood-uncomfortable {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-tense);
}

/* Chords Display */
.chords {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Chord Notes Section */
.chord-notes-section {
    background: var(--surface-light);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.notes-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chord-breakdowns {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chord-breakdown {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chord-name-small {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
    min-width: 60px;
}

.chord-notes {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--background);
    padding: 4px 10px;
    border-radius: 4px;
}

/* Key Hint */
.key-hint {
    background: var(--surface-light);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
}

.progression-description {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.roman-numerals {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    padding-top: 12px;
    border-top: 1px solid var(--surface-light);
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border-radius: var(--border-radius);
}

.no-results p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav {
        gap: 8px;
        padding: 15px 10px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .header-link {
        font-size: 0.85rem;
        padding: 6px 14px;
    }

    .controls {
        padding: 20px;
    }

    .results {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mood-filters {
        gap: 8px;
    }

    .mood-filter {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .chords {
        font-size: 1.2rem;
    }

    .chord-name-small {
        font-size: 0.9rem;
        min-width: 50px;
    }

    .chord-notes {
        font-size: 0.85rem;
    }

    .builder-controls-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .main-nav {
        gap: 6px;
        padding: 10px 5px;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .controls {
        padding: 16px;
    }

    .progression-card {
        padding: 20px;
    }

    #note-selector {
        max-width: 100%;
    }

    .chord-breakdown {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .chord-notes-section {
        padding: 10px 12px;
    }

    .builder-controls-grid {
        grid-template-columns: 1fr !important;
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progression-card {
    animation: fadeIn 0.3s ease;
}
