/* ========================================
   DOCUMENTS.CSS - Page moderne des documents
   ======================================== */

/* ===== SIMPLE HEADER ===== */
.documents-header-simple {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 2rem 0;
    text-align: center;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.header-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0;
}

/* ===== FILTERS TOGGLE ===== */
.filters-toggle-section {
    text-align: center;
    margin: 2rem 0;
}

.filters-toggle-section .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.filters-toggle-section .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ===== MAIN CONTAINER ===== */
.documents-container {
    padding: 4rem 0;
    max-width: 1400px;
}

/* ===== HEADER SECTION ===== */
.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    gap: 1.5rem;
}

.header-left {
    flex: 1;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0;
}

.header-actions {
    flex-shrink: 0;
}

/* ===== MODERN BUTTONS ===== */
.btn-action {
    padding: 0.5rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-action:hover::before {
    left: 100%;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-primary.btn-action {
    background: #2563eb;
    color: white;
}

.btn-primary.btn-action:hover {
    background: #1d4ed8;
}

.btn-outline-primary.btn-action {
    background: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.btn-outline-primary.btn-action:hover {
    background: #2563eb;
    color: white;
}

.btn-outline-secondary.btn-action {
    background: transparent;
    color: #64748b;
    border: 2px solid #cbd5e1;
}

.btn-outline-secondary.btn-action:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* ===== FILTERS SECTION ===== */
.filters-section {
    margin-bottom: 3rem;
}

.filters-card {
    background: white;
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-input,
.modern-select {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.modern-input:focus,
.modern-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-group.focused .filter-label {
    color: #2563eb;
}

.filters-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* ===== ACTIVE FILTERS ===== */
.active-filters {
    background: #2563eb;
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.results-count {
    font-weight: 600;
    font-size: 1.1rem;
}

/* ===== DOCUMENTS GRID ===== */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

/* Documents grid configurable (utilise les paramètres du site) - maintenant par défaut 2 par ligne */
.documents-grid-configurable {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Documents grid pour les pages catégories et tags (2 par ligne) */
.documents-grid-category {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Responsive pour mobile - 1 carte par ligne sur petits écrans */
@media (max-width: 768px) {
    .documents-grid,
    .documents-grid-configurable,
    .documents-grid-category {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
}

.document-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
}

.document-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #2563eb;
}

.card-header-modern {
    background: #f8fafc;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.file-type-icon {
    font-size: 2rem;
    color: #2563eb;
}

.file-type-icon .fa-file-pdf { color: #dc2626; }
.file-type-icon .fa-file-word { color: #2563eb; }
.file-type-icon .fa-file-excel { color: #16a34a; }
.file-type-icon .fa-file-powerpoint { color: #ea580c; }
.file-type-icon .fa-file-image { color: #7c3aed; }

.access-badge .badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-public {
    background: #10b981;
    color: white;
}

.badge-student {
    background: #2563eb;
    color: white;
}

.badge-teacher {
    background: #f59e0b;
    color: #1e293b;
}

.card-body-modern {
    padding: 1.5rem;
}

.document-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.document-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.document-title a:hover {
    color: #2563eb;
}

.document-description {
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.document-meta {
    margin-bottom: 1.5rem;
}

.meta-item {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.meta-item a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.meta-item a:hover {
    text-decoration: underline;
}

.document-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.tag-modern {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.tag-modern:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.tag-more {
    background: #e2e8f0;
    color: #64748b;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-style: italic;
}

.document-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #64748b;
    font-size: 0.9rem;
}

.stat i {
    color: #2563eb;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ===== PAGINATION MODERNE ===== */
.pagination-modern {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
}

.pagination-list {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.pagination-item {
    margin: 0;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    background: white;
    color: #64748b;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination-link:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.pagination-item.active .pagination-link {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* ===== NO RESULTS STATE ===== */
.no-results {
    text-align: center;
    padding: 6rem 0;
}

.no-results-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.no-results-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 1rem;
}

.no-results-description {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 3rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.no-results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .documents-grid-category {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .documents-grid-configurable {
        grid-template-columns: repeat(calc(var(--docs-per-row) - 1), 1fr) !important;
    }
}

@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .documents-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .filters-actions {
        justify-content: stretch;
    }
    
    .filters-actions .btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .documents-header-simple {
        padding: 1.5rem 0;
    }
    
    .header-title {
        font-size: 2rem;
    }
    
    .header-subtitle {
        font-size: 1rem;
    }
    
    .documents-container {
        padding: 2rem 0;
    }
    
    .filters-toggle-section {
        margin: 1.5rem 0;
    }
    
    .filters-toggle-section .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .filters-card {
        padding: 1.5rem;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .documents-grid-category {
        grid-template-columns: 1fr !important;
    }
    
    .documents-grid-configurable {
        grid-template-columns: 1fr !important;
    }
    
    .active-filters {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 1rem;
    }
    
    .filters-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filters-actions .btn {
        width: 100%;
    }
    
    .no-results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .no-results-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .filters-card {
        padding: 1rem;
    }
    
    .card-header-modern,
    .card-body-modern {
        padding: 1rem;
    }
    
    .document-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}
