/* ==========================================================================
   CODE LIBRARY - Système de bibliothèque de code
   Fichier: css/code-library.css
   Version: 1.0
   Date: 31 octobre 2025
   ========================================================================== */

/* ==========================================================================
   HEADER DE LA BIBLIOTHÈQUE
   ========================================================================== */
.code-library-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 0 40px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.code-library-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.code-library-header h1 {
    margin: 0 0 15px 0;
    font-size: 2.5rem;
    position: relative;
    z-index: 2;
}

.code-library-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   BARRE DE RECHERCHE ET FILTRES
   ========================================================================== */
.code-filters {
    background: white;
    padding: 30px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 70px;
    z-index: 40;
}

.filter-bar {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--code-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1.2rem;
}

/* Filtres par type */
.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.filter-btn.active {
    border-color: var(--code-primary);
    background: var(--code-primary);
    color: white;
}

.filter-btn .badge {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.filter-btn.active .badge {
    background: rgba(255,255,255,0.2);
}

/* Tri */
.sort-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:hover {
    border-color: var(--code-primary);
}

/* ==========================================================================
   GRILLE DE PROJETS
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

/* ==========================================================================
   CARTE PROJET
   ========================================================================== */
.project-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

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

/* Header de la carte */
.project-card-header {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.project-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--esphome-color), var(--homeassistant-color));
}

.project-title {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-icon {
    font-size: 1.5rem;
}

.project-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Tags */
.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.tag.esphome {
    background: rgba(102, 126, 234, 0.1);
    color: var(--esphome-color);
}

.tag.homeassistant {
    background: rgba(65, 189, 245, 0.1);
    color: var(--homeassistant-color);
}

.tag.cpp {
    background: rgba(243, 75, 125, 0.1);
    color: var(--cpp-color);
}

.tag.yaml {
    background: rgba(52, 168, 83, 0.1);
    color: var(--yaml-color);
}

.tag.python {
    background: rgba(55, 118, 171, 0.1);
    color: var(--python-color);
}

/* Corps de la carte */
.project-card-body {
    padding: 20px;
    flex: 1;
}

.project-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 0.9rem;
}

.stat-icon {
    color: var(--code-primary);
}

/* Liste de fichiers */
.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 0.9rem;
    border-bottom: 1px solid #f5f5f5;
}

.file-item:last-child {
    border-bottom: none;
}

.file-icon {
    font-size: 1rem;
    color: var(--code-primary);
}

.file-name {
    flex: 1;
    font-family: 'Courier New', monospace;
}

.file-size {
    color: #999;
    font-size: 0.85rem;
}

