/* ============================================
   ADMIN - Styles d'administration
   ============================================ */

/* ============================================
   EN-TÊTE ET NAVIGATION ADMIN
   ============================================ */

   .admin-header {
    background: linear-gradient(135deg, var(--leather-brown), var(--ink-dark));
    border-bottom: 4px solid var(--gold-accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem;
}

.admin-header h1 {
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    color: var(--gold-accent);
}

.admin-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c1810;
    font-family: 'Crimson Text', serif;
}

.admin-nav {
    background: linear-gradient(to bottom, var(--ink-dark), var(--leather-brown));
    border-bottom: 2px solid var(--gold-dark);
}

.admin-tab {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    letter-spacing: 1px;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
}

.admin-tab.active,
.admin-tab:hover {
    border-bottom-color: var(--gold-accent);
    background: rgba(212, 165, 116, 0.1);
}

/* ============================================
   CARTES STATISTIQUES
   ============================================ */

.stat-card {
    background: linear-gradient(145deg, #faf8f3, #efe9dc);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    box-shadow: 
        0 4px 12px rgba(44, 24, 16, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 8px 20px rgba(44, 24, 16, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    border-color: var(--gold-accent);
}

.stat-card-header {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--leather-brown);
    font-weight: 600;
}

.stat-card-value {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ink-dark);
    line-height: 1;
}

.stat-card-icon {
    color: var(--gold-accent);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-card-icon {
    opacity: 1;
    transform: scale(1.1);
}

.stat-card-detail {
    font-family: 'Crimson Text', serif;
    font-size: 0.875rem;
    color: var(--ink-medium);
}

.stats-card-coins {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border: 3px solid #f0c36d;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stats-card-coins:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(240, 195, 109, 0.4);
}

.stats-icon-coins {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.stats-value-coins {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #b8860b;
    margin-bottom: 0.25rem;
}

.stats-label-coins {
    font-family: 'Cinzel', serif;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b6914;
}

.stats-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.875rem;
}

.stats-badge-blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.stats-badge-purple {
    background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
    color: #6b21a8;
    border: 1px solid #c084fc;
}

.stats-badge-green {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.stats-badge-gold {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* ============================================
   SECTIONS ET CONTENUS
   ============================================ */

.pending-section {
    background: linear-gradient(to bottom, #fefdfb, #f9f6ef);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    box-shadow: 
        0 4px 12px rgba(44, 24, 16, 0.15),
        inset 0 0 60px rgba(218, 201, 177, 0.2);
    padding: 1.5rem;
}

.pending-section h3 {
    font-family: 'Playfair Display', serif;
    color: var(--ink-dark);
    border-bottom: 2px solid var(--gold-accent);
    padding-bottom: 0.75rem;
}

.pending-item {
    border-bottom: 1px solid rgba(212, 165, 116, 0.3);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.pending-item:hover {
    background: rgba(212, 165, 116, 0.05);
    padding-left: 0.5rem;
    border-left: 3px solid var(--gold-accent);
}

.pending-item h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--ink-dark);
}

.pending-item p {
    font-family: 'Crimson Text', serif;
    color: var(--ink-medium);
}

.empty-state {
    background: linear-gradient(to bottom, #fefdfb, #f9f6ef);
    border: 2px dashed var(--gold-accent);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
}

.empty-state p {
    font-family: 'Crimson Text', serif;
    font-size: 1.125rem;
    color: var(--ink-medium);
    font-style: italic;
}

/* ============================================
   TABLEAUX
   ============================================ */

.registry-table {
    background: var(--parchment-light);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(44, 24, 16, 0.15);
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.registry-table thead {
    background: linear-gradient(to bottom, var(--leather-brown), var(--ink-dark));
    color: var(--gold-accent);
}

.registry-table th {
    font-family: 'Cinzel', serif;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem;
    border-bottom: 2px solid var(--gold-accent);
    text-align: left;
}

.registry-table td {
    font-family: 'Crimson Text', serif;
    padding: 1rem;
    color: var(--ink-dark);
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.registry-table tbody tr {
    transition: all 0.2s ease;
    position: relative;
}

.registry-table tbody tr:hover {
    background: rgba(212, 165, 116, 0.1);
}

.registry-table tbody tr::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(to right, var(--gold-accent), transparent);
    transition: width 0.3s ease;
    pointer-events: none;
}

.registry-table tbody tr:hover::before {
    width: 4px;
}

.ranking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ranking-table thead {
    background: linear-gradient(135deg, var(--leather-brown), var(--ink-dark));
}

.ranking-table th {
    padding: 1rem;
    text-align: left;
    font-family: 'Cinzel', serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gold-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ranking-table tbody tr {
    border-bottom: 1px solid #e8dcc8;
    transition: all 0.3s ease;
    animation: fadeInRow 0.5s ease-out;
}

.ranking-table tbody tr:hover {
    background: linear-gradient(135deg, #fdfbf7 0%, #f8f4ed 100%);
}

.ranking-table tbody tr:nth-child(1) {
    background: linear-gradient(135deg, #fef9e7 0%, #fef5d7 100%);
}

.ranking-table tbody tr:nth-child(2) {
    background: linear-gradient(135deg, #fdfbf7 0%, #fcf9f0 100%);
}

.ranking-table tbody tr:nth-child(3) {
    background: linear-gradient(135deg, #fdfcfa 0%, #fcfaf5 100%);
}

.ranking-table td {
    padding: 1rem;
    font-family: 'Crimson Text', serif;
    color: var(--ink-dark);
}

.rank-number {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-accent);
    text-align: center;
    min-width: 50px;
}

.rank-medal {
    font-size: 1.5rem;
}

.novel-title-link {
    color: var(--leather-brown);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.novel-title-link:hover {
    color: var(--gold-dark);
}

/* ============================================
   FILTRES ET FORMULAIRES
   ============================================ */

.period-filter {
    background: linear-gradient(135deg, #fdfbf7 0%, #f8f4ed 100%);
    border: 2px solid #e8dcc8;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-dark);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    background: white;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    color: var(--ink-dark);
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--gold-accent);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.filter-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--leather-brown), var(--ink-dark));
    color: var(--gold-accent);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-accent));
    color: var(--ink-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.grant-form-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.grant-form {
    background: #fff;
    border: 2px solid #e8dcc8;
    border-radius: 12px;
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c1810;
}

.form-select,
.form-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e8dcc8;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fdfbf7;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: #c9a877;
    background: #fff;
}

.form-errors {
    margin-top: 0.5rem;
}

.error-message {
    display: block;
    color: #d32f2f;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.submit-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2c1810 0%, #3d2418 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-button:hover {
    background: linear-gradient(135deg, #3d2418 0%, #4e2f20 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 24, 16, 0.3);
}

.grant-info {
    background: linear-gradient(135deg, #fff9f0 0%, #fdf4e8 100%);
    border: 2px solid #f0e4d0;
    border-radius: 12px;
    padding: 2rem;
}

.grant-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c1810;
}

.grant-info p {
    color: #5a4a3a;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

/* ============================================
   BOUTONS ADMIN
   ============================================ */

.admin-btn {
    font-family: 'Cinzel', serif;
    background: linear-gradient(to bottom, var(--leather-brown), var(--ink-medium));
    color: var(--gold-accent);
    border: 2px solid var(--gold-dark);
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.admin-btn:hover {
    background: linear-gradient(to bottom, var(--gold-dark), var(--gold-accent));
    color: var(--ink-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.admin-btn.danger {
    background: linear-gradient(to bottom, #dc2626, #b91c1c);
    color: white;
    border-color: #991b1b;
}

.admin-btn.danger:hover {
    background: linear-gradient(to bottom, #b91c1c, #991b1b);
}

.back-button {
    padding: 0.75rem 1.5rem;
    background: #f5f5f5;
    color: #2c1810;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #e0e0e0;
}

/* ============================================
   ONGLETS ANALYTICS
   ============================================ */

.analytics-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--gold-accent);
    flex-wrap: wrap;
}

.analytics-tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    font-family: 'Cinzel', serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-medium);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.analytics-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.analytics-tab.active {
    color: var(--gold-dark);
}

.analytics-tab.active::after {
    transform: scaleX(1);
}

.analytics-tab:hover {
    color: var(--gold-accent);
}

/* ============================================
   TRANSACTIONS
   ============================================ */

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.transaction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #fdfbf7 0%, #f8f4ed 100%);
    border: 1px solid #e8dcc8;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.transaction-row:hover {
    border-color: var(--gold-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.transaction-user {
    font-weight: 600;
    color: var(--ink-dark);
}

.transaction-type {
    font-size: 0.875rem;
    color: var(--ink-medium);
    font-style: italic;
}

.transaction-amount {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.amount-positive {
    color: #2e7d32;
}

.amount-negative {
    color: #c62828;
}

/* ============================================
   CHAPITRES PROGRAMMÉS
   ============================================ */

.chapter-scheduled {
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid #8b5cf6;
}

.scheduled-badge {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.75rem;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

.countdown-badge {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #a78bfa;
    font-weight: 500;
}

.status-scheduled {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border-color: #6366f1;
}

@keyframes pulse-scheduled {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.chapter-scheduled:hover {
    animation: pulse-scheduled 2s ease-in-out infinite;
}

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

@media (max-width: 1024px) {
    .registry-table {
        overflow-x: auto;
    }
    
    .admin-tab {
        font-size: 0.85rem;
        padding: 1rem 1rem;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
    }
    
    .admin-title {
        font-size: 1.5rem;
    }
    
    .admin-nav {
        overflow-x: auto;
    }
    
    .admin-tab {
        white-space: nowrap;
    }
    
    .stat-card-value {
        font-size: 2rem;
    }
    
    .registry-table {
        font-size: 0.875rem;
    }
    
    .registry-table th,
    .registry-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .admin-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .analytics-tabs {
        overflow-x: auto;
    }
    
    .ranking-table {
        font-size: 0.875rem;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .pending-section {
        padding: 1rem;
    }
}