/* ========================================
   COZY JOURNAL AESTHETIC - AnimaTunes
   A warm, organic, handmade feel
   ======================================== */

:root {
    /* Light Mode - Soft pink & warm rose */
    --bg-base: #F5E6E8;
    --bg-warm: #F0DDE0;
    --bg-accent: #EBCED4;
    --text-primary: #4A4044;
    --text-secondary: #6B5A60;
    --text-muted: #9A8589;
    --heading-color: #6B5B6E;
    --accent-warm: #D4A5A5;
    --accent-rose: #E8B4B8;
    --accent-sage: #A8B5A0;
    --accent-terracotta: #C4857A;
    --card-bg: rgba(255, 250, 252, 0.55);
    --card-border: rgba(212, 165, 165, 0.3);
    --section-bg: rgba(255, 248, 250, 0.45);
    --input-bg: rgba(255, 252, 253, 0.8);
    --shadow-soft: rgba(107, 91, 110, 0.1);
    --shadow-warm: rgba(212, 165, 165, 0.2);
    --grain-opacity: 0.025;
}

[data-theme="dark"] {
    /* Dark Mode - Cozy evening warmth */
    --bg-base: #1C1917;
    --bg-warm: #231F1C;
    --bg-accent: #2D2825;
    --text-primary: #E8E2DB;
    --text-secondary: #B8ADA0;
    --text-muted: #7D7268;
    --heading-color: #D4C5B5;
    --accent-warm: #B8956B;
    --accent-rose: #B88888;
    --accent-sage: #7A9172;
    --accent-terracotta: #A87058;
    --card-bg: rgba(45, 40, 37, 0.85);
    --card-border: rgba(184, 149, 107, 0.2);
    --section-bg: rgba(35, 31, 28, 0.7);
    --input-bg: #2D2825;
    --shadow-soft: rgba(0, 0, 0, 0.25);
    --shadow-warm: rgba(184, 149, 107, 0.1);
    --grain-opacity: 0.04;
}

/* ========================================
   RESET & BASE
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg-base);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    transition: background-color 0.6s ease, color 0.6s ease;
}

/* ========================================
   TEXTURE LAYERS - Paper-like feel
   ======================================== */

.bg-texture {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, var(--accent-rose) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, var(--accent-sage) 0%, transparent 45%),
        radial-gradient(ellipse at 60% 50%, var(--accent-warm) 0%, transparent 40%);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

.bg-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ========================================
   FLOATING DECORATIONS - Rise from bottom
   ======================================== */

.decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    /* Hardware acceleration for child animations */
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

/* Clouds - Soft and dreamy */
.cloud {
    position: absolute;
    left: -200px;
    width: 160px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), rgba(255, 240, 245, 0.5));
    border-radius: 100px;
    opacity: 0.6;
    animation: driftCloud 30s linear infinite;
    filter: blur(3px);
    z-index: 1;
    /* Behind floating images */
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), rgba(255, 240, 245, 0.5));
    border-radius: 50%;
}

.cloud::before {
    width: 70px;
    height: 70px;
    top: -30px;
    left: 25px;
}

.cloud::after {
    width: 90px;
    height: 90px;
    top: -40px;
    right: 25px;
}

[data-theme='dark'] .cloud,
[data-theme='dark'] .cloud::before,
[data-theme='dark'] .cloud::after {
    background: rgba(255, 255, 255, 0.15);
}

@keyframes driftCloud {
    0% {
        left: -200px;
    }

    100% {
        left: calc(100% + 200px);
    }
}

