@font-face {
    font-family: 'eurostile';
    src: url(/asset/font/eurostile.TTF);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --gradient-start: #00c6ff;
    --gradient-end: #0072ff;
    --gradient-light: rgba(0, 198, 255, 0.2);
    --gradient-medium: rgba(0, 114, 255, 0.3);
    --gradient-dark: rgba(0, 114, 255, 0.5);
    --border-color: rgba(0, 114, 255, 0.3);
    --border-color-hover: rgba(0, 114, 255, 0.5);
    /* Style iOS noir transparent */
    --black-bg: rgba(0, 0, 0, 0.4);
    --black-bg-hover: rgba(0, 0, 0, 0.55);
    --black-bg-item: rgba(0, 0, 0, 0.25);
    --black-bg-item-hover: rgba(0, 0, 0, 0.35);
    --ios-border: rgba(0, 114, 255, 0.25);
}

body {
    background: #0a0a0a;
    font-family: 'Eurostile';
    color: white;
    min-height: 100vh;
}

/* ========== ESPACE POUR VOTRE NAVBAR ========== */
#navbar-placeholder {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ========== CONTAINER PRINCIPAL ========== */
.player-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

/* ========== PLAYER CARD (NOIR TRANSPARENT) ========== */
.player-card {
    background: var(--black-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 32px;
    border: 1px solid var(--ios-border);
    position: sticky;
    top: 100px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.player-card:hover {
    background: var(--black-bg-hover);
    border-color: var(--border-color-hover);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* Cover dynamique */
.cover-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 24px;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cover-container:hover .cover-image {
    transform: scale(1.05);
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--gradient-light) 0%, rgba(0, 114, 255, 0) 100%);
    pointer-events: none;
}

/* Track info */
.track-info {
    text-align: center;
    margin-bottom: 24px;
}

.track-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.artist-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Time display */
.time-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Progress bar */
.progress-container {
    width: 100%;
    margin-bottom: 32px;
}

.progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 5px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: var(--gradient-start);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 114, 255, 0.8);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 198, 255, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #00c6ff;
    font-size: 18px;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(0, 198, 255, 0.6);
    transform: scale(1.05);
}

.ctrl-btn:active {
    transform: scale(0.95);
}

.ctrl-btn.play-pause {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 198, 255, 0.3);
    width: 70px;
    height: 70px;
    border-radius: 20px;
    font-size: 28px;
    box-shadow: none;
}

.ctrl-btn.play-pause:hover {
    box-shadow: 0 6px 20px rgba(0, 198, 255, 0.6);
    transform: translateY(-2px);
}

.ctrl-btn.play-pause:active {
    transform: translateY(0);
}

/* Padding pour desktop avec footer fixe */
@media (min-width: 769px) {
    body {
        padding-bottom: 130px;
    }
}

/* Mobile - padding pour la barre fixe du bas */
@media (max-width: 768px) {
    body {
        padding-bottom: 100px;
    }
}

/* Volume control */
.volume-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.volume-icon {
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
}

input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gradient-start);
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ========== PLAYLIST (NOIR TRANSPARENT) ========== */
.playlist-section {
    background: var(--black-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 24px;
    border: 1px solid var(--ios-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.playlist-section:hover {
    background: var(--black-bg-hover);
    border-color: var(--border-color-hover);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 114, 255, 0.25);
}

.playlist-header h2 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.track-count {
    font-size: 0.7rem;
    color: rgba(0, 114, 255, 0.7);
}

.playlist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: none;
    overflow-y: visible;
    padding-right: 8px;
}

.playlist::-webkit-scrollbar {
    width: 4px;
}

.playlist::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.playlist::-webkit-scrollbar-thumb {
    background: rgba(0, 114, 255, 0.5);
    border-radius: 4px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--black-bg-item);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.playlist-item:hover {
    background: var(--black-bg-item-hover);
    transform: translateX(4px);
    border-color: rgba(0, 114, 255, 0.15);
}

.playlist-item:active {
    transform: scale(0.98);
}

.playlist-item.active {
    background: rgba(0, 114, 255, 0.15);
    border-color: rgba(0, 114, 255, 0.3);
}

/* Mini cover dans la playlist */
.playlist-cover {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(0, 114, 255, 0.2);
}

.playlist-info {
    flex: 1;
}

.playlist-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.9);
}

.playlist-item.active .playlist-title {
    color: var(--gradient-start);
}

.playlist-artist {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.playlist-duration {
    font-size: 0.75rem;
    color: rgba(0, 114, 255, 0.6);
    margin-right: 12px;
}

/* Indicateur de lecture */
.playing-indicator {
    width: 24px;
    display: flex;
    justify-content: center;
}

.wave {
    display: none;
    gap: 2px;
    align-items: center;
    height: 16px;
}

.playlist-item.active .wave {
    display: flex;
}

.wave span {
    width: 3px;
    height: 100%;
    background: var(--gradient-start);
    border-radius: 2px;
    animation: wave 0.8s ease infinite alternate;
}

.wave span:nth-child(2) { animation-delay: 0.2s; }
.wave span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wave {
    0% { height: 4px; }
    100% { height: 16px; }
}

/* ========== BOUTONS SHUFFLE & REPEAT ========== */
#shuffleBtn, #repeatBtn {
    opacity: 1;
    transition: all 0.2s ease;
}

#shuffleBtn:hover, #repeatBtn:hover {
    opacity: 1;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-card, .playlist-section {
    animation: fadeInUp 0.5s ease-out;
}

/* ========== RESPONSIVE DESKTOP FIRST ========== */

/* Tablette */
@media (max-width: 1024px) {
    .player-container {
        grid-template-columns: 1fr 350px;
        gap: 30px;
        padding: 30px 20px;
    }
    
    .player-card {
        padding: 24px;
    }
    
    .track-title {
        font-size: 1.3rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .player-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px 16px 120px 16px;
    }
    
    .player-card {
        position: relative;
        top: 0;
        padding: 24px 20px;
    }
    
    .cover-container {
        max-width: 200px;
    }
    
    .track-title {
        font-size: 1.2rem;
    }
    
    .controls {
        gap: 16px;
    }
    
    .ctrl-btn {
        width: 44px;
        height: 44px;
    }
    
    .ctrl-btn.play-pause {
        width: 56px;
        height: 56px;
    }
    
    .playlist-section {
        padding: 20px;
    }
    
    .playlist {
        max-height: none;
        overflow-y: visible;
    }
    
    .playlist-cover {
        width: 40px;
        height: 40px;
    }
    
    .playlist-title {
        font-size: 0.85rem;
    }
}

/* Petit mobile */
@media (max-width: 480px) {
    .player-container {
        padding: 16px 16px 120px 16px;
    }
    
    .player-card {
        padding: 20px 16px;
    }
    
    .cover-container {
        max-width: 180px;
    }
    
    .ctrl-btn {
        width: 40px;
        height: 40px;
    }
    
    .ctrl-btn.play-pause {
        width: 52px;
        height: 52px;
    }
    
    .controls {
        gap: 12px;
    }
    
    .playlist-item {
        padding: 10px 12px;
    }
    
    .playlist {
        max-height: none;
        overflow-y: visible;
    }
    
    .playlist-cover {
        width: 36px;
        height: 36px;
    }
}

/* Support pour les appareils avec notch */
@supports (padding: max(0px)) {
    .player-container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    #navbar-placeholder {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Support pour les navigateurs sans backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .player-card, .playlist-section {
        background: rgba(0, 0, 0, 0.7);
    }
}