/* ====================================
   BIBLIOTHÈQUE - STYLES SPÉCIFIQUES
   ==================================== */

/* Hero Section Bibliothèque */
.bibliotheque-hero {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(59, 130, 246, 0.95)),
                url('https://images.unsplash.com/photo-1481627834876-b7833e8f5570?q=80&w=2000') center/cover;
    padding: var(--spacing-xl) 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.bibliotheque-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.95;
    line-height: 1.6;
}

/* Search & Filter Section */
.search-filter-section {
    padding: var(--spacing-lg) 0;
    background: linear-gradient(to bottom, #f8f9fa, white);
    position: sticky;
    top: 70px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-bar {
    max-width: 600px;
    margin: 0 auto var(--spacing-md);
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.search-bar input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    border: 2px solid #e0e7ff;
    border-radius: var(--radius-full);
    font-size: 1rem;
    transition: all var(--transition-normal);
    background: white;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.category-tabs {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: 2px solid #e0e7ff;
    background: white;
    color: var(--text-primary);
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 1.1rem;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    background: rgba(124, 58, 237, 0.05);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Library Sections */
.library-section {
    padding: var(--spacing-xl) 0;
}

.library-section:nth-child(even) {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.02), rgba(59, 130, 246, 0.02));
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.section-header h2 i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

/* Resource Cards */
.resource-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Card Icon (for sites) */
.card-icon {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.card-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30%, -30%); }
}

/* Card Content */
.card-content {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.card-category {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.card-category i {
    font-size: 0.9rem;
}

.card-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    flex-grow: 1;
}

.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.tag {
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.1));
    color: var(--primary-color);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

/* Card Footer */
.card-footer {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: var(--spacing-sm);
}

.card-footer .btn-secondary,
.card-footer .btn-outline {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    font-size: 0.95rem;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Book Card Specific */
.book-card .book-cover {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #f8f9fa;
}

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    position: relative;
}

.book-cover-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
}

.book-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: var(--spacing-sm);
}

/* Video Card Specific */
.video-card .video-thumbnail {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    transition: all var(--transition-normal);
}

.video-card:hover .video-placeholder {
    transform: scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Document Card Specific */
.document-card .document-icon {
    width: 100%;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.document-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.document-icon i {
    font-size: 4rem;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;
}

.file-size {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(5px);
}

/* Featured Section - Créations Hub */
.featured-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(255, 140, 0, 0.05));
    border-top: 3px solid #ffd700;
    border-bottom: 3px solid #ffd700;
}

.featured-header {
    position: relative;
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: white;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    animation: pulse 2s infinite;
}

.featured-badge i {
    font-size: 1rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Hub Callout Box */
.hub-callout {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.15));
    border: 2px solid #ffd700;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.2);
}

.callout-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.callout-content {
    flex: 1;
}

.callout-content h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
}

.callout-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.callout-content strong {
    color: #ff8c00;
    font-weight: 700;
}

.callout-btn {
    flex-shrink: 0;
    padding: 14px 28px;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.callout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.callout-btn i {
    font-size: 1.1rem;
}

/* Hub Creation Badge on Cards */
.hub-creation {
    position: relative;
    border: 2px solid #ffd700;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.hub-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Info Box Upload */
.info-box-upload {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(124, 58, 237, 0.08));
    border-left: 4px solid var(--secondary-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.info-box-upload .info-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-secondary);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.5rem;
}

.info-box-upload .info-content h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.info-box-upload .info-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-box-upload code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
}

/* CTA Section */
.cta-section {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
}

.cta-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.cta-content p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
    opacity: 0.95;
    line-height: 1.6;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.1rem;
    background: white;
    color: var(--primary-color);
}

.btn-large:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Hidden State for Filtering */
.resource-card.hidden {
    display: none;
}

.library-section.hidden {
    display: none;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.no-results i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: var(--spacing-md);
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

@media (max-width: 1024px) {
    .resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
    }

    .section-header p {
        font-size: 1rem;
    }

    .category-tabs {
        gap: 8px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .tab-btn span {
        display: none;
    }

    .resource-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .card-footer {
        flex-direction: column;
    }

    .info-box-upload {
        flex-direction: column;
        text-align: center;
    }

    .hub-callout {
        flex-direction: column;
        text-align: center;
    }

    .callout-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .callout-btn {
        width: 100%;
        justify-content: center;
    }

    .cta-content h2 {
        font-size: 1.5rem;
    }

    .cta-content p {
        font-size: 1rem;
    }

    .search-filter-section {
        position: relative;
        top: 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .library-section {
        padding: var(--spacing-lg) 0;
    }

    .card-content {
        padding: var(--spacing-sm);
    }

    .card-footer {
        padding: var(--spacing-sm);
    }
}

/* ====================================
   ANIMATIONS & INTERACTIONS
   ==================================== */

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

.resource-card {
    animation: fadeIn 0.5s ease-out;
}

/* Stagger animation for cards */
.resource-card:nth-child(1) { animation-delay: 0.1s; }
.resource-card:nth-child(2) { animation-delay: 0.2s; }
.resource-card:nth-child(3) { animation-delay: 0.3s; }
.resource-card:nth-child(4) { animation-delay: 0.4s; }
.resource-card:nth-child(5) { animation-delay: 0.5s; }
.resource-card:nth-child(6) { animation-delay: 0.6s; }

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}
