:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #16a34a;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --light-bg: #f8fafc;
    --dark-bg: #1e293b;
    --card-bg: white;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--light-bg) 0%, #e0e7ff 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Layout principal */
.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: start;
}

/* Formulaire ajout livre */
.add-book-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#bookForm {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Status Selector */
.status-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.status-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-option:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.status-option.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.status-icon {
    font-size: 2rem;
    line-height: 1;
}

.status-label {
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .status-selector {
        gap: 8px;
    }
    
    .status-option {
        padding: 12px 8px;
    }
    
    .status-icon {
        font-size: 1.6rem;
    }
    
    .status-label {
        font-size: 0.75rem;
    }
}

/* Groupe recherche ISBN */
.isbn-search-group {
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 2px solid #bae6fd;
}

.isbn-search-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.isbn-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.isbn-input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: white;
}

.isbn-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.isbn-buttons-group {
    display: flex;
    gap: 8px;
}

.isbn-buttons-group button {
    flex: 1;
    white-space: nowrap;
}

.btn-scan {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-scan:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-scan:active {
    transform: translateY(0);
}

.btn-scan:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.isbn-input-group button {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Séparateur de formulaire */
.form-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 28px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.form-divider span {
    padding: 0 16px;
    background: white;
    font-weight: 500;
}

/* Ligne de formulaire (2 colonnes) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .library-quick-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .status-filter-chips {
        justify-content: flex-start;
        gap: 6px;
    }
    
    .status-chip {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Boutons */
.btn {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

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

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger {
    background: var(--danger-color);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-warning {
    background: var(--warning-color);
}

.btn-warning:hover {
    background: #b45309;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Système notation étoiles */
.star-rating {
    display: flex;
    gap: 4px;
    margin: 8px 0;
}

.star {
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.3;
    color: #fbbf24;
}

.star:hover {
    transform: scale(1.15);
}

.star.active {
    opacity: 1;
}

.star.hover {
    opacity: 0.7;
}

/* Bouton d'ajout principal */
.btn-add-book {
    width: 100%;
    margin-top: 12px;
    padding: 16px 24px;
    font-size: 17px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-add-book:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.rating-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 5px 0;
    font-size: 0.9rem;
}

.book-rating .stars {
    color: #fbbf24;
}

/* Book cover wrapper */
.book-cover-wrapper {
    position: relative;
    flex-shrink: 0;
}

.book-rating-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    font-size: 0.65rem;
    padding: 4px 6px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
    white-space: nowrap;
}

/* Section livres */
.books-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.search-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-filter input {
    flex: 1;
    min-width: 200px;
}

/* Nouveaux filtres bibliothèque */
.library-filters {
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .library-filters {
        margin-bottom: 16px;
    }
    
    .search-input-wrapper {
        margin-bottom: 12px;
    }
    
    .search-input-wrapper input {
        padding: 12px 14px 12px 44px;
        font-size: 0.95rem;
    }
    
    .library-count {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
}

.status-filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-chip {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.status-chip:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: translateY(-1px);
}

.status-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* État vide amélioré */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

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

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Cartes livres */
.book-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
}

.book-card.clickable {
    cursor: pointer;
}

.book-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.book-cover {
    width: 80px;
    height: 120px;
    background: var(--light-bg);
    border-radius: 8px;
    float: left;
    margin-right: 15px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.7rem;
    background-image: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 0;
    text-align: center;
    word-wrap: break-word;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.book-cover-text {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-weight: 600;
    font-size: 0.65rem;
    line-height: 1.2;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    width: 80px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.book-cover.has-image {
    font-size: 0;
}

.book-info {
    overflow: hidden;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    line-height: 1.3;
}

.book-author {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.book-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.book-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.status-to-read {
    background: #fef3c7;
    color: #92400e;
}

.status-reading {
    background: #dbeafe;
    color: #1e40af;
}

.status-read {
    background: #d1fae5;
    color: #065f46;
}

.book-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 10px 0;
    max-height: 60px;
    overflow: hidden;
    line-height: 1.4;
}

.book-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

/* Stats détaillées */
.detailed-stats {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.charts-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.chart-card {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.chart-card h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.chart-card canvas {
    max-width: 100%;
    height: auto;
}

/* Progress bar */
.progress-container {
    padding: 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

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

.progress-emoji {
    font-size: 2rem;
    margin-right: 15px;
}

.progress-info {
    flex: 1;
}

.progress-main {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.progress-sub {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-percent {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    padding: 8px 12px;
    border-radius: 12px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: visible;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #60a5fa);
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Messages */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.spinner {
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
}

.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
}

/* Version footer */
.version-footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
    user-select: none;
}

.version-text {
    font-weight: 600;
    color: #333;
}

.version-date {
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .search-filter {
        flex-direction: column;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-cover {
        width: 60px;
        height: 90px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .version-footer {
        position: relative;
        bottom: auto;
        right: auto;
        text-align: center;
        margin: 20px auto 10px;
        width: fit-content;
        display: block;
    }
}

/* ===== NOUVELLE ARCHITECTURE MULTI-PAGES ===== */

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 0;
    padding-bottom: calc(72px + 40px); /* Hauteur nav + marge sécurité */
}

.page {
    display: none;
    padding: 20px;
    padding-top: 20px;
    padding-bottom: 60px; /* Plus d'espace pour éviter la nav */
}

@media (max-width: 600px) {
    .page {
        padding: 12px;
        padding-top: 16px;
        padding-bottom: 100px; /* Encore plus d'espace sur mobile */
    }
}

.page-header {
    text-align: center;
    margin-bottom: 24px;
    margin-top: 0;
}

.page-header h1,
.profile-header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.library-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .page-header {
        margin-bottom: 16px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .library-subtitle {
        font-size: 0.8rem;
    }
}

/* Message de bienvenue Accueil */
.welcome-message {
    text-align: center;
}

.welcome-message h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.welcome-message h1 span {
    color: var(--primary-color);
    font-weight: 700;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.library-count {
    margin: 8px 0 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Stats rapides page d'accueil */
.stats-quick {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stats-quick .stat-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

@media (max-width: 600px) {
    .stats-quick {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stats-quick .stat-card {
        padding: 14px 16px;
        gap: 12px;
    }
}

.stats-quick .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-card-primary {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.stat-card-success {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.stat-card-info {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.stat-card .stat-content {
    flex: 1;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Statistiques rapides bibliothèque */
.library-quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.quick-stat-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

@media (max-width: 600px) {
    .library-quick-stats {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .quick-stat-card {
        padding: 12px 16px;
        gap: 14px;
    }
    
    .stat-icon {
        font-size: 1.8rem;
    }
    
    .stat-info .stat-value {
        font-size: 1.3rem;
    }
    
    .stat-info .stat-label {
        font-size: 0.7rem;
    }
}

.quick-stat-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    line-height: 1;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-info .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-quick .stat-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stats-quick .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stats-quick .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.section {
    margin-bottom: 32px;
}

.section h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .section {
        margin-bottom: 24px;
    }
    
    .section h2 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: -12px 0 16px 0;
}

.recommendation-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.15);
}

/* BOTTOM NAVIGATION */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    min-height: 72px;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Bouton central "Ajouter" */
.nav-item-center {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    margin: -32px 16px 0;
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    border-radius: 50%;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.nav-item-center:active {
    transform: scale(0.95);
}

.nav-icon-large {
    font-size: 2rem;
    color: white;
}

/* PAGE PROFIL */
.profile-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
}

.profile-tab {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

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

.profile-tab .tab-label {
    display: inline;
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.05), transparent);
}

.profile-tab:hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.03);
}

@media (max-width: 600px) {
    .profile-tab .tab-label {
        display: none;
    }
    .profile-tab {
        padding: 14px;
    }
    .profile-tab .tab-icon {
        font-size: 1.4rem;
    }
}

.profile-tab-content {
    animation: fadeIn 0.3s ease;
}

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

.profile-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.profile-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}

.profile-avatar {
    text-align: center;
    margin-bottom: 16px;
}

.avatar-circle {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.profile-card h2 {
    margin: 12px 0 8px 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.profile-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.profile-stat-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.profile-stat-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.profile-stat-icon {
    font-size: 2rem;
}

.profile-stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.profile-stat-info .stat-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 600px) {
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }
}

.settings-section {
    margin: 24px 0;
}

.settings-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.label-icon {
    font-size: 1.1rem;
}

.setting-item input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.setting-item textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    min-height: 80px;
    transition: all 0.2s ease;
}

.setting-item input:focus,
.setting-item textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.char-counter {
    display: block;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

.char-counter span {
    color: var(--primary-color);
    font-weight: 600;
}

.goal-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.goal-input-group input {
    flex: 1;
}

.goal-suffix {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.btn-save-settings {
    width: 100%;
    margin-top: 8px;
}

/* Onglet Données */
.data-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.data-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.data-card-danger {
    border-color: #fca5a5;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.data-card-header {
    margin-bottom: 20px;
}

.data-card-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.data-card-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.data-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.about-section {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.version-info {
    font-weight: 600;
    margin-bottom: 4px;
}

.version-date {
    font-size: 0.75rem;
}

/* Zones cliquables pour édition */
.book-status:hover .status-badge {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.book-rating:hover {
    transform: scale(1.02);
}

.status-badge {
    transition: all 0.2s ease;
    cursor: pointer;
}

.book-rating {
    transition: all 0.2s ease;
}

.stars {
    display: inline-block;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* PAGE RECHERCHER */
.search-section {
    max-width: 800px;
    margin: 0 auto;
}

.search-bar-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-input-large {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
}

.search-input-large:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* Bannière de filtre actif */
.active-filter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    animation: slideDown 0.3s ease;
}

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

.active-filter-banner .filter-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.active-filter-banner .filter-icon {
    font-size: 1.5rem;
}

.active-filter-banner .filter-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.active-filter-banner .filter-count {
    opacity: 0.85;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
}

.btn-clear-filter-large {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-clear-filter-large:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Filtres avancés de la bibliothèque */
.library-filters-advanced {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.filter-row {
    margin-bottom: 16px;
}

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

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 16px;
    transition: all 0.2s;
    height: 48px;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input-wrapper .search-icon-svg {
    flex-shrink: 0;
    margin-right: 12px;
    color: #9ca3af;
}

.search-input-wrapper input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 1rem;
    outline: none;
    height: 100%;
    color: var(--text-primary);
}

.search-input-wrapper input::placeholder {
    color: #9ca3af;
}

/* Version large pour la page Rechercher */
.search-input-large-wrapper {
    flex: 1;
    height: 52px;
    border-radius: 12px;
    background: white;
}

.search-input-large-wrapper .search-icon-svg {
    width: 22px;
    height: 22px;
}

.search-input-large-wrapper input {
    font-size: 1.1rem;
}

/* Filter dropdowns */
.filter-dropdowns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-dropdown {
    position: relative;
}

.filter-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s;
    min-width: 140px;
}

.filter-dropdown-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-dropdown-btn .dropdown-icon {
    font-size: 1.1rem;
}

.filter-dropdown-btn .dropdown-label {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-dropdown-btn .dropdown-arrow {
    font-size: 0.7rem;
    opacity: 0.6;
    transition: transform 0.2s;
}

.filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.filter-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-content {
    padding: 8px;
}

.filter-option {
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.9rem;
}

.filter-option:hover {
    background: var(--light-bg);
}

.filter-option.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.filter-option.disabled {
    color: var(--text-secondary);
    cursor: default;
    font-style: italic;
}

.filter-option.disabled:hover {
    background: transparent;
}

/* Séparateur entre filtres avancés et chips de statut */
.filters-separator {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}

.search-results {
    min-height: 300px;
}

.search-placeholder {
    text-align: center;
    padding: 60px 20px;
}

.search-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.search-placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.search-placeholder p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-suggestions {
    margin-top: 24px;
}

.suggestion-chips {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.suggestion-chip {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.search-result-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.search-result-cover {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.search-result-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-primary);
    line-height: 1.3;
}

.search-result-author {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.search-result-pages {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    margin-top: auto;
}

@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .search-bar-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-input-large {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* En-têtes de section avec badges */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0;
}

.section-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.section-badge-gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

/* ========================================
   NOUVELLE PAGE STATISTIQUES
======================================== */

/* Hero Stats */
.stats-hero {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 32px 24px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.hero-stat {
    text-align: center;
    color: white;
}

.hero-stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.hero-stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-stat-divider {
    width: 1px;
    height: 50px;
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
    .stats-hero {
        gap: 16px;
        padding: 24px 16px;
    }
    
    .hero-stat-value {
        font-size: 1.8rem;
    }
    
    .hero-stat-label {
        font-size: 0.7rem;
    }
    
    .hero-stat-divider {
        height: 40px;
    }
}

/* Stats Card */
.stats-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.stats-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.stats-card-icon {
    font-size: 1.4rem;
}

.stats-card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Goal Card */
.stats-goal-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
}

.goal-progress-container {
    margin-bottom: 16px;
}

.goal-progress-bar {
    height: 24px;
    background: #e0e7ff;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 12px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.goal-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

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

.goal-progress-labels {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 12px;
}

.goal-current {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.goal-target {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.goal-motivation {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    margin-top: 4px;
}

.motivation-emoji {
    font-size: 1.5rem;
}

.motivation-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Status Bars */
.status-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-bar-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-bar-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-bar-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.status-bar-track {
    height: 12px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.status-bar-read {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.status-bar-reading {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.status-bar-toread {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Records Grid */
.records-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.record-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.record-icon {
    font-size: 1.8rem;
}

.record-info {
    flex: 1;
    min-width: 0;
}

.record-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

@media (max-width: 600px) {
    .records-grid {
        grid-template-columns: 1fr;
    }
    
    .record-item {
        padding: 14px;
    }
}

/* Rating Distribution */
.rating-distribution {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rating-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-label {
    width: 32px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fbbf24;
    text-align: right;
}

.rating-bar-track {
    flex: 1;
    height: 20px;
    background: #fef3c7;
    border-radius: 10px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.rating-count {
    width: 24px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: left;
}

/* Activity Chart */
.activity-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 120px;
    gap: 8px;
    padding: 10px 0;
}

.activity-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.activity-bar-fill {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, #3b82f6, #60a5fa);
    border-radius: 6px 6px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
}

.activity-bar-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.activity-legend {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.activity-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(180deg, #3b82f6, #60a5fa);
    border-radius: 50%;
}

/* ========================================
   PROFIL PUBLIC (Vue Instagram-style)
======================================== */

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    margin-top: 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.profile-header h1 {
    text-align: left;
    flex: 1;
}

.btn-settings {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-settings:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.settings-icon {
    font-size: 1.1rem;
}

.public-profile {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.profile-card-public {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

@media (max-width: 600px) {
    .profile-header {
        padding: 0 12px;
        margin-bottom: 24px;
    }
    
    .profile-card-public {
        padding: 30px 16px;
        margin-bottom: 20px;
        border-radius: 16px;
    }
}

.profile-avatar-large {
    margin-bottom: 20px;
}

.avatar-circle-large {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.profile-username {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 10px 0;
    color: white;
}

@media (max-width: 600px) {
    .avatar-circle-large {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
        border: 3px solid rgba(255, 255, 255, 0.3);
    }
    
    .profile-username {
        font-size: 1.4rem;
    }
    
    .profile-bio-public {
        font-size: 0.9rem;
    }
}

.profile-bio-public {
    font-size: 1rem;
    opacity: 0.95;
    margin: 15px 0;
    line-height: 1.5;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.profile-stats-public {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 30px;
}

.stat-item-public {
    text-align: center;
}

.stat-number-public {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    display: block;
}

.stat-label-public {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
}

.profile-section-public {
    margin-bottom: 30px;
}

.section-title-public {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 600px) {
    .section-title-public {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .section-header {
        margin-bottom: 12px;
    }
    
    .section-header h2 {
        font-size: 1rem;
    }
}

.favorite-books-grid,
.recent-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.empty-state-mini {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.empty-state-mini p {
    margin: 0;
}

.book-card-mini {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.book-card-mini:hover {
    transform: scale(1.05);
}

.book-cover-mini {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-cover-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-cover-mini .book-cover {
    width: 100%;
    height: 100%;
}

/* ========================================
   PAGE PARAMÈTRES
======================================== */

.settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--border-color);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: #d1d5db;
}

.back-icon {
    font-size: 1.2rem;
}

.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.settings-tab:hover {
    color: var(--text-primary);
}

.settings-tab-content {
    display: none;
    max-width: 600px;
    margin: 0 auto;
}

.settings-tab-content[style*="display: block"] {
    animation: fadeIn 0.3s ease;
}

/* ========================================
   EMOJI PICKER
======================================== */

.emoji-picker-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.current-emoji {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 3px solid #bae6fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-width: 400px;
}

.emoji-option {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emoji-option:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.emoji-option.selected {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: var(--primary-color);
}

/* Responsive amélioré */
@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card-outline {
        padding: 18px;
    }
    
    .stat-icon-large {
        font-size: 2rem;
    }
    
    .stat-card-outline .stat-number {
        font-size: 2rem;
    }
    
    .chart-card-goal {
        grid-column: span 1;
    }
}

@media (max-width: 600px) {
    .profile-stats-public {
        gap: 15px;
    }
    
    .stat-number-public {
        font-size: 1.4rem;
    }
    
    .stat-label-public {
        font-size: 0.75rem;
    }
    
    .favorite-books-grid,
    .recent-books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .emoji-option {
        font-size: 1.8rem;
        padding: 10px;
    }
    
    .current-emoji {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .settings-section {
        margin: 16px 0;
    }
    
    .settings-section h3 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }
    
    .settings-tab .tab-label {
        display: none;
    }
    
    .settings-tab {
        padding: 12px 16px;
    }
    
    .btn-settings .settings-text {
        display: none;
    }
    
    .library-tab .tab-label {
        display: none;
    }
    
    .library-tab {
        padding: 12px 16px;
    }
}

/* LIBRARY TABS */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.library-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

@media (max-width: 600px) {
    .library-tabs {
        gap: 4px;
        margin-bottom: 16px;
    }
    
    .library-tab {
        padding: 10px 14px;
        font-size: 0.9rem;
        gap: 6px;
    }
    
    .library-tab .tab-icon {
        font-size: 1.1rem;
    }
}

.library-tab:hover {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

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

.library-tab-content {
    animation: fadeIn 0.3s ease;
}

/* Charts container */
.charts-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Insights placeholder */
.insights-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    padding: 40px 20px;
}

.coming-soon-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 48px 40px;
    max-width: 600px;
    text-align: center;
}

.coming-soon-icon {
    font-size: 4rem;
    margin-bottom: 24px;
}

.coming-soon-card h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.coming-soon-card > p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 32px;
}

.features-preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-light);
    border-radius: 8px;
    text-align: left;
}

.feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.coming-soon-note {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
}

@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .chart-card {
        padding: 16px;
    }
    
    .chart-header h3 {
        font-size: 1rem;
    }
    
    .chart-card-goal {
        grid-column: span 1;
    }
    
    .coming-soon-card {
        padding: 24px 16px;
    }
    
    .coming-soon-card h2 {
        font-size: 1.4rem;
    }
    
    .feature-item {
        padding: 10px;
        font-size: 0.9rem;
    }
}

/* Mobile responsive additions */
@media (max-width: 600px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 0.95rem;
    }
    
    .isbn-buttons-group {
        flex-direction: column;
    }
    
    .isbn-buttons-group button {
        width: 100%;
    }
    
    .book-card {
        padding: 14px;
    }
    
    .book-cover {
        width: 70px;
        height: 105px;
    }
    
    .book-title {
        font-size: 1rem;
    }
    
    .book-author {
        font-size: 0.85rem;
    }
    
    .section-title-public {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .section-header {
        margin-bottom: 12px;
    }
    
    .section-header h2 {
        font-size: 1rem;
    }
    
    .app-container {
        padding-bottom: calc(72px + 80px); /* Plus d'espace sur mobile */
    }
    
    .profile-header,
    .settings-header {
        padding: 0 4px;
    }
    
    .btn-back {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .search-filters {
        gap: 6px;
    }
    
    .filter-chip {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .empty-state {
        padding: 60px 16px;
    }
    
    .empty-icon {
        font-size: 3rem;
    }
    
    .empty-state h3 {
        font-size: 1.2rem;
    }
}

/* ========================================
   MODAL DÉTAILS DU LIVRE
======================================== */

.book-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-modal-overlay.active {
    opacity: 1;
}

.book-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.modal-header {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 20px 20px 0 0;
}

.modal-cover {
    width: 100px;
    height: 150px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-cover-text {
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    padding: 8px;
    line-height: 1.3;
}

.modal-title-section {
    flex: 1;
    min-width: 0;
    padding-top: 8px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.modal-author {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
}

.modal-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.modal-status-badge {
    display: inline-block;
}

.modal-body {
    padding: 24px;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

/* Progress in modal */
.modal-progress-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-progress-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.modal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.modal-progress-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-progress-input input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
}

.modal-progress-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-progress-input span {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Rating in modal */
.modal-rating {
    display: flex;
    gap: 8px;
}

.modal-star {
    font-size: 2rem;
    cursor: pointer;
    color: #fbbf24;
    opacity: 0.3;
    transition: all 0.2s ease;
}

.modal-star:hover {
    transform: scale(1.2);
}

.modal-star.active {
    opacity: 1;
}

/* Status selector in modal */
.modal-status-selector {
    display: flex;
    gap: 8px;
}

.modal-status-option {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.modal-status-option:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.modal-status-option.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: var(--primary-color);
}

.modal-status-option span {
    font-size: 1.3rem;
}

/* Textarea in modal */
.modal-textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-textarea::placeholder {
    color: #94a3b8;
}

/* Footer info */
.modal-footer-info {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.modal-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Modal actions */
.modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: #f8fafc;
    border-radius: 0 0 20px 20px;
    border-top: 1px solid var(--border-color);
}

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

/* Clickable book card */
.book-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.book-card:active {
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .book-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .book-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
    }
    
    .modal-header {
        border-radius: 20px 20px 0 0;
        padding: 20px;
        gap: 16px;
    }
    
    .modal-cover {
        width: 80px;
        height: 120px;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-status-selector {
        flex-direction: column;
    }
    
    .modal-status-option {
        flex-direction: row;
        justify-content: center;
    }
}

/* ========================================
   CHIPS - GENRES & TAGS
======================================== */

.modal-genres-container,
.modal-tags-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.chip-genre {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.chip-tag {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    padding: 0;
    line-height: 1;
}

.chip-remove:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.modal-chip-input-wrapper {
    position: relative;
}

.modal-chip-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: white;
}

.modal-chip-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chip-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 4px;
}

.chip-suggestions.active {
    display: block;
}

.chip-suggestion {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chip-suggestion:hover,
.chip-suggestion.selected {
    background: var(--light-bg);
}

.chip-suggestion:first-child {
    border-radius: 10px 10px 0 0;
}

.chip-suggestion:last-child {
    border-radius: 0 0 10px 10px;
}

.chip-suggestion-new {
    color: var(--primary-color);
    font-weight: 500;
}

.chip-suggestion-new::before {
    content: '+ ';
}

/* Empty state for chips */
.chips-empty {
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    padding: 4px 0;
}

/* Mini genre chips on book cards */
.book-genres-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0;
}

.genre-chip-mini {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.genre-chip-mini.more {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

/* ========================================
   COLLECTIONS
======================================== */

.section-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header-with-action .section-title-public {
    margin: 0;
}

.btn-add-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px dashed var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-add-small:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.collection-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.collection-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.collection-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.collection-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.collection-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.collection-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collection-card:hover .collection-delete {
    opacity: 1;
}

.collection-delete:hover {
    background: #dc2626;
    color: white;
}

/* Create Collection Modal */
.create-collection-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.create-collection-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.create-collection-content h3 {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    text-align: center;
}

.collection-icons-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.collection-icon-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.collection-icon-btn:hover {
    border-color: var(--primary-color);
}

.collection-icon-btn.active {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

/* Modal Collections Checkboxes */
.modal-collections-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.collection-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.collection-checkbox:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.02);
}

.collection-checkbox.checked {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.collection-checkbox-icon {
    font-size: 1.2rem;
}

.collection-checkbox-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.collection-checkbox-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.collection-checkbox.checked .collection-checkbox-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.collections-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Clear filter button */
.btn-clear-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    border: none;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.btn-clear-filter:hover {
    background: #dc2626;
    color: white;
}
