/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /* overflow: auto; */
    background-color: rgba(0,0,0,0.6);
    /* backdrop-filter: blur(5px); */
    padding-bottom: 50px;

}

.modal-content {
    background: #fff;
    margin: 2% auto;
    padding: 25px;
    width: 90%;
    max-width: 1200px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    max-height: 90%;
    overflow: auto
}

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

.close-popup {
    position: absolute;
    right: 25px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-popup:hover {
    color: #555;
}

.modal .teacher-name {
    color: #2c3e50;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
    font-size: 26px;
    text-align: center;
    font-weight: 600;
}

/* Students Table Styles */
.students-table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    background: white;
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.students-table th,
.students-table td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.students-table tr {
    height: 40px;
    transition: background-color 0.2s;
}

.students-table tbody tr:hover {
    background-color: #f5f5f5;
}

.students-table th {
    background-color: #2c3e50;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.students-table th:first-child {
    border-top-left-radius: 8px;
}

.students-table th:last-child {
    border-top-right-radius: 8px;
}

.students-table tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.students-table tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.students-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.students-table td {
    color: #333;
    font-size: 0.95em;
    transition: background-color 0.2s;
    padding: 5px 20px;
}

.students-table .no-students,
.students-table .error-message {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
}

.students-table .error-message {
    color: #dc3545;
    background: #fff3f3;
}

/* .students-table td:last-child {
    white-space: nowrap;
    text-align: center;
} */

.students-table .edit-user,
.students-table .delete-user {
    cursor: pointer;
    padding: 8px;
    margin: 0 5px;
    transition: all 0.2s ease;
    display: inline-block;
    border-radius: 4px;
}

.students-table .edit-user:hover {
    background-color: #e3f2fd;
    transform: scale(1.1);
}

.students-table .delete-user:hover {
    background-color: #ffebee;
    transform: scale(1.1);
}

.student-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-btn {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Filter styles */
.filter-container {
    margin-bottom: 20px;
    padding: 0 10px;
}

.student-filter {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    background-color: white;
    cursor: pointer;
}

.student-filter:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,.25);
}

/* Teacher Card Styles */
.teachers-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px;
    width: 100%;
}

.teacher-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
    cursor: pointer;
}

.card-image img {
    width: 100%;
    height: 140%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card-image:hover img {
    transform: scale(1.05);
}

.card-image::after {
    content: 'Accés aux étudiants';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.card-image:hover::after {
    transform: translateY(0);
}

.card-info {
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4em;
}

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

.card-actions span {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.card-actions span:hover {
    transform: scale(1.2);
}

/* Stats Grid Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 2.5em;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.student-stats .stat-icon {
    background: #e3f2fd;
    color: #1976d2;
}

.course-stats .stat-icon {
    background: #f3e5f5;
    color: #7b1fa2;
}

.revenue-stats .stat-icon {
    background: #e8f5e9;
    color: #388e3c;
}

.stat-content {
    flex: 1;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

.stat-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.stat-value.positive-stat {
    color: #388e3c;
}

.stat-value.negative-stat {
    color: #d32f2f;
}

@keyframes countUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.stat-value {
    animation: countUp 0.5s ease-out forwards;
}

@media screen and (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        font-size: 2em;
        width: 50px;
        height: 50px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }

    .students-table th,
    .students-table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .teachers-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .students-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}















/* ====================== cards ============== */


  .cards-filter-container {
    width: 100%;
        background-color: #ffffff;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 20px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .cards-filter-container h3 {
        margin-top: 0;
        margin-bottom: 15px;
        color: #333;
    }
    
    .cards-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .filter-group {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 200px;
    }
    
    .filter-group label {
        margin-bottom: 5px;
        font-weight: 500;
        font-size: 14px;
    }
    
    .card-filter {
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
    }
    
    .reset-filters-btn {
        background-color: #0b8876;
        color: white;
        border: none;
        padding: 8px 15px;
        border-radius: 4px;
        cursor: pointer;
        align-self: flex-end;
        margin-top: 24px;
    }
    
    .reset-filters-btn:hover {
        background-color: #076d5e;
    }
    
    .filter-stats {
        font-size: 14px;
        color: #666;
    }
    
    .no-cards-message {
        padding: 20px;
        text-align: center;
        background-color: #f8f9fa;
        border-radius: 8px;
        margin: 20px 0;
        color: #666;
    }
    
    @media (max-width: 768px) {
        .cards-filters {
            flex-direction: column;
        }
        
        .filter-group {
            width: 100%;
        }
        
        .reset-filters-btn {
            width: 100%;
            margin-top: 10px;
        }
    }