/* Variables de thème clair (par défaut) */
:root {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #737373;
    --border-color: #e5e5e5;
    --shadow: rgba(0, 0, 0, 0.1);
    --hover-bg: #f5f5f5;
    --accent-color: #1a1a1a;
}

/* Variables de thème sombre */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --hover-bg: #3d3d3d;
    --accent-color: #ffffff;
}

/* Grand Hotel font (local) */
@font-face {
    font-family: 'Grand Hotel';
    src: url('../Grand_Hotel/GrandHotel-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Apply Grand Hotel across the site */
body, h1, h2, h3, h4, h5, h6, .menu-item-name, .participant-name, .table-number {
    font-family: 'Grand Hotel', cursive !important;
}

/* Transitions douces pour le changement de thème */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Application des variables */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.card,
.login-card,
.event-card,
.mode-card {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.theme-toggle,
.logout-btn,
.btn-secondary {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.theme-toggle:hover,
.logout-btn:hover,
.btn-secondary:hover {
    background-color: var(--hover-bg);
}

input,
select,
textarea {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
    background-color: var(--bg-secondary);
    border-color: var(--accent-color);
}

.participants-table thead {
    background-color: var(--bg-tertiary);
}

.participants-table tbody tr:hover {
    background-color: var(--hover-bg);
}

.participants-table td {
    border-bottom-color: var(--border-color);
}

/* Ensure form controls and buttons use Grand Hotel */
button,
.btn,
.button,
input,
select,
textarea,
label {
    font-family: 'Grand Hotel', cursive !important;
}

/* Placeholder text should also use the font */
input::placeholder,
textarea::placeholder {
    font-family: 'Grand Hotel', cursive !important;
    color: var(--text-secondary);
}

/* Specific helper classes for uploads / list actions */
.upload-btn,
.add-btn,
.delete-btn,
.qr-btn {
    font-family: 'Grand Hotel', cursive !important;
}

/* Background slideshow (global) */
.bg-slideshow {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.bg-slideshow .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1200ms ease-in-out, filter 800ms ease;
    will-change: opacity, filter;
    filter: brightness(0.9) saturate(0.9) contrast(0.95);
}

.bg-slideshow .slide.active {
    opacity: 0.34; /* low opacity so images softly blend with bg */
}

.bg-slideshow::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.02), rgba(0,0,0,0.02));
    mix-blend-mode: multiply;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .bg-slideshow .slide { transition: none !important; }
}

/* Bottom navigation for event detail */
.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    display: flex;
    gap: 0.5rem;
    background: rgba(0,0,0,0.04);
    padding: 6px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(2,6,23,0.08);
    z-index: 1001;
}
.bottom-nav button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}
.bottom-nav button.active { background: var(--accent-color); color: var(--bg-primary); }

@media (min-width: 1000px) {
    .bottom-nav { display: none; }
}
