/* ═══════════════════════════════════════════════════
   Banquet des Troubadours — Styles unifiés
   Thème médiéval : or, rouge, pierre, parchemin
   ═══════════════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --rouge: #8B1A1A;
    --rouge-fonce: #5C0E0E;
    --or: #C9A84C;
    --or-clair: #D4B55A;
    --pierre: #2C2420;
    --pierre-clair: #3D322B;
    --parchemin: #E8DCC8;
    --parchemin-fonce: #C4B598;
    --blanc: #FDF8F0;
}

body {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    background: var(--pierre);
    color: var(--parchemin);
    line-height: 1.7;
    font-size: 1.15rem;
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(139,26,26,0.15) 0%, transparent 70%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence baseFrequency="0.8"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.03"/></svg>');
}

h1, h2, h3, h4 {
    font-family: 'Cinzel', Georgia, serif;
    color: var(--or);
    letter-spacing: 0.0625em;
    text-shadow: 0 0 30px rgba(201,168,76,0.15);
}

a { color: var(--or); text-decoration: none; transition: color 0.2s, text-shadow 0.2s; }
a:hover { color: var(--or-clair); text-shadow: 0 0 15px rgba(201,168,76,0.3); }

/* ── Container ── */
.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Skip link (accessibilité) ── */
.skip-link {
    position: absolute; top: -100px; left: 0;
    background: var(--or); color: var(--pierre);
    padding: 0.5rem 1rem; z-index: 9999;
    font-family: 'Cinzel', serif; font-weight: 700;
}
.skip-link:focus { top: 0; }

/* ── Header ── */
header[role="banner"], header {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    border-bottom: 2px solid var(--or);
    margin-bottom: 2rem;
    background: linear-gradient(to bottom, rgba(92,14,14,0.4), transparent);
    position: relative;
}
header::after {
    content: '';
    display: block;
    width: 60px; height: 12px;
    margin: 0.8rem auto -1.7rem;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 12"><polygon points="30,0 36,6 30,12 24,6" fill="%23C9A84C"/></svg>') center/contain no-repeat;
}
header .logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 12px rgba(201,168,76,0.3));
}
header .soustitre {
    color: var(--parchemin-fonce);
    font-style: italic;
    font-size: 1.1rem;
}

