:root {
    --frutiger-blue: #0094ff;
    --frutiger-green: #6ad200;
    --y2k-silver: #c0c0c0;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glow-color: rgba(0, 195, 255, 0.7);
    --text-glow: rgba(255, 255, 255, 0.8);
    --neon-edge: rgba(0, 225, 255, 0.8);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #0c0c1e;
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin: 0;
    padding: 2rem 1rem;
    min-height: 100vh;
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

#background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(0, 195, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(110, 80, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 25% 85%, rgba(0, 255, 150, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 75% 75%, rgba(255, 100, 200, 0.15) 0%, transparent 40%);
    animation: background-glow 20s ease-in-out infinite alternate;
}

@keyframes background-glow {
    0% {
        background-image: 
            radial-gradient(circle at 15% 20%, rgba(0, 195, 255, 0.15) 0%, transparent 40%),
            radial-gradient(circle at 80% 30%, rgba(110, 80, 255, 0.15) 0%, transparent 40%),
            radial-gradient(circle at 25% 85%, rgba(0, 255, 150, 0.12) 0%, transparent 40%),
            radial-gradient(circle at 75% 75%, rgba(255, 100, 200, 0.15) 0%, transparent 40%);
    }
    100% {
         background-image: 
            radial-gradient(circle at 25% 85%, rgba(0, 195, 255, 0.18) 0%, transparent 40%),
            radial-gradient(circle at 15% 20%, rgba(110, 80, 255, 0.18) 0%, transparent 40%),
            radial-gradient(circle at 75% 75%, rgba(0, 255, 150, 0.15) 0%, transparent 40%),
            radial-gradient(circle at 80% 30%, rgba(255, 100, 200, 0.18) 0%, transparent 40%);
    }
}

.app-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 900px;
    z-index: 1;
    margin: 0 auto;
}

.container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.site-header {
    text-align: center;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.logo {
    max-width: 250px;
    margin-bottom: -1rem;
    filter: drop-shadow(0 0 15px rgba(0, 225, 255, 0.5)) drop-shadow(0 0 35px rgba(170, 70, 255, 0.4));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover {
    transform: scale(1.05) rotate(-1deg);
    filter: drop-shadow(0 0 20px rgba(0, 225, 255, 0.8)) drop-shadow(0 0 45px rgba(170, 70, 255, 0.6));
}

.site-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
    font-weight: 700;
    text-shadow: 0 0 5px #fff, 0 0 15px var(--glow-color), 0 0 25px var(--glow-color), 0 2px 5px rgba(0,0,0,0.6);
}

.metallic-text {
    background: linear-gradient(180deg, #ffffff 40%, #c0e8ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2), 0 2px 3px rgba(0,0,0,0.4), 0 0 8px var(--text-glow), 0 0 2px rgba(255,255,255,0.8);
    font-weight: 900;
}

.generator-panel, .results-panel, .library-panel {
    background: rgba(30, 30, 70, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-align: center;
}

.generator-panel h2, .results-panel h2, .library-panel h2 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    animation: neon-glow-text 4s ease-in-out infinite alternate;
}

.generator-panel p {
    margin-top: 0;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.prompt-container, .genre-input-container {
    text-align: left;
    margin-bottom: 1rem;
}

.prompt-container label, .genre-input-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-shadow: 0 0 5px var(--text-glow), 0 0 2px white;
    color: #f0f8ff;
    padding-left: 0.5rem;
    letter-spacing: 1px;
}

textarea#prompt-input, #genre-input {
    width: calc(100% - 2rem);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 1rem;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    color: #fff;
    resize: vertical;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

textarea#prompt-input:focus, #genre-input:focus {
    outline: none;
    border-color: rgba(0, 195, 255, 0.8);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4), 0 0 15px rgba(0, 195, 255, 0.5);
}

#genre-input {
    height: auto;
    resize: none;
    padding: 0.8rem 1rem;
}

textarea#prompt-input {
    height: 80px;
}

textarea#prompt-input::placeholder, #genre-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.genre-section {
    width: calc(100% - 2rem);
    margin: 1rem auto 0;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 195, 255, 0.4);
}

.genre-tags {
    margin: 1rem auto 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    padding: 0 1rem;
}

.genre-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.genre-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 195, 255, 0.4);
}

.options-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch input {
    display: none;
}

.toggle-switch .slider {
    position: relative;
    cursor: pointer;
    width: 60px;
    height: 30px;
    background-color: rgba(0,0,0,0.3);
    border-radius: 15px;
    transition: background-color 0.3s;
    border: 1px solid var(--glass-border);
}

.toggle-switch .slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.toggle-switch input:checked + .slider {
    background-color: var(--frutiger-green);
    box-shadow: 0 0 10px var(--frutiger-green);
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(30px);
}

