:root {
    --primary-color: #1DB954;
    --dark-color: #121212;
    --light-color: #f8f8f8;
    --accent-color: #FF6D00;
    --accent-dark: #E65100;
    --shadow-color: rgba(0,0,0,0.2);
    --card-bg: #282828;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--dark-color);
    color: var(--light-color);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 40px;
}

.logo h1 {
    font-size: 24px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-btn, .action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover, .action-btn:hover {
    background-color: #1ed760;
    transform: translateY(-2px);
}

.main-content {
    display: flex;
    margin-top: 30px;
    gap: 30px;
}

.sidebar {
    width: 30%;
    background-color: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 20px;
}

.sidebar h2 {
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--primary-color);
}

.sidebar-section {
    margin-bottom: 30px;
}

.analyzed-tracks {
    max-height: 500px;
    overflow-y: auto;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    background-color: var(--card-bg);
    transition: all 0.2s ease;
    cursor: pointer;
}

.track-item:hover {
    background-color: rgba(255,255,255,0.1);
}

.track-item.analyzed {
    border-left: 3px solid var(--primary-color);
}

.track-item.selected {
    background-color: rgba(29, 185, 84, 0.2);
    box-shadow: 0 0 10px rgba(29, 185, 84, 0.3);
}

.track-item img {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    margin-right: 15px;
}

.track-info {
    flex: 1;
}

.track-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.track-info p {
    font-size: 12px;
    color: #aaa;
}

.badge {
    background-color: var(--primary-color);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 20px;
}

.tracks-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.track-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.track-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.track-card.analyzed {
    border: 2px solid var(--primary-color);
}

.track-thumb {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
}

.track-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.track-card:hover .play-overlay {
    opacity: 1;
}

.play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
}

.play-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.track-details {
    padding: 15px;
}

.track-details h3 {
    font-size: 16px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-details p {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 20px;
}

.action-panel {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.action-btn {
    padding: 12px 30px;
    font-size: 16px;
}

.action-btn.analyze {
    background-color: var(--accent-color);
}

.action-btn.analyze:hover {
    background-color: var(--accent-dark);
}

.action-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: none;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    position: relative;
}

.tab.active {
    color: var(--primary-color);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

#notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: bottom 0.5s ease;
    z-index: 1000;
}

#notification.show {
    bottom: 30px;
}

.loading-overlay, .loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

.loading-overlay.active, .loading-screen.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-bar {
    margin-bottom: 20px;
    width: 100%;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    background-color: rgba(255,255,255,0.1);
    color: white;
    font-size: 16px;
}

.search-bar input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-bar input:focus {
    outline: none;
    background-color: rgba(255,255,255,0.15);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
}

/* Pour les écrans de connexion et de chargement */
.login-screen, .loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.login-screen.hidden, .loading-screen.hidden {
    display: none;
}

.login-container {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 90%;
    width: 400px;
}

.logo-large {
    font-size: 36px;
    margin-bottom: 20px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-description {
    margin-bottom: 30px;
    color: #aaa;
    line-height: 1.6;
}

.spotify-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 80%;
    margin: 0 auto;
}

.spotify-login-btn:hover {
    background-color: #1ed760;
    transform: translateY(-2px);
}

/* Style pour le bouton de démo */
.demo-btn {
    background-color: #333;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.demo-btn:hover {
    background-color: #555;
}

.spotify-logo {
    width: 24px;
    height: 24px;
}

.analysis-progress {
    display: none;
    margin-top: 30px;
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.2s ease;
    animation: progressPulse 2s infinite;
}

@keyframes progressPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.progress-text {
    font-size: 12px;
    color: #aaa;
    text-align: center;
}

/* Styles pour le jeu VR */
.a-enter-vr {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.vr-scene {
    width: 100%;
    height: 100vh;
}

.error-container {
    text-align: center;
    padding: 50px;
    max-width: 600px;
    margin: 0 auto;
}

.error-container h1 {
    color: var(--accent-color);
    margin-bottom: 20px;
}

.error-container p {
    margin-bottom: 30px;
    color: #aaa;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .tracks-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .action-panel {
        flex-direction: column;
    }
    .action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tracks-grid {
        grid-template-columns: 1fr;
    }
    .logo h1 {
        font-size: 18px;
    }
    .container {
        padding: 10px;
    }
}
