/* Variables de thème */
:root {
    /* Thème clair (par défaut) */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: white;
    --text-primary: #333;
    --text-secondary: #555;
    --text-tertiary: #999;
    --border-color: #ddd;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --comment-bg: #f8f9fa;
    --nav-text: #333;
    --nav-text-hover: #667eea;
    --icon-color: #333;
    --icon-hover-up: #4CAF50;
    --icon-hover-down: #f44336;
}

[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: #242424;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #a0a0a0;
    --border-color: #404040;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(36, 36, 36, 0.95);
    --comment-bg: #2d2d2d;
    --nav-text: #a0a0a0;
    --nav-text-hover: #ffffff;
    --icon-color: #ffffff;
    --icon-hover-up: #4CAF50;
    --icon-hover-down: #f44336;
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    transition: background 0.3s ease;
}

/* Navigation */
.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 20px var(--card-shadow);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.nav-logo:hover {
    transform: scale(1.05);
    color: #764ba2;
}

.nav-logo i {
    margin-right: 0.5rem;
    font-size: 2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

.nav-links .nav-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.nav-links .nav-link:hover {
    background: var(--bg-tertiary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none; /* Caché par défaut sur grand écran */
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
}

.menu-toggle i {
    font-size: 1.2rem;
}

.menu-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    background: var(--bg-secondary);
    box-shadow: 0 4px 6px var(--card-shadow);
    z-index: 1000;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 1rem;
}

.menu-content.active {
    display: block;
}

.menu-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.menu-content li {
    margin-bottom: 0.5rem;
}

.menu-content .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.menu-content .nav-link:hover {
    background: var(--bg-tertiary);
}

.menu-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-footer .auth-buttons,
.menu-footer .user-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

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

.menu-footer .theme-switch-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

#user-info-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

#username-display-mobile {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

#settings-button-mobile {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

#settings-button-mobile .btn-settings {
    width: 100%;
    justify-content: center;
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.5rem 1rem;
    }

    .nav-links {
        display: none; /* Cache les liens sur petit écran */
    }

    .nav-actions {
        display: none; /* Cache les actions sur petit écran */
    }

    .menu-toggle {
        display: flex; /* Affiche le bouton menu sur petit écran */
    }

    .menu-content {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        background: var(--bg-secondary);
        padding: 1rem;
        z-index: 1000;
    }

    .menu-content.active {
        display: block;
        animation: slideDown 0.3s ease;
    }

    .menu-content ul {
        list-style: none;
        padding: 0;
        margin: 0 0 1rem 0;
    }

    .menu-content li {
        margin-bottom: 0.5rem;
    }

    .menu-content .nav-link {
        display: block;
        padding: 0.5rem;
        color: var(--text-primary);
        text-decoration: none;
        border-radius: var(--border-radius);
        transition: all 0.3s ease;
    }

    .menu-content .nav-link:hover {
        background: var(--bg-tertiary);
    }

    .menu-footer {
        border-top: 1px solid var(--border-color);
        padding-top: 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .menu-footer .auth-buttons,
    .menu-footer .user-info {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

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

    .menu-footer .theme-switch-wrapper {
        margin-top: 0.5rem;
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.5rem;
    }

    .menu-toggle {
        padding: 0.5rem;
    }

    .menu-toggle span {
        display: none;
    }

    .menu-toggle i {
        margin: 0;
    }
}

/* Authentification */
.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
}

.auth-buttons .btn {
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.auth-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--nav-text);
}

.user-info span {
    font-weight: 600;
}

.settings-button {
    margin-left: 0.5rem;
}

.btn-settings {
    padding: 0.5rem;
    font-size: 1rem;
    background: transparent;
    color: var(--nav-text);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-settings:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--nav-text-hover);
    transform: rotate(30deg);
}