.float-image {
    position: absolute;
    bottom: -150px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.35;
    animation: floatUp var(--duration, 18s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    filter: saturate(0.9);
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: opacity 0.5s ease;
    z-index: 2;
}

.float-image.ponyo {
    background-image: url('../images/ponyo.png');
    width: 110px;
    height: 110px;
}

.float-image.coffee {
    background-image: url('../images/coffee.png');
    width: 80px;
    height: 80px;
}

.float-image.coffee2 {
    background-image: url('../images/coffee2.png');
    width: 75px;
    height: 75px;
}

.float-image.heart-img {
    background-image: url('../images/heart.png');
    width: 70px;
    height: 70px;
}

.float-image.note {
    background-image: url('../images/note.png');
    width: 65px;
    height: 65px;
}

.float-image.star1 {
    background-image: url('../images/star1.png');
    width: 60px;
    height: 60px;
    opacity: 0.3;
}

.float-image.star2 {
    background-image: url('../images/star2.png');
    width: 55px;
    height: 55px;
    opacity: 0.25;
}

@keyframes floatUp {
    0% {
        bottom: -150px;
        opacity: 0;
        transform: translateX(0) rotate(0deg);
    }

    10% {
        opacity: 0.35;
    }

    50% {
        transform: translateX(30px) rotate(8deg);
    }

    90% {
        opacity: 0.35;
    }

    100% {
        bottom: 110vh;
        opacity: 0;
        transform: translateX(-15px) rotate(-5deg);
    }
}

[data-theme="dark"] .float-image {
    opacity: 0.2;
    filter: saturate(0.7) brightness(0.9);
}

/* ========================================
   LAYOUT
   ======================================== */

.container {
    position: relative;
    z-index: 10;
    max-width: 820px;
    margin: 0 auto;
    padding: 30px 24px 60px;
}

/* ========================================
   HEADER
   ======================================== */

header {
    margin-bottom: 50px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 4px 16px var(--shadow-soft),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.theme-toggle:hover {
    background: var(--accent-warm);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-btn,
.logout-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    letter-spacing: 0.3px;
}

.login-btn {
    background: #1DB954;
    color: white;
    border: none;
}

.login-btn:hover {
    background: #1ed760;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.3);
}

.logout-btn {
    background: var(--section-bg);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(8px);
}

.logout-btn:hover {
    background: var(--accent-rose);
    color: white;
    border-color: transparent;
}

.user-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Title Block */
.title-block {
    text-align: center;
    position: relative;
}

.title-accent {
    font-family: 'Caveat', cursive;
    font-size: 32px;
    color: var(--accent-warm);
    display: block;
    margin-bottom: -8px;
    opacity: 0.8;
}

.title {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: clamp(42px, 10vw, 64px);
    font-weight: 500;
    font-style: italic;
    color: var(--heading-color);
    letter-spacing: -1px;
    margin-bottom: 8px;
    line-height: 1.1;
}

.tagline {
    font-family: 'Caveat', cursive;
    font-size: 22px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ========================================
   VIEW TRANSITIONS
   ======================================== */

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-new(root) {
    z-index: 9999;
}

::view-transition-old(root) {
    z-index: 1;
}

.transitioning * {
    transition: none !important;
}

/* ========================================
   SECTIONS - Shared styles
   ======================================== */

section {
    margin-bottom: 45px;
}

section h2 {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 26px;
    font-weight: 500;
    color: var(--heading-color);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.hint {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-weight: 400;
}

/* ========================================
   MOOD SELECTION
   ======================================== */

.mood-section .section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 28px;
}

.mood-section .section-header h2 {
    margin-bottom: 0;
}

.random-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 4px 16px var(--shadow-soft),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.random-btn:hover {
    background: var(--accent-terracotta);
    color: white;
    border-color: transparent;
    transform: rotate(15deg);
}

.mood-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.mood-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px 12px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 24px var(--shadow-soft),
        inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.mood-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-warm) 0%, var(--accent-rose) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.mood-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px var(--shadow-warm);
    border-color: var(--accent-warm);
}

.mood-card:hover::before {
    opacity: 0.08;
}

.mood-card.selected {
    border-color: var(--accent-warm);
    box-shadow:
        0 0 0 3px rgba(201, 168, 124, 0.2),
        0 12px 32px var(--shadow-warm);
    transform: translateY(-4px);
}

.mood-card.selected::before {
    opacity: 0.12;
}

/* Mood Icons - Emojis */
.mood-icon {
    font-size: 38px;
    margin-bottom: 12px;
    display: block;
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1;
}

.mood-card:hover .mood-icon {
    transform: scale(1.15) rotate(5deg);
}

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

.mood-name {
    display: block;
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.mood-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ========================================
   GENRE SELECTION
   ======================================== */

.genre-section {
    background: var(--section-bg);
    padding: 28px 24px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    box-shadow:
        0 8px 32px var(--shadow-soft),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.genre-controls {
    max-width: 400px;
    margin: 0 auto 20px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

#genreSearch {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

#genreSearch::placeholder {
    color: var(--text-muted);
}

#genreSearch:focus {
    border-color: var(--accent-warm);
    box-shadow: 0 0 0 3px rgba(201, 168, 124, 0.15);
}

/* Genre Grid */
.genre-grid-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 8px 0 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-warm) transparent;
    cursor: grab;
}