/* ── Cards ── */
.card {
    background: var(--pierre-clair);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(201,168,76,0.3);
    padding-bottom: 0.5rem;
}
.card.compact { padding: 0.8rem 1rem; }
.card-success { background: #1A3A2A; border-color: #2D6A4F; }
.card-success h2 { color: #6ECB8A; }
.card-error   { background: #3A1A1A; border-color: #6A2D2D; }
.card-error   h2 { color: #CB6E6E; }

/* ── Card corners (gold filigree) ── */
.card-ornate {
    position: relative;
    border: 2px solid rgba(201,168,76,0.3);
}
.card-ornate::before,
.card-ornate::after {
    content: '';
    position: absolute;
    width: 30px; height: 30px;
    border-style: solid;
    border-color: var(--or);
    pointer-events: none;
    z-index: 0;
}
.card-ornate::before {
    top: -1px; left: -1px;
    border-width: 2px 0 0 2px;
    border-radius: 4px 0 0 0;
}
.card-ornate::after {
    bottom: -1px; right: -1px;
    border-width: 0 2px 2px 0;
    border-radius: 0 0 4px 0;
}

/* ── Medieval blockquote ── */
.medieval-quote {
    font-style: italic;
    color: var(--parchemin-fonce);
    border-left: 3px solid var(--or);
    padding: 0.8rem 1.5rem;
    margin: 1rem 0;
    line-height: 1.8;
}
.hero .medieval-quote {
    text-align: center;
    border: none;
    font-size: 1.2rem;
}

/* ── Forms ── */
label {
    display: block;
    margin: 1rem 0 0.3rem;
    color: var(--or);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 0.0625em;
}
input, select, textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 3px;
    background: var(--pierre);
    color: var(--parchemin);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: 3px solid var(--or);
    outline-offset: 2px;
    border-color: var(--or);
}
button:focus-visible, a:focus-visible, .btn:focus-visible {
    outline: 3px solid var(--or);
    outline-offset: 2px;
}
textarea { min-height: 100px; resize: vertical; }

/* ── Buttons ── */
button, .btn {
    background: linear-gradient(to bottom, var(--or), #A88A30);
    color: var(--pierre);
    border: none;
    padding: 1rem 2rem;
    border-radius: 3px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    margin-top: 1.2rem;
    transition: background 0.2s, transform 0.1s;
}
button:hover, .btn:hover {
    background: linear-gradient(to bottom, var(--or-clair), var(--or));
    color: var(--pierre);
}
button:active { transform: scale(0.98); }

.btn-small { width: auto; padding: 0.5rem 1.5rem; font-size: 0.8rem; display: inline-block; }
.btn-sm     { padding: 0.3rem 0.8rem; font-size: 0.7rem; letter-spacing: 0.5px; width: auto; display: inline-block; }
.btn-danger { background: linear-gradient(to bottom, var(--rouge), var(--rouge-fonce)); color: var(--parchemin) !important; }
.btn-danger:hover { background: var(--rouge); }
.btn-outline { background: transparent; border: 1px solid var(--or); color: var(--or) !important; }
.btn-outline:hover { background: rgba(201,168,76,0.1); }
.btn-refund { border-color: #B06ECB; color: #B06ECB !important; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.7rem; text-align: left; border-bottom: 1px solid rgba(201,168,76,0.15); }
th { color: var(--or); font-family: 'Cinzel', serif; font-weight: 400; font-size: 0.85rem; letter-spacing: 0.0625em; }
tr:hover { background: rgba(201,168,76,0.04); }
th.w180 { width: 180px; }

/* ── Status cards (legacy) — voir .card-success / .card-error ci-dessus ── */

/* ── Gallery ── */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin: 1.5rem 0;
}
.gallery img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 3px;
    border: 2px solid rgba(201,168,76,0.3);
    transition: border-color 0.2s, box-shadow 0.3s, transform 0.3s;
    filter: sepia(0.2) brightness(0.9);
}
.gallery img.logo-gallery {
    width: auto;
    max-width: 180px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(201,168,76,0.3));
    border: none;
    margin: 0 auto;
}
.gallery img:hover {
    border-color: var(--or);
    box-shadow: 0 0 20px rgba(201,168,76,0.3);
    transform: scale(1.03);
}
.gallery img.logo-gallery:hover {
    transform: none;
    box-shadow: none;
}

/* ── Footer ── */
footer[role="contentinfo"], footer {
    text-align: center;
    padding: 2.5rem 1rem;
    border-top: 1px solid rgba(201,168,76,0.2);
    margin-top: 3rem;
    color: rgba(196,181,152,0.4);
    font-size: 0.9rem;
    position: relative;
}
footer::before {
    content: '';
    display: block;
    width: 80px; height: 12px;
    margin: 0 auto 1.2rem;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 12"><polygon points="40,0 48,8 40,12 32,8" fill="%23C9A84C" opacity="0.4"/></svg>') center/contain no-repeat;
}
footer a { color: rgba(196,181,152,0.5); }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 2rem 0;
    position: relative;
}
.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    text-shadow: 0 0 40px rgba(201,168,76,0.25), 0 2px 4px rgba(0,0,0,0.5);
    line-height: 1.4;
}
.hero::before,
.hero::after {
    content: '';
    display: block;
    width: 120px;
    height: 2px;
    margin: 0 auto 1.2rem;
    background: linear-gradient(to right, transparent, var(--or), transparent);
}
.hero::after {
    margin: 1.2rem auto 0;
}
.hero .decorative-line {
    display: block;
    width: 80px; height: 12px;
    margin: 1rem auto;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 12"><polygon points="40,0 48,8 40,12 32,8" fill="%23C9A84C"/><circle cx="15" cy="6" r="3" fill="%23C9A84C" opacity="0.6"/><circle cx="65" cy="6" r="3" fill="%23C9A84C" opacity="0.6"/></svg>') center/contain no-repeat;
}

/* ── Ornamental section divider ── */
.section-ornament {
    display: flex; align-items: center; gap: 1rem;
    margin: 2.5rem 0;
    color: var(--or);
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    letter-spacing: 2px;
}
.section-ornament::before,
.section-ornament::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--or), transparent);
}
.section-ornament span { flex-shrink: 0; }

/* ── Drop cap ── */
.drop-cap::first-letter {
    float: left;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 3.5rem;
    line-height: 0.8;
    padding-right: 0.5rem;
    padding-top: 0.3rem;
    color: var(--or);
    text-shadow: 0 0 15px rgba(201,168,76,0.4);
}

/* ── Parchment overlay on cards ── */
.card {
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9"/></filter><rect width="200" height="200" filter="url(%23n)" opacity="1"/></svg>');
    pointer-events: none;
    z-index: 0;
}
.card > * { position: relative; z-index: 1; }

