:root {
    --primary: #ff7b00;
    --bg: #000000; /* Fallback */
    --card-bg: rgba(0, 0, 0, 0.9);
    --text: #eee;
}

@font-face {
    font-family: 'Kaushan Script';
    src: url('/static/font/kaushanscript.woff2') format('woff2');
}
@font-face {
    font-family: 'MeowScript';
    src: url('/static/font/meowscript.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    src: url('/static/font/montserrat.woff2') format('woff2');
}
@font-face {
    font-family: 'Borel';
    src: url('/static/font/Borel-Regular.ttf') format('truetype');
}

/* Body & Background */
body {
    font-family: 'Borel', cursive;
    background: url('/static/img/keo-punch-f.jpg') no-repeat center center fixed var(--bg);
    background-size: cover;
    color: var(--text);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Limiter l'étirement de l'image de fond au-delà de 1200px */
@media (min-width: 1200px) {
    body {
        background-size: 1200px auto; /* largeur max = 1200px, hauteur auto */
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* Headings */
h1, h2, h3 {
    color: var(--primary);
}

/* Header */
header {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 1rem 0;
}
nav {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}
.logo {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary);
}
nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    padding: 0;
    margin: 0;
    align-items: center;
}
nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}
nav a:hover {
    color: var(--primary);
}

/* Hero */
.hero {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
}

/* Cards */
.fact-card {
    background: var(--card-bg);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 5px solid var(--primary);
}
.fact-content {
    font-family: 'Borel', cursive;
    font-size: 1.4rem;
    line-height: 1.5;
    margin: 0 0 10px 0;
    color: var(--primary);
    white-space: pre-wrap;
}
.fact-date {
    color: #838c8d;
    font-size: 0.85rem;
}

/* Forms & Search */
.search-bar {
    margin-bottom: 30px;
    position: relative;
}
input[type="text"], textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    color: #333;
}
input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.btn-submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 10px;
}
.btn-submit:hover {
    background: #ff8c00;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    align-items: center;
}
.btn-nav {
    text-decoration: none;
    color: #222;
    border: 1px solid #ddd;
    padding: 5px 15px;
    border-radius: 4px;
    background: white;
}
.btn-nav:hover {
    background: #eee;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #000000;
    color: #bdc3c7;
    font-size: 0.9rem;
    margin-top: auto;
}

/* Utils */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.htmx-indicator {
    display: none;
    font-size: 0.9rem;
    color: #838c8d;
    margin-top: 5px;
}
.htmx-request .htmx-indicator {
    display: block;
}
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}
.error-message .btn-nav {
    display: inline-block;
    margin-top: 10px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
}
.error-message .btn-nav:hover {
    background: #ff8c00;
}

/* Auth Components */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-display {
    font-weight: bold;
    color: var(--primary);
}
.btn-login, .btn-logout {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
    display: inline-block;
}
.btn-login:hover, .btn-logout:hover {
    background: #ff8c00;
    color: white;
}

/* Content pages (about, submit) */
.content-page, .form-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
}

/* User Info on Submit Page */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 123, 0, 0.15);
    border-radius: 8px;
}
.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

/* Login Prompt */
.login-prompt {
    margin-top: 1.5rem;
}
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}
.btn-primary:hover {
    background: #ff8c00;
}

/* Fact Footer & Vote System */
.fact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.fact-vote {
    display: flex;
    align-items: center;
}
.btn-vote {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}
.btn-vote:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}
.btn-vote.voted {
    background: var(--primary);
    color: white;
}
.vote-icon {
    font-size: 1.1rem;
}
.vote-count {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Admin: Unapproved Facts */
.fact-unapproved {
    background: rgba(80, 80, 80, 0.9);
    border-left: 5px solid #888;
}
.badge-unapproved {
    display: inline-block;
    background: #888;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* Admin Action Buttons */
.admin-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-admin {
    padding: 0.3rem 0.75rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s, transform 0.2s;
}
.btn-admin:hover {
    transform: scale(1.05);
}
.btn-approve {
    background: #28a745;
    color: white;
}
.btn-approve:hover {
    background: #218838;
}
.btn-disapprove {
    background: #ffc107;
    color: #333;
}
.btn-disapprove:hover {
    background: #e0a800;
}
.btn-delete {
    background: #dc3545;
    color: white;
}
.btn-delete:hover {
    background: #c82333;
}

em {
    font-size: 0.9rem;       /* un peu plus petit que le texte normal */
    line-height: 1.2;        /* interligne réduit pour compacter le texte */
    color: #f5f5f5;          /* blanc cassé */
    display: block;           /* pour s'assurer que le texte se comporte comme un bloc */
    margin-bottom: 1rem;      /* un petit espace après le texte */
}