* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    overflow: hidden;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a2e;
    height: 100%;
    overflow: auto;
    padding-bottom: clamp(80px, 15vh, 140px);
    position: relative;
    overflow-x: hidden;
}

#audioVisualizer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(10px, 2vw, 20px);
}

header {
    padding: clamp(15px, 2vw, 20px);
    margin-bottom: clamp(15px, 3vw, 30px);
}

nav {
    display: flex;
    gap: clamp(3px, 1vw, 20px);
    align-items: center;
    flex-wrap: nowrap;
    overflow: hidden;
}

.logo {
    font-size: clamp(16px, 2.5vw, 24px);
    font-weight: bold;
    color: white;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: clamp(5px, 1vw, 10px);
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}

.nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: clamp(12px, 1.5vw, 16px);
    cursor: pointer;
    padding: clamp(6px, 1vw, 10px) clamp(8px, 1.5vw, 20px);
    border-radius: clamp(6px, 1vw, 8px);
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 8px);
    white-space: nowrap;
    flex-shrink: 1;
    flex-grow: 1;
    min-width: 0;
    justify-content: center;
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
}

/* Cache le texte des boutons sur petits écrans */
@media (max-width: 768px) {
    .nav-btn span {
        display: none;
    }
}

.content {
    padding: clamp(15px, 3vw, 30px);
    color: white;
    min-height: 400px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.75s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: clamp(20px, 3vw, 30px);
}

.artist-detail-header,
.project-detail-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(15px, 3vw, 30px);
    margin-top: 20px;
    flex-wrap: wrap;
}