.genre-grid-wrapper:active {
    cursor: grabbing;
}

.genre-grid-wrapper::-webkit-scrollbar {
    height: 5px;
}

.genre-grid-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent-warm);
    border-radius: 10px;
}

.genre-grid {
    display: grid;
    grid-template-rows: repeat(5, auto);
    grid-auto-flow: column;
    gap: 10px;
    padding: 0 20px;
    width: max-content;
}

.genre-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    min-width: 110px;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px var(--shadow-soft);
}

.genre-count {
    font-size: 11px;
    opacity: 0.5;
    font-weight: 400;
}

.genre-tag:hover {
    border-color: var(--accent-warm);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-soft);
}

.genre-tag.selected {
    background: var(--accent-warm);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 16px rgba(201, 168, 124, 0.35);
}

.genre-tag.selected .genre-count {
    opacity: 0.7;
    color: white;
}

/* Selected Genres */
.selected-genres-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    background: rgba(212, 165, 165, 0.15);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.selected-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.selected-genres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.selected-genre-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--accent-sage);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    animation: scaleIn 0.2s ease;
}

.remove-genre {
    cursor: pointer;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.25);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.remove-genre:hover {
    background: rgba(255, 255, 255, 0.4);
}

.clear-genres-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.clear-genres-btn:hover {
    opacity: 1;
    color: var(--accent-terracotta);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   SEED INPUTS
   ======================================== */

.seeds-section {
    background: var(--section-bg);
    padding: 28px 24px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    box-shadow:
        0 8px 32px var(--shadow-soft),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.seeds-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.seed-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.seed-input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.seed-input::placeholder {
    color: var(--text-muted);
}

.seed-input:focus {
    outline: none;
    border-color: var(--accent-warm);
    box-shadow: 0 0 0 3px rgba(201, 168, 124, 0.15);
}

.remove-seed-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--accent-rose);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.remove-seed-btn:hover {
    background: var(--accent-terracotta);
    transform: rotate(90deg);
}

.add-seed-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    padding: 10px 20px;
    border: 1px dashed var(--accent-warm);
    background: transparent;
    color: var(--accent-warm);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-seed-btn:hover {
    background: rgba(201, 168, 124, 0.1);
    transform: translateY(-2px);
}

.add-seed-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   GENERATE BUTTON
   ======================================== */

.generate-section {
    text-align: center;
    margin-bottom: 35px;
}

.generate-btn {
    padding: 18px 48px;
    border: none;
    background: linear-gradient(135deg, var(--accent-warm) 0%, var(--accent-terracotta) 100%);
    color: white;
    border-radius: 14px;
    font-size: 17px;
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 500;
    font-style: italic;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 8px 24px rgba(201, 168, 124, 0.35);
    position: relative;
    overflow: hidden;
}

.generate-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(201, 168, 124, 0.45);
}

.generate-btn:hover:not(:disabled)::after {
    transform: translateX(100%);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   ERROR MESSAGE
   ======================================== */

.error-message {
    background: rgba(212, 165, 165, 0.15);
    border: 1px solid var(--accent-rose);
    border-radius: 12px;
    padding: 14px 20px;
    margin: 20px auto;
    max-width: 500px;
    text-align: center;
    color: var(--accent-terracotta);
    font-weight: 500;
    font-size: 14px;
}

/* ========================================
   RESULTS
   ======================================== */

.results-section {
    margin-top: 40px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    text-align: center;
    margin-bottom: 24px;
}

.results-title {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 28px;
    font-weight: 500;
    font-style: italic;
    color: var(--heading-color);
    margin-bottom: 6px;
}

.results-mood {
    font-family: 'Caveat', cursive;
    font-size: 20px;
    color: var(--text-muted);
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.reshuffle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 4px 16px var(--shadow-soft),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.reshuffle-btn:hover {
    border-color: var(--accent-warm);
    color: var(--accent-warm);
    transform: translateY(-2px);
}

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

.save-playlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    background: #1DB954;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.save-playlist-btn:hover {
    background: #1ed760;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.35);
}

.save-playlist-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Playlist Grid */
.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    grid-auto-rows: 80px;
}

