/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

/* Header */
.main-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    background: #3498db;
    padding: 12px;
    border-radius: 8px;
    font-size: 24px;
}

.logo-text h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.logo-text p {
    font-size: 14px;
    opacity: 0.8;
}

.social-icons {
    display: flex;
    gap: 10px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon.facebook { background: #3b5998; }
.social-icon.twitter { background: #1da1f2; }
.social-icon.youtube { background: #ff0000; }

.social-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.admin-label {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
}

.admin-user {
    font-size: 12px;
    opacity: 0.7;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
}

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

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

/* Welcome Section */
.welcome-section {
    background: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.welcome-content h1 {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.3;
}

.brand {
    color: #3498db;
}

.welcome-subtitle {
    font-size: 18px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

/* Classes Grid */
.classes-grid {
    display: grid;
    gap: 40px;
}

.level-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.level-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.classes-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.class-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    color: white;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

/* Couleurs des classes */
.class-ps { background: #e74c3c; }
.class-ms { background: #3498db; }
.class-gs { background: #f39c12; }
.class-cp { background: #9b59b6; }
.class-ce1 { background: #1abc9c; }
.class-ce2 { background: #e67e22; }
.class-cm1 { background: #34495e; }
.class-cm2 { background: #27ae60; }
.class-cm2b { background: #e74c3c; }
.class-6eme { background: #8e44ad; }
.class-5eme { background: #2980b9; }
.class-4eme { background: #16a085; }
.class-3eme { background: #d35400; }
.class-2nde { background: #c0392b; }
.class-1ere { background: #2c3e50; }
.class-terminale { background: #27ae60; }

.class-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    filter: brightness(1.1);
}

/* Admin Access */
.admin-access {
    text-align: center;
    margin-top: 40px;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #34495e;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background: #2c3e50;
    transform: translateY(-2px);
}

/* Login Forms */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.readonly-input {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
}

.form-help {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

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

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-outline {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #7f8c8d;
    text-decoration: none;
    font-size: 14px;
    margin-top: 20px;
}

.back-link:hover {
    color: #3498db;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
}

/* Help Section */
.help-section {
    margin-top: 40px;
}

.help-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.help-card h3,
.help-card h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-card ul {
    list-style: none;
    padding-left: 0;
}

.help-card li {
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
    position: relative;
    padding-left: 20px;
}

.help-card li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

.help-card li:last-child {
    border-bottom: none;
}

/* Admin Dashboard */
.admin-dashboard {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-header h2 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 32px;
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-content p {
    font-size: 14px;
    opacity: 0.9;
}

.videos-section h3 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.table-responsive {
    overflow-x: auto;
}

.videos-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.videos-table th,
.videos-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.videos-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.videos-table tr:hover {
    background: #f8f9fa;
}

.class-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.video-link {
    color: #3498db;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.video-link:hover {
    color: #2980b9;
}

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

/* Admin Forms */
.admin-form-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.form-header h2 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Student Dashboard */
.student-dashboard {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.class-info h2 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.student-actions {
    display: flex;
    gap: 15px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.video-card {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-header {
    padding: 20px;
    background: white;
}

.video-header h4 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.video-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #7f8c8d;
}

.video-content {
    padding: 20px;
}

.video-thumbnail {
    text-align: center;
    padding: 40px;
    background: #ecf0f1;
    margin-bottom: 15px;
    border-radius: 8px;
}

.video-thumbnail i {
    font-size: 48px;
    color: #3498db;
}

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

.video-footer {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #ecf0f1;
}

.text-muted {
    color: #7f8c8d !important;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #3498db;
}

.footer-section p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: #34495e;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #3498db;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    font-size: 14px;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .welcome-content h1 {
        font-size: 24px;
    }
    
    .classes-row {
        justify-content: center;
    }
    
    .class-btn {
        min-width: 100px;
        font-size: 12px;
        padding: 10px 16px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .video-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .admin-dashboard,
    .admin-form-container,
    .student-dashboard {
        padding: 20px;
    }
    
    .welcome-section {
        padding: 40px 20px;
    }
    
    .level-section {
        padding: 20px;
    }
}