.artist-detail-cover,
.project-detail-cover {
    width: clamp(150px, 25vw, 256px);
    height: clamp(150px, 25vw, 256px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.artist-detail-cover .artist-cover-image,
.project-detail-cover .project-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-detail-text,
.project-detail-text {
    text-align: left;
    max-width: 100%;
}

.artist-detail-text h1,
.project-detail-text h1 {
    text-align: left;
    margin-bottom: 10px;
}

.artist-detail-text .subtitle,
.project-detail-text .subtitle {
    text-align: left;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .artist-detail-header,
    .project-detail-header {
        flex-direction: column;
        text-align: center;
    }

    .artist-detail-text,
    .project-detail-text {
        text-align: center;
    }

    .artist-detail-text h1,
    .project-detail-text h1,
    .artist-detail-text .subtitle,
    .project-detail-text .subtitle {
        text-align: center;
    }
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.track-list {
    display: grid;
    gap: clamp(10px, 1.5vw, 15px);
    margin-top: 20px;
}

.track-container {
    display: flex;
    align-items: center;
    gap: clamp(15px, 3vw, 30px);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.track-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    padding: clamp(8px, 1.5vw, 15px);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 15px);
    cursor: pointer;
    transition: all 0.3s;
    min-width: 0;
    overflow: hidden;
    max-width: 100%;
}

.track-cover {
    width: clamp(36px, 5vw, 50px);
    height: clamp(36px, 5vw, 50px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: white;
}

.track-cover .track-cover-image {
    min-width: 100%;
    object-fit: cover;
}

.track-item:hover {
    background: rgba(255, 255, 255, 0.2);
    padding-left: calc(clamp(8px, 1.5vw, 15px) + 0.25vw);
}

.track-item.playing {
    background: rgba(255, 255, 255, 0.25);
    padding-left: calc(clamp(8px, 1.5vw, 15px) + 0.5vw);
}

.track-id {
    opacity: 0.7;
    flex-shrink: 0;
    font-size: clamp(12px, 1.3vw, 14px);
    min-width: max-content;
}

.track-info {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.track-title {
    font-size: clamp(12px, 1.5vw, 16px);
    font-weight: 600;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.track-artist {
    font-size: clamp(10px, 1.3vw, 14px);
    opacity: 0.8;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.track-duration {
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    font-size: clamp(10px, 1.2vw, 14px);
    white-space: nowrap;
}

/* Artist Grid Styles */
.artist-grid,
.project-grid,
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: clamp(12px, 3vw, 30px);
    margin-top: 20px;
}

.artist-card,
.project-card {
    background: rgba(255, 255, 255, 0.1);
    padding: clamp(12px, 2.5vw, 25px);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(15px, 2vw, 20px);
    cursor: pointer;
    transition: all 0.3s;
    aspect-ratio: 1;
    perspective: 1200px;
}

.style-card {
    background: rgba(255, 255, 255, 0.1);
    padding: clamp(12px, 2.5vw, 25px);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(15px, 2vw, 20px);
    cursor: pointer;
    transition: all 0.3s;
}

.artist-card:hover,
.project-card:hover,
.style-card:hover {
    background: rgba(255, 255, 255, 0.2);
}

.artist-flip,
.project-flip {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(.4, .2, .2, 1);
}

.artist-card:hover .artist-flip,
.project-card:hover .project-flip {
    transform: rotateY(180deg);
}

.artist-face,
.project-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.artist-front,
.project-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.artist-front .artist-cover-image,
.project-front .project-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-back,
.project-back {
    transform: rotateY(180deg);
    padding: clamp(12px, 2vw, 20px);
    color: white;
    background: linear-gradient(135deg, rgba(118, 75, 162, .95), rgba(0, 0, 0, .85));
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    backdrop-filter: blur(6px);
}

.artist-back h3,
.project-back h3 {
    font-size: clamp(16px, 2vw, 22px);
    margin-bottom: 12px;
}

.artist-back p,
.project-back p {
    font-size: clamp(12px, 1.3vw, 14px);
    line-height: 1.6;
    opacity: 0.9;
}

.artist-cover,
.project-cover {
    width: 100%;
    max-width: 512px;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.artist-card:hover .artist-cover,
.project-card:hover .project-cover {
    transform: rotate3d(0, 1, 0, 0.5turn);
}

.artist-cover .artist-cover-image,
.project-cover .project-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-info,
.project-info,
.style-info {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.artist-name,
.project-name,
.style-name {
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 600;
    margin-bottom: 10px;
}

.artist-track-count,
.project-track-count,
.style-track-count {
    font-size: clamp(12px, 1.3vw, 14px);
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.style-icon {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: clamp(48px, 8vw, 64px);
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    padding: clamp(10px, 2vw, 20px);
    color: white;
    z-index: 100;
}

.player-content {
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: clamp(15px, 3vw, 30px);
    align-items: center;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-self: start;
    min-width: 0;
}

.album-art {
    width: clamp(50px, 6vw, 60px);
    height: clamp(50px, 6vw, 60px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.album-art .cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-art img,
.mobile-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.now-playing {
    flex: 1;
    min-width: 0;
    max-width: 250px;
}

.now-playing-title {
    font-size: clamp(14px, 1.5vw, 16px);
    font-weight: 600;
    margin-bottom: 5px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.now-playing-artist {
    font-size: clamp(12px, 1.3vw, 14px);
    opacity: 0.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.player-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-self: center;
    width: 100%;
    max-width: 1200px;
}

.control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.1s;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn-enabled {
    color: #764ba2;
}

.control-btn:active {
    transform: scale(0.9);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.play-btn {
    background: white;
    color: #764ba2;
    width: 50px;
    height: 50px;
}

.play-btn:hover {
    background: white;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.time {
    font-size: 12px;
    min-width: 40px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: white;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s;
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
}

.volume-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#volumeSlider {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    background: linear-gradient(to right,
            white 0%,
            white 100%,
            rgba(255, 255, 255, 0.2) 100%,
            rgba(255, 255, 255, 0.2) 100%);
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.download-link {
    width: clamp(32px, 4.5vw, 45px);
    height: clamp(32px, 4.5vw, 45px);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s, transform 0.2s;
}

.download-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

p {
    line-height: 1.8;
    margin-top: 20px;
}

h1 {
    margin-bottom: 10px;
    text-align: center;
    font-size: clamp(24px, 3vw, 32px);
}

.subtitle {
    opacity: 0.8;
    margin-bottom: 20px;
    text-align: center;
    font-size: clamp(14px, 1.5vw, 16px);
}

/* Mobile Player Popup */
.mobile-player-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 20px;
    transform: translateY(100%);
    opacity: 0;
    overflow: hidden;
}

.mobile-player-popup.active {
    display: flex;
    animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.mobile-player-popup.closing {
    animation: slideDownFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUpFade {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownFade {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.mobile-player-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.mobile-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-player-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    color: white;
}

.mobile-album-art {
    width: clamp(24px, 60vw, 280px);
    height: clamp(24px, 60vw, 280px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mobile-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-track-info {
    text-align: center;
    width: 100%;
    padding: 0 20px;
}

.mobile-track-title {
    font-size: clamp(20px, 5vw, 24px);
    font-weight: 700;
    margin-bottom: 10px;
}

.mobile-track-artist {
    font-size: clamp(16px, 4vw, 18px);
    opacity: 0.8;
}

.mobile-progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.mobile-volume-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.mobile-volume-container input[type="range"] {
    flex: 1;
    max-width: 200px;
}

/* Media queries uniquement pour le comportement mobile spécifique */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
    }

    .player {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .player-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .player-info {
        justify-self: start;
        width: 100%;
        cursor: pointer;
    }

    .player-controls,
    .volume-controls {
        display: none;
    }

    .now-playing {
        max-width: calc(100% - 70px);
    }
}