.track-card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: fadeInUp 0.5s ease;
    animation-fill-mode: both;
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    box-shadow:
        0 4px 16px var(--shadow-soft),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    border: 1px solid var(--card-border);
}

.track-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-warm);
}

/* Stagger animation */
.track-card:nth-child(1) {
    animation-delay: 0.05s;
}

.track-card:nth-child(2) {
    animation-delay: 0.1s;
}

.track-card:nth-child(3) {
    animation-delay: 0.15s;
}

.track-card:nth-child(4) {
    animation-delay: 0.2s;
}

.track-card:nth-child(5) {
    animation-delay: 0.25s;
}

.track-card:nth-child(6) {
    animation-delay: 0.3s;
}

.track-card:nth-child(n+7) {
    animation-delay: 0.35s;
}

.spotify-embed {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
}

.footer-note {
    font-family: 'Caveat', cursive;
    font-size: 18px;
    color: var(--text-muted);
    opacity: 0.7;
}

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

@media (max-width: 768px) {
    .container {
        padding: 20px 16px 50px;
    }

    .title {
        font-size: 38px;
    }

    .tagline {
        font-size: 18px;
    }

    .mood-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .mood-card {
        padding: 16px 10px 14px;
    }

    .mood-visual {
        width: 40px;
        height: 40px;
        margin-bottom: 10px;
    }

    .mood-name {
        font-size: 15px;
    }

    .genre-section,
    .seeds-section {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .playlist-grid {
        grid-template-columns: 1fr;
    }

    .generate-btn {
        font-size: 16px;
        padding: 16px 36px;
    }

    .results-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 820px) {
    .header-row {
        margin-bottom: 30px;
    }

    .title {
        font-size: 32px;
    }

    .mood-grid {
        grid-template-columns: 1fr 1fr;
    }

    .mood-card {
        padding: 14px 8px 12px;
    }

    section h2 {
        font-size: 22px;
    }

    .float-image {
        display: block !important;
    }

    .mobile-hidden {
        display: none !important;
    }
}

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

[data-theme="dark"] .bg-texture {
    opacity: 0.08;
}

[data-theme="dark"] .genre-tag.selected {
    background: var(--accent-warm);
}

[data-theme="dark"] .selected-genre-tag {
    background: var(--accent-sage);
}

/* ========================================
   ABOUT MODAL & BUTTON
   ======================================== */

.about-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 4px 16px var(--shadow-soft),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.about-btn:hover {
    background: var(--accent-sage);
    color: white;
    border-color: transparent;
    transform: translateY(-2px) rotate(10deg);
}

.about-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.about-btn:hover .about-icon {
    transform: scale(1.1);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 40, 37, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-base);
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 24px;
    padding: 32px;
    position: relative;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px var(--card-border);
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--card-border);
    margin: auto 0;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 4px 16px var(--shadow-soft),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.modal-close:hover {
    background: var(--accent-rose);
    border-color: var(--accent-rose);
    color: white;
}

.close-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    flex-shrink: 0;
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.modal-icon {
    font-size: 42px;
    margin-bottom: 12px;
    display: inline-block;
    animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {

    0%,
    100% {
        transform: translateX(0) rotate(0deg);
    }

    25% {
        transform: translateX(-8px) rotate(-5deg);
    }

    75% {
        transform: translateX(8px) rotate(5deg);
    }
}

.modal-header h2 {
    font-family: 'Crimson Pro', serif;
    font-size: 28px;
    color: var(--heading-color);
    margin: 0;
}

.app-description {
    text-align: center;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 32px;
    font-size: 15px;
}

.usage-guide {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--card-border);
}

.usage-guide h3 {
    font-family: 'Caveat', cursive;
    font-size: 22px;
    color: var(--accent-terracotta);
    margin-bottom: 16px;
    text-align: center;
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.steps-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.step-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}

.modal-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
}

.modal-footer p {
    font-family: 'Caveat', cursive;
    color: var(--text-muted);
    font-size: 18px;
}

/* Dark mode adjustments for modal */
[data-theme="dark"] .usage-guide {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}