.toggle-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    text-shadow: 0 0 5px var(--text-glow), 0 0 2px white;
    font-weight: 700;
}

button#generate-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 8px rgba(255,255,255,0.7);
    background: linear-gradient(145deg, var(--frutiger-blue), #005f9c);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 18px 36px;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 195, 255, 0.5), inset 0 0 10px rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: neon-glow-button 4s ease-in-out infinite alternate;
}

button#generate-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 195, 255, 0.8), inset 0 0 14px rgba(255,255,255,0.4), 0 0 20px var(--neon-edge);
}

button#generate-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 195, 255, 0.4), inset 0 0 8px rgba(255,255,255,0.2);
    animation: none;
}

.hidden {
    display: none !important;
}

/* Progress Bar */
.progress-container {
    width: 90%;
    height: 30px;
    background-color: rgba(0,0,0,0.3);
    border-radius: 15px;
    margin: 1.5rem auto 0;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
}

#progress-bar-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--frutiger-green), var(--frutiger-blue));
    border-radius: 15px;
    transition: width 0.5s ease-in-out;
    box-shadow: 0 0 10px var(--frutiger-green), 0 0 20px var(--frutiger-blue), inset 0 0 5px rgba(255,255,255,0.3);
}

#progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    white-space: nowrap;
    font-weight: 700;
}

/* Player Styles */
#results-panel h2 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    margin-top: 0;
}

.player {
    display: flex;
    gap: 1.5rem;
    text-align: left;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(0,0,0,0.1);
    padding: 1.5rem;
    border-radius: 15px;
}

.album-art {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

.album-art img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border: 2px solid var(--glass-border);
}

.song-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.song-details h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.75rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    text-shadow: 0 0 5px var(--text-glow);
}

.song-details p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.control-btn:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.4);
}

.control-btn svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

/* Waveform */
.waveform {
    display: flex;
    align-items: center;
    height: 50px;
    gap: 3px;
}

.wave {
    width: 4px;
    height: 5px;
    background: var(--frutiger-green);
    border-radius: 2px;
}

.playing .wave {
    animation: wave-dance 1.5s infinite ease-in-out;
}

.wave:nth-child(2) { animation-delay: 0.2s; }
.wave:nth-child(3) { animation-delay: 0.4s; }
.wave:nth-child(4) { animation-delay: 0.6s; }
.wave:nth-child(5) { animation-delay: 0.8s; }
.wave:nth-child(6) { animation-delay: 1s; }
.wave:nth-child(7) { animation-delay: 0.1s; }
.wave:nth-child(8) { animation-delay: 0.3s; }
.wave:nth-child(9) { animation-delay: 0.5s; }
.wave:nth-child(10) { animation-delay: 0.7s; }
.wave:nth-child(11) { animation-delay: 0.9s; }
.wave:nth-child(12) { animation-delay: 0.1s; }
.wave:nth-child(13) { animation-delay: 0.3s; }
.wave:nth-child(14) { animation-delay: 0.5s; }
.wave:nth-child(15) { animation-delay: 0.7s; }

@keyframes wave-dance {
    0%, 100% { height: 5px; }
    50% { height: 40px; }
}

.lyrics-section {
    margin-top: 2rem;
    text-align: left;
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
}

pre#lyrics-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Library Panel */
.library-panel {
    margin-top: 2rem;
}

.library-panel h2 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

#song-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.song-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    transition: background 0.3s, box-shadow 0.3s;
}

.song-item:hover {
    background: rgba(0,0,0,0.3);
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.2);
}

.song-item-art img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.song-item-details {
    flex-grow: 1;
}

.song-item-details h4 {
    margin: 0 0 4px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

.song-item-details p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.song-item-controls {
    display: flex;
    gap: 0.5rem;
}

.song-item-controls .control-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
}

.song-item-controls .delete-btn:hover {
    background: rgba(255, 80, 80, 0.5);
}

.song-item-controls .control-btn svg {
    width: 20px;
    height: 20px;
}

/* Loader animation */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #fff;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: none; /* Hidden by default */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

button#generate-btn.loading .loader {
    display: block;
}

button#generate-btn.loading .button-text {
    display: none;
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 900px) {
    .app-wrapper {
        flex-direction: column;
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    .app-wrapper {
        gap: 1rem;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
        padding-top: 5rem;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    .player {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1rem;
    }
    .audio-controls {
        justify-content: center;
    }
    .song-details {
        align-items: center;
    }
    .generator-panel, .results-panel {
        padding: 1.5rem;
    }
    .song-item {
        flex-direction: column;
        align-items: flex-start;
    }
}