/* Footer de la carte */
.project-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.btn-view, .btn-download {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-view {
    background: var(--code-primary);
    color: white;
}

.btn-view:hover {
    background: #0d47a1;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(26, 115, 232, 0.3);
}

.btn-download:hover {
    background: #2d8e47;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(52, 168, 83, 0.3);
}

/* ==========================================================================
   PAGE DE DÉTAIL DU PROJET
   ========================================================================== */
.project-detail-header {
    background: white;
    padding: 40px 0;
    border-bottom: 1px solid #e0e0e0;
}

.project-detail-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.project-detail-title h1 {
    margin: 0;
    font-size: 2.5rem;
}

.project-meta {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: center;
}

/* Onglets de code */
.code-tabs {
    background: white;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 70px;
    z-index: 30;
}

.code-tabs-nav {
    display: flex;
    gap: 5px;
    padding: 0;
    margin: 0;
    list-style: none;
    overflow-x: auto;
}

.code-tab {
    padding: 15px 25px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.code-tab:hover {
    color: var(--code-primary);
    background: #f8f9fa;
}

.code-tab.active {
    color: var(--code-primary);
    border-bottom-color: var(--code-primary);
}

.code-tab-icon {
    font-size: 1.2rem;
}

/* Contenu des onglets */
.code-tab-content {
    display: none;
}

.code-tab-content.active {
    display: block;
}

/* Bloc de code */
.code-block {
    margin: 30px 0;
}

.code-block-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-block-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

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

.btn-copy-code, .btn-download-code {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-copy-code {
    background: #e0e0e0;
    color: #333;
}

.btn-copy-code:hover {
    background: #d0d0d0;
}

.btn-download-code {
    background: var(--code-secondary);
    color: white;
}

.btn-download-code:hover {
    background: #2d8e47;
}

.code-block-body {
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.code-block-body pre {
    margin: 0;
    padding: 20px;
    background: var(--code-dark);
    overflow-x: auto;
}

.code-block-body code {
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Info supplémentaire */
.code-info {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.code-info h3 {
    margin: 0 0 15px 0;
    color: var(--code-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.code-info li {
    margin: 8px 0;
    line-height: 1.6;
}

/* ==========================================================================
   MESSAGE VIDE
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.empty-state p {
    margin: 0;
}

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

/* Tablette */
@media (max-width: 992px) {
    .code-library-header h1 {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-buttons {
        width: 100%;
    }
    
    .filter-btn {
        flex: 1;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .code-library-header {
        padding: 40px 0 30px 0;
    }
    
    .code-library-header h1 {
        font-size: 1.75rem;
    }
    
    .code-library-header p {
        font-size: 1rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-card-footer {
        flex-direction: column;
    }
    
    .code-tabs-nav {
        -webkit-overflow-scrolling: touch;
    }
    
    .code-tab {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .project-detail-title h1 {
        font-size: 1.75rem;
    }
    
    .code-block-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .code-block-actions {
        width: 100%;
    }
    
    .btn-copy-code, .btn-download-code {
        flex: 1;
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Animation pour le feedback de copie */
@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 168, 83, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(52, 168, 83, 0);
    }
}

.btn-copy-code.copied {
    animation: successPulse 0.6s ease-out;
    background: var(--code-secondary) !important;
    color: white !important;
}

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print {
    .code-filters,
    .code-tabs,
    .code-block-actions,
    .project-card-footer {
        display: none !important;
    }
    
    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .code-block-body pre {
        background: white !important;
        border: 1px solid #ddd;
    }
    
    .code-block-body code {
        color: black !important;
    }
}

/* ----------------------------------------------------------------------------
   5. TECHNICAL COMPONENTS - 7 fichiers
   Fichier cible: 05-pages/code-library.css
   ---------------------------------------------------------------------------- */

.tech-highlight {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    border-left: 4px solid #3498db;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tech-highlight strong {
    color: #2c3e50;
}

.tech-highlight code {
    background: #ecf0f1;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.tech-col {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.tech-col:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tech-col h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

/* Technical Components */
.tech-highlight {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tech-col {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Methodology Navigation */
.methodology-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.methodology-nav a {
    padding: 0.6rem 1.2rem;
    background: #ecf0f1;
    border-radius: 6px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
}

.methodology-nav a:hover {
    background: #3498db;
    color: white;
}

/* Resources Content */
.resources-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   BANDEAU POINTS ESSENTIELS
   ========================================================================== */
.resources-highlights {
    background: #f0f4ff;
    border-top: 3px solid #1a73e8;
    border-bottom: 1px solid #dce6fb;
    padding: 24px 0;
}

.highlights-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a73e8;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
    padding: 0 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border-radius: 10px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    border-left: 4px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.highlight-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.13);
    text-decoration: none;
    color: inherit;
}

.highlight-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.highlight-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.highlight-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #222;
}

.highlight-text span {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.4;
}

.highlight-arrow {
    font-size: 1.1rem;
    color: #999;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.highlight-item:hover .highlight-arrow {
    transform: translateX(4px);
}

/* Couleurs par type */
.highlight-datasheet {
    border-left-color: #1a73e8;
}
.highlight-datasheet:hover .highlight-text strong,
.highlight-datasheet:hover .highlight-arrow {
    color: #1a73e8;
}

.highlight-yaml {
    border-left-color: #34a853;
}
.highlight-yaml:hover .highlight-text strong,
.highlight-yaml:hover .highlight-arrow {
    color: #34a853;
}

.highlight-logic {
    border-left-color: #7c3aed;
}
.highlight-logic:hover .highlight-text strong,
.highlight-logic:hover .highlight-arrow {
    color: #7c3aed;
}

.highlight-cpp {
    border-left-color: #00599c;
}
.highlight-cpp:hover .highlight-text strong,
.highlight-cpp:hover .highlight-arrow {
    color: #00599c;
}

.highlight-arduino {
    border-left-color: #00979D;
}
.highlight-arduino:hover .highlight-text strong,
.highlight-arduino:hover .highlight-arrow {
    color: #00979D;
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.resources-content .section {
    padding: 40px 0;
    border-bottom: 1px solid #f0f0f0;
}

.resources-content .section:last-of-type {
    border-bottom: none;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a2340;
    margin-bottom: 10px;
}

/* Pages yaml/cpp : badge au-dessus du h2, pas côte à côte */
.yaml-code-page .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: inherit;
}
.yaml-code-page .section-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: #1a2340;
}

.section-icon {
    font-size: 1.4rem;
}

.section-intro {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 700px;
    margin-bottom: 5px;
}

/* ==========================================================================
   VARIANTES DE CARTES PAR TYPE
   ========================================================================== */

/* Datasheets - bleu */
.resource-card.datasheet-card {
    border-left-color: #1a73e8;
    background: #f5f9ff;
    position: relative;
}

/* Code / Software - vert */
.resource-card.software-card {
    border-left-color: #34a853;
    background: #f3faf5;
    position: relative;
}

/* Schémas / Outils - orange */
.resource-card.tool-card {
    border-left-color: #f59e0b;
    background: #fffbf0;
    position: relative;
}

/* Support / Apprentissage - violet */
.resource-card.learning-card {
    border-left-color: #8b5cf6;
    background: #faf7ff;
    position: relative;
}

/* GitHub - gris foncé */
.resource-card.github-card {
    border-left-color: #374151;
    background: #f8f9fa;
    position: relative;
}

/* ==========================================================================
   CARTES FEATURED (mise en avant)
   ========================================================================== */
.resource-card.featured {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: scale(1.02);
    border-left-width: 6px;
}

.resource-card.featured:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

/* ==========================================================================
   BADGES DE TYPE
   ========================================================================== */
.card-type-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.badge-tubes    { background: #dbeafe; color: #1e40af; }
.badge-composants { background: #1a73e8; color: white; }
.badge-logic    { background: #ede9fe; color: #6d28d9; }
.badge-arduino  { background: #d1fae5; color: #065f46; }
.badge-yaml     { background: #34a853; color: white; }
.badge-cpp      { background: #00599c; color: white; }

/* ==========================================================================
   RESOURCE LINK - bouton-lien
   ========================================================================== */
.resource-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    background: rgba(26, 115, 232, 0.08);
    color: #1a73e8;
    align-self: flex-start;
}

.resource-link:hover {
    background: #1a73e8;
    color: white;
    text-decoration: none;
    transform: translateX(3px);
}

.software-card .resource-link {
    background: rgba(52, 168, 83, 0.08);
    color: #34a853;
}
.software-card .resource-link:hover {
    background: #34a853;
    color: white;
}

.tool-card .resource-link {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
}
.tool-card .resource-link:hover {
    background: #f59e0b;
    color: white;
}

/* ==========================================================================
   TAGS
   ========================================================================== */
.tag {
    display: inline-block;
    background: rgba(26, 115, 232, 0.1);
    color: #1a73e8;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 500;
}

.software-card .tag {
    background: rgba(52, 168, 83, 0.1);
    color: #1d7a3a;
}

.tool-card .tag {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

/* ==========================================================================
   DIFFICULTY BADGES
   ========================================================================== */
.difficulty {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.difficulty-beginner    { background: #d1fae5; color: #065f46; }
.difficulty-intermediate { background: #dbeafe; color: #1e40af; }
.difficulty-advanced    { background: #f3e8ff; color: #6d28d9; }

/* ==========================================================================
   TABLE DES MATIÈRES
   ========================================================================== */
.table-of-contents {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px 24px;
    margin: 10px 0 30px;
    border: 1px solid #e0e8ff;
}

.toc-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    font-weight: 700;
    margin-bottom: 12px;
}

.toc-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.toc-list a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 12px;
    border-radius: 6px;
    background: white;
    border: 1px solid #e0e0e0;
    transition: background 0.2s, color 0.2s;
}

.toc-list a:hover {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
    text-decoration: none;
}

/* ==========================================================================
   RESPONSIVE HIGHLIGHTS
   ========================================================================== */
@media (max-width: 992px) {
    .highlights-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .resource-card.featured {
        transform: none;
    }
    .resource-card.featured:hover {
        transform: translateY(-3px);
    }
}

@media (max-width: 768px) {
    .highlights-label {
        padding: 0 15px;
    }
    .highlights-grid {
        padding: 0 15px;
    }
    .highlight-item {
        padding: 12px 14px;
    }
}