.user-info .btn {
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.user-info .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Contenu principal */
.main-content {
    margin-top: 80px;
    padding: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Page d'accueil */
.hero {
    text-align: center;
    padding: 2rem 0;
    color: white;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

/* Boutons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.btn-secondary:hover {
    background: white;
    border-color: #667eea;
}

/* Cartes de blagues */
.random-joke-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.random-joke-btn {
    margin-top: 1rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.random-joke-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.random-joke-btn i {
    margin-right: 0.5rem;
}

.joke-card {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px var(--card-shadow);
    max-width: 600px;
    width: 100%;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.joke-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    transition: background 0.3s ease;
}

/* Logique de couleur basée sur la différence des votes */
.joke-card[data-score="neutral"]::after {
    background: linear-gradient(90deg, #FFD700, #FFA500); /* Jaune pour différence < 100 */
}

.joke-card[data-score="positive"]::after {
    background: linear-gradient(90deg, #2196F3, #1976D2); /* Bleu pour 100 <= différence < 500 */
}

.joke-card[data-score="very-positive"]::after {
    background: linear-gradient(90deg, #4CAF50, #45a049); /* Vert pour différence >= 500 */
}

.joke-card[data-score="negative"]::after {
    background: linear-gradient(90deg, #FF9800, #F57C00); /* Orange pour -500 < différence <= -100 */
}

.joke-card[data-score="very-negative"]::after {
    background: linear-gradient(90deg, #F44336, #D32F2F); /* Rouge pour différence <= -500 */
}

.joke-card:hover {
    transform: translateY(-5px);
}

.joke-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.joke-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #636363b6;
    margin-bottom: 0rem;
}

.joke-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.joke-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.joke-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.joke-votes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.joke-score {
    font-weight: bold;
    color: #667eea;
    margin: 0 0.5rem;
}

.joke-categories {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.joke-category {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.joke-author {
    background: #28a745;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.joke-date {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.vote-btn {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-color);
    font-size: 0.8rem;
    padding: 0;
}

.vote-btn:hover {
    transform: scale(1.1);
}

.vote-btn.upvote:hover {
    border-color: var(--icon-hover-up);
    color: var(--icon-hover-up);
}

.vote-btn.downvote:hover {
    border-color: var(--icon-hover-down);
    color: var(--icon-hover-down);
}

.vote-btn i {
    color: inherit;
    margin-right: 0.2rem;
}

/* Ajustement pour l'affichage des votes */
.vote-btn.upvote {
    border-radius: 20px;
    width: auto;
    padding: 0 0.8rem;
}

.vote-btn.downvote {
    border-radius: 20px;
    width: auto;
    padding: 0 0.8rem;
}

/* Grille de blagues */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    color: white;
}

.page-header h2 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.filters select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 25px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
}

.jokes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

/* Formulaire */
.form-container {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px var(--card-shadow);
    max-width: 600px;
    margin: 0 auto;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.2rem;
    transition: border-color 0.3s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 3000;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #4CAF50;
}

.toast.error {
    background: #f44336;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Commentaires */
.comments-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.comments-section h3 {
    margin-bottom: 1rem;
    color: #333;
}

.comment {
    background: var(--comment-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.comment-content {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.comment-date {
    font-size: 0.8rem;
    color: #999;
}

/* Thème switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: var(--border-color);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    background-color: var(--bg-secondary);
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider .fas {
    color: var(--text-primary);
    font-size: 12px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.slider .fa-sun {
    left: 6px;
}

.slider .fa-moon {
    right: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--nav-bg);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px var(--card-shadow);
        z-index: 1000;
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 1rem 2rem;
        display: block;
        width: 100%;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .jokes-grid {
        grid-template-columns: 1fr;
    }
    
    .joke-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1rem;
    }

    .nav-right {
        gap: 1rem;
    }

    .auth-buttons .btn,
    .user-info .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .joke-card {
        padding: 1.5rem;
    }
    
    .form-container {
        padding: 1.5rem;
    }

    .joke-votes {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .joke-score {
        width: 100%;
        text-align: center;
        margin: 0.5rem 0;
    }
}

/* Administration */
.admin-container {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px var(--card-shadow);
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover {
    color: #667eea;
}

.admin-tab-content {
    display: none;
}

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

.category-management h3 {
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--comment-bg);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.category-name {
    font-weight: 600;
    color: var(--text-primary);
}

.category-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-delete-category {
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.btn-delete-category:hover {
    background: #c82333;
}

.admin-joke-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.admin-joke-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--text-tertiary);
}

.admin-joke-item[data-score="neutral"]::after {
    background: #ffd700; /* Jaune */
}

.admin-joke-item[data-score="positive"]::after {
    background: #1e90ff; /* Bleu */
}

.admin-joke-item[data-score="very-positive"]::after {
    background: #32cd32; /* Vert */
}

.admin-joke-item[data-score="negative"]::after {
    background: #ffa500; /* Orange */
}

.admin-joke-item[data-score="very-negative"]::after {
    background: #ff4444; /* Rouge */
}

.admin-joke-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.votes-stats {
    display: flex;
    gap: 0.5rem;
}

.positive-votes {
    color: #32cd32;
}

.negative-votes {
    color: #ff4444;
}

.score-display {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
}

.score-display[data-score="neutral"] {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.score-display[data-score="positive"] {
    background: rgba(30, 144, 255, 0.2);
    color: #1e90ff;
}

.score-display[data-score="very-positive"] {
    background: rgba(50, 205, 50, 0.2);
    color: #32cd32;
}

.score-display[data-score="negative"] {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

.score-display[data-score="very-negative"] {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.creation-date {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.admin-joke-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.admin-joke-info h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.admin-joke-info .category {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
    margin-right: 0.5rem;
}

.admin-joke-info .author {
    background: #28a745;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
}

.admin-joke-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-joke-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-edit {
    background: #ffc107;
    color: #000;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

.admin-joke-content {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 1rem 0;
    color: var(--text-primary);
    white-space: pre-line;
}

/* Formulaires d'authentification */
.form-container small {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

.form-container a {
    color: #667eea;
    text-decoration: none;
}

.form-container a:hover {
    text-decoration: underline;
}

/* Sélection de catégories multiples */
.categories-selection {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-secondary);
}

.category-filter {
    margin-bottom: 1rem;
}

.category-filter input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.category-filter input:focus {
    outline: none;
    border-color: #667eea;
}

.categories-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.categories-checkboxes::-webkit-scrollbar {
    width: 8px;
}

.categories-checkboxes::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.categories-checkboxes::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.categories-checkboxes::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.category-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.category-checkbox:hover {
    background: rgba(102, 126, 234, 0.1);
}

.category-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: #667eea;
}

.category-checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
    color: var(--text-primary);
}

.custom-category {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.custom-category input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.custom-category .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Affichage des catégories dans les cartes */
.joke-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.joke-categories {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.joke-category {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    font-weight: bold;
}

.joke-author {
    background: #28a745;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    
}

.joke-content {
    font-size: 1.33rem;
    line-height: 1.6;
    margin: 0.8rem 0;
    color: rgb(47, 47, 47);
    font-weight: bold;
    white-space: pre-line;
}

[data-theme="dark"] .joke-title {
    color: #fff;
}

[data-theme="dark"] .joke-content {
    color: #ffffff;
}

/* Styles pour le modal de vote */
.vote-modal-content {
    max-width: 400px;
    text-align: center;
}

.vote-slider-container {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.vote-display {
    margin-top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.vote-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.vote-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Styles pour le slider */
input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-webkit-slider-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--border-color);
    border-radius: 5px;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--border-color);
    border-radius: 5px;
    border: none;
}

/* Animation pour le slider */
input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Filtres */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--card-shadow);
}

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

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.filter-group input::placeholder {
    color: var(--text-tertiary);
}

/* Filtres de catégories */
.categories-filter {
    flex: 2;
    min-width: 100%;
    margin-top: 1rem;
    order: 2;
}

.categories-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.8rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.categories-filter-header:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.categories-filter-header span {
    font-weight: 600;
    color: var(--text-primary);
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-icon.active {
    transform: rotate(180deg);
}

.categories-filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.categories-filter-content.active {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
}

.categories-filter-actions {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.btn-clear-categories {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-clear-categories:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.1);
}

.categories-filter-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.category-filter-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.category-filter-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.category-filter-item.selected {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.category-filter-item input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    accent-color: #667eea;
}

.category-filter-item label {
    cursor: pointer;
    user-select: none;
    color: var(--text-primary);
    flex: 1;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .filters {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        margin-bottom: 2rem;
        background: var(--bg-secondary);
        padding: 1rem;
        border-radius: 10px;
        box-shadow: 0 4px 15px var(--card-shadow);
    }
    
    .filter-group {
        width: 100%;
    }
    
    .categories-filter {
        min-width: 100%;
    }
    
    .categories-filter-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

.add-joke-button {
    margin-bottom: 1rem;
    display: flex;
    justify-content: flex-end;
}

.add-joke-button .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-joke-button .btn i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .add-joke-button {
        margin-bottom: 0.5rem;
    }
    
    .add-joke-button .btn {
        width: 100%;
        justify-content: center;
    }
}

.admin-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    line-height: 1.45;
}

.admin-section-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color, rgba(128, 128, 128, 0.25));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.admin-section-row code {
    font-size: 0.85rem;
    opacity: 0.9;
}

.admin-section-row-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-badge-builtin {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.muted {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}