/* css/style.css */
:root {
    --color-primary: #6c63ff;
    --black: #000;
    --ash-black: #222;
    --white: #fafafa;
    --sky: #0cf;
    --green: #2dd;
    --blue: #1300ff;
    --dusk: #60f;
    --purple: #90f;
    --pink: #f06;
    --red: #fe0222;
    --orange: #fd7702;
    --yellow: #fb0;
    --background: var(--black);
    --accent: #6f67ff;
    
    /* Docusaurus derived vars for consistency */
    --ifm-color-primary: #6c63ff;
    --ifm-color-primary-dark: #5548e6;
    --ifm-color-primary-darker: #4a3fd9;
    --ifm-color-primary-darkest: #3d34b3;
    --ifm-color-primary-light: #8078ff;
    --ifm-color-primary-lighter: #9d97ff;
    --ifm-color-primary-lightest: #b8b3ff;
    --ifm-font-color-base: #2b333e;
    --ifm-background-color: #fafbfc;
    --ifm-card-background-color: #fff;
    --ifm-global-radius: 0.4rem;
    --ifm-transition-fast: 200ms;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--ifm-background-color);
    color: var(--ifm-font-color-base);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden; /* Prevent body scroll, handle in containers */
}

/* Loading Styles (From Prompt) */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ifm-background-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
}

.loading-spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--ifm-color-primary);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loading-spinner-ring:nth-child(2) {
    border-top-color: var(--ifm-color-primary-light);
    animation-delay: -0.3s;
}

.loading-spinner-ring:nth-child(3) {
    border-top-color: var(--ifm-color-primary-lighter);
    animation-delay: -0.15s;
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--ifm-color-primary);
    animation: pulse-opacity 1.5s ease-in-out infinite;
}

@keyframes spin { to { transform: rotate(1turn); } }
@keyframes pulse-opacity { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ifm-color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Search Bar */
.search-box {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 500px;
}

.input-group {
    position: relative;
    flex: 1;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: var(--ifm-global-radius);
    outline: none;
    transition: border-color var(--ifm-transition-fast);
}

.input-group input:focus {
    border-color: var(--ifm-color-primary);
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    width: 18px;
    height: 18px;
}

.btn {
    padding: 0.75rem 1.5rem;
    background: var(--ifm-color-primary);
    color: white;
    border: none;
    border-radius: var(--ifm-global-radius);
    cursor: pointer;
    font-weight: 500;
    transition: background var(--ifm-transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: var(--ifm-color-primary-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--ifm-color-primary);
    border: 1px solid var(--ifm-color-primary);
}

.btn-secondary:hover {
    background: rgba(108, 99, 255, 0.1);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Song List */
.song-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.song-card {
    background: var(--ifm-card-background-color);
    border-radius: var(--ifm-global-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--ifm-transition-fast), box-shadow var(--ifm-transition-fast);
}

.song-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(108, 99, 255, 0.15);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.song-card:hover .card-img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--ifm-transition-fast);
}

.song-card:hover .play-overlay {
    opacity: 1;
}

.card-info {
    padding: 1rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-artist {
    font-size: 0.875rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Player Page Specifics */
.player-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 2rem;
}

.player-main {
    flex: 1;
    display: flex;
    gap: 2rem;
    overflow: hidden;
}

.cover-section {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.album-art {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    object-fit: cover;
    animation: rotate 20s linear infinite;
    animation-play-state: paused;
}

.album-art.playing {
    animation-play-state: running;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.lyrics-section {
    flex: 1;
    background: rgba(255,255,255,0.5);
    border-radius: var(--ifm-global-radius);
    padding: 2rem;
    overflow-y: auto;
    text-align: center;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

.lyric-line {
    padding: 0.5rem 0;
    color: #999;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.lyric-line.active {
    color: var(--ifm-color-primary);
    font-size: 1.25rem;
    font-weight: 600;
    transform: scale(1.05);
}

.controls-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--ifm-global-radius);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 4rem;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.progress-bar-wrapper {
    flex: 1;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--ifm-color-primary);
    border-radius: 3px;
    width: 0%;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -3px;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--ifm-color-primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar-wrapper:hover .progress-bar-fill::after {
    opacity: 1;
}

.control-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    transition: color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: var(--ifm-color-primary);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.main-play {
    width: 50px;
    height: 50px;
    background: var(--ifm-color-primary);
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(108, 99, 255, 0.3);
}

.control-btn.main-play:hover {
    background: var(--ifm-color-primary-dark);
    color: white;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: absolute;
    right: 2rem;
    bottom: 2rem;
}

.volume-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    background: #eee;
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--ifm-color-primary);
    border-radius: 50%;
    cursor: pointer;
}

/* Visualizer Canvas */
#visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .player-main {
        flex-direction: column;
    }
    .cover-section {
        flex: 0 0 auto;
    }
    .album-art {
        width: 200px;
        height: 200px;
    }
    .volume-container {
        /* position: static; */
        justify-content: center;
        margin-top: 1rem;
    }
}