:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a3a, #0d1b2a);
    color: var(--light-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.player-container {
    width: 100%;
    max-width: 900px;
    background: rgba(30, 40, 50, 0.9);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    transition: var(--transition);
}

.player-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.home-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.video-title {
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 10px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 5;
    pointer-events: none;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

.custom-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changé de 'cover' à 'contain' pour éviter le cropping */
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
    display: none;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.controls {
    background: rgba(20, 30, 40, 0.9);
    padding: 15px;
    transition: var(--transition);
    opacity: 1; /* Changé pour être visible par défaut */
}

.progress-area {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 15px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-area:hover .progress-bar::after {
    opacity: 1;
}

.controls-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.play-btn {
    background: var(--primary-color);
}

.play-btn:hover {
    background: var(--secondary-color);
}

.volume-slider {
    width: 80px; /* Remplacé 0 par 80px */
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    outline: none;
    opacity: 0.7; /* Remplacé 0 par 0.7 pour être légèrement visible */
    transition: all 0.3s ease;
    cursor: pointer;
}

.volume-area:hover .volume-slider {
    opacity: 1; /* Devient complètement visible au survol */
    width: 100px; /* S'agrandit légèrement au survol */
}

/* Style pour le thumb Webkit (Chrome, Safari, Edge) */
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--primary-color);
}

.volume-slider::-webkit-slider-thumb:hover {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* Style pour le thumb Firefox */
.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--primary-color);
    transition: var(--transition);
}

.volume-slider::-moz-range-thumb:hover {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* Style pour la track Firefox */
.volume-slider::-moz-range-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 4px;
    border: none;
}

/* Style pour la track Webkit */
.volume-slider::-webkit-slider-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 4px;
    border: none;
}

.time {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    min-width: 100px;
    text-align: center;
}

.speed-btn, .fullscreen {
    font-weight: 600;
}

.fullscreen:hover {
    color: var(--primary-color);
}

/* Animation pour l'affichage du titre uniquement */
.player-container:hover .video-title {
    opacity: 1;
}

/* Style pour le mode plein écran */
.player-container:fullscreen {
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-width: none;
    background: #000;
}

.player-container:fullscreen .video-wrapper {
    height: 100%;
    padding-top: 0;
}

.player-container:fullscreen .custom-video {
    object-fit: contain;
}

.player-container:fullscreen .controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.player-container:fullscreen .video-title {
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    padding: 20px;
    font-size: 1.5rem;
}

/* États de focus pour l'accessibilité */
.control-btn:focus,
.home-btn:focus,
.volume-slider:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .player-container {
        border-radius: 15px;
    }
    
    .controls-bottom {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls-left, .controls-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .volume-area:hover .volume-slider {
        width: 60px;
    }
    
    .video-title {
        font-size: 1rem;
        padding: 8px 15px;
    }
    
    .time {
        min-width: 80px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .controls {
        padding: 10px;
    }
    
    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .volume-area:hover .volume-slider {
        width: 50px;
    }
    
    .home-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}