/* Container */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.page-title {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.page-subtitle {
    color: #6b7280;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Back Button */
.back-btn {
    display: inline-block;
    padding: 0.625rem 1rem;
    background-color: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.back-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Combined Stats and Categories Section */
.combined-stats-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    overflow: hidden;
}

/* Subsection Titles */
.subsection-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

/* Categories Subsection */
.categories-subsection {
    padding: 0.75rem 1rem;
}

.categories-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.category-badge-info {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.category-badge-info .count {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.loading-inline,
.no-categories-inline {
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
}

/* Filters Section */
.filters-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}

.filters-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #1a1a1a;
    font-weight: 600;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.search-row {
    grid-template-columns: 1fr;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.8125rem;
}

.filter-input,
.search-box {
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 0.875rem;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all 0.2s;
}

.filter-input:focus,
.search-box:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1);
}

/* Filter Actions (Boutons) */
.filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-search {
    background: #007bff;
    color: #fff;
    border: 1px solid #007bff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-search:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-clear {
    background: #dc3545;
    color: #fff;
    border: 1px solid #dc3545;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    transform: translateY(-1px);
}

/* Active Filters Display */
.active-filters-display {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filters-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    margin-right: 0.25rem;
}

.active-filter-tag {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    color: #004085;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.active-filter-tag strong {
    font-weight: 600;
}

/* Results Badge */
.results-badge {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
}

/* Publications Section */
.publications-section {
    margin-bottom: 4rem;
}

.publications-section h3 {
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 1.5rem;
}

.publications-grid {
    display: grid;
    gap: 1.5rem;
}

/* Publication Card */
.publication-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.publication-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.publication-card.featured {
    border-left: 4px solid #007bff;
}

/* Publication Header */
.publication-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.publication-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    flex: 1;
    letter-spacing: -0.01em;
}

.publication-category {
    background: #007bff;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.featured-badge {
    background: #ffc107;
    color: #212529;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Publication Details */
.publication-authors {
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

.publication-meta {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.publication-abstract {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-style: italic;
    font-size: 0.9375rem;
}

/* Keywords */
.publication-keywords {
    margin-bottom: 1rem;
}

.keywords-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-tag {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Publication Actions */
.publication-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.actions-left {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn-download {
    background: #28a745;
    color: #fff;
    border: 1px solid #28a745;
}

.btn-download:hover {
    background: #1e7e34;
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

.btn-download:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.download-stats {
    color: #6b7280;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Eye Icon for Views */
.stat-with-icon {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.eye-icon {
    color: #6b7280;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.9375rem;
    font-weight: 500;
    min-width: 250px;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: #28a745;
    color: #fff;
    border: 1px solid #28a745;
}

.toast-error {
    background: #dc3545;
    color: #fff;
    border: 1px solid #dc3545;
}

/* Loading & No Data */
.loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.no-publications {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 4rem;
}

/* ===================================
   RESPONSIVE
   =================================== */

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .page-header {
        padding: 1.5rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-subtitle,
    .stat-label {
        font-size: 1rem;
    }

    .filters-section {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .filters-title {
        font-size: 1rem;
    }

    .combined-stats-section {
        margin-bottom: 1.5rem;
    }

    .categories-subsection {
        padding: 1rem;
    }

    .subsection-title {
        font-size: 0.85rem;
        margin-bottom: 0.625rem;
    }

    .category-badge-info {
        font-size: 0.7rem;
        font-weight: 600;
        padding: 0.4rem 0.75rem;
    }

    .category-badge-info .count {
        font-size: 0.7rem;
        font-weight: 700;
        padding: 0.15rem 0.4rem;
    }

    /* 2 colonnes sur tablet */
    .filters-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-label {
        font-size: 0.875rem;
        margin-bottom: 0.4rem;
    }

    .filter-input {
        padding: 0.75rem 0.875rem;
        font-size: 0.9375rem;
    }

    .filter-actions {
        flex-direction: column;
    }

    .btn-search,
    .btn-clear {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .active-filters-display {
        width: 100%;
        justify-content: flex-start;
    }

    .active-filter-tag {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }

    .filters-label {
        font-size: 0.8125rem;
    }

    .publication-card {
        padding: 1.25rem;
    }

    .publications-section {
        margin-bottom: 3rem;
    }

    .publication-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .publication-category {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .publication-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .actions-left {
        justify-content: center;
    }

    .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .download-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        padding: 1.25rem;
        gap: 0.8rem;
    }

    .stat-item {
        padding: 0.8rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    #toast-container {
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .page-header {
        padding: 1rem;
        margin-bottom: 2rem;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .filters-section,
    .publication-card {
        padding: 1rem;
    }

    .filters-title {
        font-size: 0.875rem;
        margin-bottom: 0.625rem;
    }

    /* 2 filtres par ligne sur mobile */
    .filters-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-bottom: 0.625rem;
    }

    .filter-label {
        font-size: 0.7rem;
    }

    .filter-input {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
        min-height: auto;
    }

    .btn-search,
    .btn-clear {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .active-filter-tag {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }

    .filters-label {
        font-size: 0.75rem;
    }

    .publication-title {
        font-size: 1.2rem;
    }

    .publication-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    /* Section catégories compacte sur mobile */
    .combined-stats-section {
        margin-bottom: 1.5rem;
    }

    .categories-subsection {
        padding: 0.625rem 0.5rem;
    }

    .subsection-title {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }

    /* 2 badges par ligne sur mobile */
    .categories-inline {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .category-badge-info {
        font-size: 0.68rem;
        font-weight: 600;
        padding: 0.4rem 0.7rem;
        justify-content: center;
    }

    .category-badge-info .count {
        font-size: 0.7rem;
        font-weight: 700;
        padding: 0.1rem 0.35rem;
    }

    .back-btn {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .download-stats {
        font-size: 0.85rem;
    }

    .results-badge {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }
}