/* ── Enhanced buttons ── */
button, .btn {
    box-shadow: 0 2px 8px rgba(201,168,76,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
button:hover, .btn:hover {
    box-shadow: 0 4px 16px rgba(201,168,76,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════
   ADMIN LAYOUT
   ═══════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; min-width: 220px; background: var(--pierre-clair);
    border-right: 1px solid rgba(201,168,76,0.2); padding: 1.5rem 0;
}
.sidebar .logo-admin { text-align: center; margin-bottom: 1.5rem; }
.sidebar .logo-admin img { max-width: 120px; height: auto; }
.sidebar .logo-admin p { font-size: 0.7rem; color: var(--parchemin-fonce); margin-top: 0.3rem; letter-spacing: 0.0625em; }
.sidebar nav a {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.7rem 1.5rem; color: var(--parchemin); font-size: 0.95rem;
    transition: background 0.15s; border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(201,168,76,0.08); border-left-color: var(--or); color: var(--or);
}
.sidebar nav a .badge { background: var(--rouge); color: var(--blanc); font-size: 0.7rem;
    padding: 0.1rem 0.4rem; border-radius: 3px; margin-left: auto; }
.sidebar .user-info {
    padding: 1.5rem; border-top: 1px solid rgba(201,168,76,0.15); margin-top: auto;
    font-size: 0.8rem; color: var(--parchemin-fonce);
}

.main { flex: 1; padding: 1.5rem 2rem; max-width: calc(100vw - 220px); overflow-x: auto; }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--pierre-clair); border: 1px solid rgba(201,168,76,0.2); border-radius: 4px; padding: 1.2rem; text-align: center; }
.stat-card .stat-num { font-size: 2rem; color: var(--or); font-family: 'Cinzel', serif; }
.stat-card .stat-label { font-size: 0.85rem; color: var(--parchemin-fonce); margin-top: 0.2rem; }

/* ── Badges ── */
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.75rem; font-weight: 600; }
.badge-confirmed { background: #1A3A2A; color: #6ECB8A; }
.badge-pending   { background: #3A2E1A; color: #D4A04A; }
.badge-cancelled { background: #3A1A1A; color: #CB6E6E; }
.badge-expired   { background: #222; color: #888; }
.badge-ouvert    { background: #1A3A2A; color: #6ECB8A; }
.badge-complet   { background: #3A2E1A; color: #D4A04A; }
.badge-annulé    { background: #3A1A1A; color: #CB6E6E; }
.badge-refunded  { background: #2A1A3A; color: #B06ECB; }

/* ── Progress bar ── */
.progress-bar {
    height: 20px; background: var(--pierre); border-radius: 3px; overflow: hidden;
    margin-top: 0.3rem;
}
.progress-fill {
    height: 100%; background: linear-gradient(to right, var(--rouge), var(--or));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; color: var(--pierre); font-weight: bold; transition: width 0.3s;
}

/* ── Search bar ── */
.search-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.search-bar input, .search-bar select { width: auto; max-width: 250px; }

/* ── Alerts ── */
.alert { padding: 0.8rem 1rem; border-radius: 3px; margin-bottom: 1rem; }
.alert-error { background: #3A1A1A; border: 1px solid #6A2D2D; color: #CB6E6E; }
.alert-success { background: #1A3A2A; border: 1px solid #2D6A4F; color: #6ECB8A; }

/* ── Bar chart ── */
.bar-chart { display: flex; gap: 0.3rem; align-items: flex-end; height: 120px; padding: 0.5rem 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
.bar { width: 100%; max-width: 50px; background: var(--or); border-radius: 3px 3px 0 0; min-height: 4px; transition: height 0.4s; }
.bar-label { font-size: 0.65rem; color: var(--parchemin-fonce); margin-top: 0.3rem; text-align: center; }

/* ═══════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════ */

/* ── Display / Flex ── */
.flex       { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.flex-inline { display: inline-flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.flex-col   { display: flex; flex-direction: column; gap: 0.5rem; }
.gap-sm     { gap: 0.5rem; }
.gap-xs     { gap: 0.3rem; }
.align-end  { align-items: flex-end; }

/* ── Spacing ── */
.mb-05  { margin-bottom: 0.5rem; }
.mb-1   { margin-bottom: 1rem; }
.mb-15  { margin-bottom: 1.5rem; }
.mt-05  { margin-top: 0.5rem; }
.mt-08  { margin-top: 0.8rem; }
.mt-1   { margin-top: 1rem; }
.mt-12  { margin-top: 1.2rem; }
.mt-15  { margin-top: 1.5rem; }
.mt-2   { margin-top: 2rem; }
.m-0    { margin: 0; }

/* ── Padding ── */
.p-0    { padding: 0; }

/* ── Text ── */
.text-center { text-align: center; }
.text-muted  { color: var(--parchemin-fonce); }
.text-gold   { color: var(--or); }
.text-sm     { font-size: 0.85rem; }
.text-xs     { font-size: 0.8rem; }
.text-xxs    { font-size: 0.75rem; }
.fw-bold     { font-weight: bold; }
.ff-cinzel   { font-family: 'Cinzel', serif; }
.nowrap      { white-space: nowrap; }

/* ── Width / Max-width ── */
.w-auto     { width: auto; }
.w-50       { width: 50px; }
.w-80       { width: 80px; }
.w-120      { width: 120px; }
.mw-sm      { max-width: 420px; }
.mw-md      { max-width: 500px; }
.mw-lg      { max-width: 550px; }
.mw-xl      { max-width: 600px; }

/* ── Display ── */
.inline     { display: inline; }
.inline-block { display: inline-block; }

/* ── Overflow ── */
.overflow-x { overflow-x: auto; }

/* ── Separator ── */
hr.divider  { border-color: rgba(201,168,76,0.15); margin: 1.5rem 0; }

/* ── Reservation tariffs row ── */
.tarif-row {
    display: flex; align-items: center; gap: 0.8rem;
    margin-bottom: 0.8rem; padding: 0.8rem;
    background: var(--pierre); border-radius: 3px;
    border: 1px solid rgba(201,168,76,0.15);
}
.tarif-row .tarif-info { flex: 1; min-width: 0; }
.tarif-row .tarif-qty   { display: flex; align-items: center; gap: 0.3rem; flex-shrink: 0; }
.tarif-row .tarif-label { margin: 0; cursor: pointer; flex: 1; min-width: 0; }

/* Extras (checkbox) row — align top for multi-line labels */
.tarif-row-extra {
    align-items: flex-start;
}
.tarif-row-extra input[type="checkbox"] {
    margin-top: 3px; flex-shrink: 0;
    width: 20px; height: 20px;
    accent-color: var(--or);
}

.qty-btn {
    width: 32px; height: 32px;
    background: var(--pierre-clair);
    border: 1px solid rgba(201,168,76,0.3);
    color: var(--or); border-radius: 3px;
    cursor: pointer; font-size: 1.2rem; line-height: 1;
}
.qty-input {
    width: 50px; text-align: center; padding: 0.4rem;
}
.reservation-note {
    min-height: 60px; width: 100%; padding: 0.8rem;
    border: 1px solid rgba(201,168,76,0.3); border-radius: 3px;
    background: var(--pierre); color: var(--parchemin);
    font-family: inherit; font-size: 1.1rem; resize: vertical;
}

/* ── Admin login page ── */
.login-page {
    max-width: 420px; margin: 6rem auto;
}
.login-page .login-header {
    text-align: center; margin-bottom: 2rem;
}
.login-page .login-header img {
    width: 180px; margin-bottom: 0.5rem;
}
.login-page .login-header .regie {
    color: var(--parchemin-fonce);
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
}

/* ── Maintenance page ── */
.maintenance-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; text-align: center;
}
.maintenance-card {
    background: var(--pierre-clair);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 4px;
    padding: 3rem 2rem;
    max-width: 550px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.maintenance-card h1 {
    font-family: 'Cinzel', Georgia, serif;
    color: var(--or);
    font-size: 2rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}
.maintenance-card p { margin-bottom: 0.8rem; }
.maintenance-card .medieval {
    font-style: italic;
    color: var(--parchemin-fonce);
    border-left: 3px solid var(--or);
    padding: 0.8rem 1.5rem;
    margin-top: 1.5rem;
    text-align: left;
}
.maintenance-card img { width: 200px; margin-bottom: 1.5rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; min-width: 100%; padding: 0.5rem 0; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 0; }
    .sidebar nav a { padding: 0.5rem 0.8rem; font-size: 0.8rem; border-left: none; border-bottom: 2px solid transparent; }
    .sidebar nav a.active { border-left: none; border-bottom-color: var(--or); }
    .sidebar .logo-admin, .sidebar .user-info { display: none; }
    .main { max-width: 100%; padding: 1rem; }
}

@media (max-width: 600px) {
    header .logo { max-width: 200px; }
    .card { padding: 1.2rem; }
    .hero h1 { font-size: 1.5rem; }
    .card h2 { font-size: 1.2rem; }

    /* Bigger touch targets for qty buttons */
    .qty-btn {
        width: 44px; height: 44px;
        font-size: 1.4rem;
        display: flex; align-items: center; justify-content: center;
    }
    .qty-input { width: 44px; font-size: 1rem; padding: 0.5rem; }

    /* Resize checkbox for touch */
    .tarif-row-extra input[type="checkbox"] {
        width: 24px; height: 24px;
    }

    /* Reduce button size */
    button, .btn { padding: 0.8rem 1.5rem; font-size: 0.9rem; }

    /* Tighter tarif rows on small screens */
    .tarif-row { gap: 0.5rem; padding: 0.6rem; }
    .tarif-row .tarif-info { font-size: 0.9rem; }
    .tarif-row .tarif-info .text-sm { font-size: 0.75rem; }

    /* Smaller decorative ornaments */
    .section-ornament { font-size: 0.8rem; margin: 1.5rem 0; gap: 0.5rem; }
    .hero::before, .hero::after { width: 80px; }
}
