/* Styles globaux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Page de bienvenue */
.welcome-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.welcome-content {
    text-align: center;
    background: white;
    padding: 60px 40px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    animation: fadeIn 0.6s ease-out;
}

.welcome-content h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 28px;
}

.welcome-text {
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
    line-height: 1.6;
}

.vip-btn {
    padding: 15px 40px;
    background: linear-gradient(to right, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.vip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.vip-btn:active {
    transform: translateY(0);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page de connexion */
.password-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.password-container h1 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.password-container p {
    margin-bottom: 20px;
    color: #666;
}

#passwordForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#passwordForm input[type="password"] {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#passwordForm input[type="password"]:focus {
    outline: none;
    border-color: #3498db;
}

#passwordForm button {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#passwordForm button:hover {
    background-color: #2980b9;
}

.error {
    color: #e74c3c;
    margin-top: 10px;
    font-weight: bold;
}

/* Page vidéos */
header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 24px;
}

.logout-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #c0392b;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}



/* Video grid */
.videos-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

#videoGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.video-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #000;
    cursor: pointer;
}

.video-info {
    padding: 15px;
}

.video-info p {
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-info .video-meta {
    color: #888;
    font-size: 12px;
    margin-bottom: 10px;
}

.video-actions {
    display: flex;
    gap: 10px;
}

.btn-download {
    display: inline-block;
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-download:hover {
    background-color: #2980b9;
}

.no-videos {
    text-align: center;
    color: #666;
    padding: 40px;
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 768px) {
    #uploadForm {
        flex-direction: column;
    }
    
    #uploadForm input[type="file"],
    #uploadForm button {
        width: 100%;
    }
    
    #videoGrid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 480px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    #videoGrid {
        grid-template-columns: 1fr;
    }
}

/* Animation pour les vidéos en cours de chargement */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Style pour les vidéos en cours de lecture */
.video-thumbnail:active,
.video-thumbnail:focus {
    outline: 3px solid #3498db;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    text-align: center;
    position: relative;
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content input[type="password"] {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.modal-content input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.modal-content button {
    padding: 12px 20px;
    background: linear-gradient(to right, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}