/* ============================================================
   PFADFINDER FESTESSEN-PLANER — Shared Styles
   Aesthetic: Warm Woodland Camp · Earthy & Festive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=Nunito:wght@400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --bg:           #f5efe0;
    --bg2:          #ede3cc;
    --surface:      #fdf8f0;
    --surface2:     #f0e8d5;
    --border:       #c9b99a;
    --text:         #2d2016;
    --text2:        #6b5240;
    --text3:        #9c7d62;
    --accent:       #5a8a5a;
    --accent2:      #3d6b3d;
    --amber:        #c97c2e;
    --amber2:       #a85e18;
    --danger:       #c0392b;
    --danger2:      #962d22;
    --success:      #2ecc71;
    --shadow:       rgba(45, 32, 22, 0.12);
    --shadow-lg:    rgba(45, 32, 22, 0.22);
    --radius:       14px;
    --radius-sm:    8px;
    --font-head:    'Lora', Georgia, serif;
    --font-body:    'Nunito', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #1a1309;
        --bg2:          #231a0d;
        --surface:      #2c2010;
        --surface2:     #382b16;
        --border:       #4a3820;
        --text:         #f0e6d3;
        --text2:        #c4a882;
        --text3:        #8a7060;
        --accent:       #6aab6a;
        --accent2:      #88c888;
        --amber:        #e0953a;
        --amber2:       #f0b060;
        --danger:       #e05050;
        --danger2:      #f07070;
        --shadow:       rgba(0, 0, 0, 0.4);
        --shadow-lg:    rgba(0, 0, 0, 0.6);
    }
}

[data-theme="dark"] {
    --bg:           #1a1309;
    --bg2:          #231a0d;
    --surface:      #2c2010;
    --surface2:     #382b16;
    --border:       #4a3820;
    --text:         #f0e6d3;
    --text2:        #c4a882;
    --text3:        #8a7060;
    --accent:       #6aab6a;
    --accent2:      #88c888;
    --amber:        #e0953a;
    --amber2:       #f0b060;
    --danger:       #e05050;
    --danger2:      #f07070;
    --shadow:       rgba(0, 0, 0, 0.4);
    --shadow-lg:    rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
    --bg:           #f5efe0;
    --bg2:          #ede3cc;
    --surface:      #fdf8f0;
    --surface2:     #f0e8d5;
    --border:       #c9b99a;
    --text:         #2d2016;
    --text2:        #6b5240;
    --text3:        #9c7d62;
    --accent:       #5a8a5a;
    --accent2:      #3d6b3d;
    --amber:        #c97c2e;
    --amber2:       #a85e18;
    --danger:       #c0392b;
    --danger2:      #962d22;
    --shadow:       rgba(45, 32, 22, 0.12);
    --shadow-lg:    rgba(45, 32, 22, 0.22);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Subtle texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { color: var(--text2); }
a  { color: var(--amber); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--amber2); }

/* ---------- Layout Helpers ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 1; }
.container--wide { max-width: 1200px; }
.flex { display: flex; gap: 1rem; }
.flex-center { align-items: center; }
.flex-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }

/* ---------- Card ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: 0 2px 12px var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 6px 24px var(--shadow-lg); }
.card--amber { border-left: 4px solid var(--amber); }
.card--green { border-left: 4px solid var(--accent); }

/* ---------- Header ---------- */
.site-header {
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg2) 100%);
    border-bottom: 2px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.site-logo .emblem {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--amber));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 2px 10px var(--shadow);
}

.site-logo .title-group .event-name {
    font-family: var(--font-head);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    display: block;
}

.site-logo .title-group .event-sub {
    font-size: 0.75rem;
    color: var(--text3);
    display: block;
}

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ---------- Theme Toggle ---------- */
.theme-toggle {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.theme-toggle:hover { background: var(--bg2); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    box-shadow: 0 2px 8px rgba(90, 138, 90, 0.35);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(90, 138, 90, 0.45); color: #fff; }

.btn-amber {
    background: linear-gradient(135deg, var(--amber), var(--amber2));
    color: #fff;
    box-shadow: 0 2px 8px rgba(201, 124, 46, 0.35);
}
.btn-amber:hover { filter: brightness(1.1); transform: translateY(-1px); color: #fff; }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger2));
    color: #fff;
}
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); color: #fff; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text2);
}
.btn-outline:hover { background: var(--surface2); color: var(--text); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }

/* ---------- Form Elements ---------- */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }

label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text2);
    letter-spacing: 0.02em;
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(90, 138, 90, 0.15);
    background: var(--surface);
}

textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

.form-hint { font-size: 0.8rem; color: var(--text3); margin-top: 0.2rem; }

input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.checkbox-row label { font-weight: 500; color: var(--text); margin: 0; cursor: pointer; }

/* ---------- Badges / Tags ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.badge-breakfast { background: rgba(201,124,46,0.15); color: var(--amber); border: 1px solid rgba(201,124,46,0.3); }
.badge-dinner    { background: rgba(90,138,90,0.15);  color: var(--accent); border: 1px solid rgba(90,138,90,0.3); }
.badge-both      { background: rgba(107,82,64,0.1);   color: var(--text2);  border: 1px solid var(--border); }

/* ---------- Alert / Flash ---------- */
.alert {
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.alert-success { background: rgba(46,204,113,0.12); border: 1px solid rgba(46,204,113,0.3); color: #1a8a4a; }
.alert-error   { background: rgba(192,57,43,0.12);  border: 1px solid rgba(192,57,43,0.3);  color: var(--danger); }
.alert-info    { background: rgba(201,124,46,0.12); border: 1px solid rgba(201,124,46,0.3); color: var(--amber); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead { background: var(--surface2); }
thead th {
    padding: 0.85rem 1.1rem;
    text-align: left;
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text2);
    letter-spacing: 0.04em;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg2); }

tbody td { padding: 0.8rem 1.1rem; color: var(--text); vertical-align: middle; }

/* ---------- Section Divider ---------- */
.section { padding: 2.5rem 0; }
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.section-title .icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.section-title .icon-amber { background: rgba(201,124,46,0.15); }
.section-title .icon-green { background: rgba(90,138,90,0.15); }

/* ---------- Hero Banner ---------- */
.hero {
    background: linear-gradient(135deg, var(--surface2) 0%, var(--bg2) 100%);
    border-bottom: 2px solid var(--border);
    padding: 3rem 0 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '⚜';
    position: absolute;
    font-size: 18rem;
    opacity: 0.03;
    top: -4rem;
    right: -3rem;
    pointer-events: none;
    line-height: 1;
}

.hero .subtitle {
    font-size: 1rem;
    color: var(--text3);
    margin-top: 0.5rem;
}

.hero .event-meta {
    display: inline-flex;
    gap: 1.5rem;
    margin-top: 1.25rem;
    padding: 0.6rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text2);
    font-weight: 600;
}

/* ---------- Password Gate ---------- */
.gate-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.gate-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 40px var(--shadow-lg);
    text-align: center;
}

.gate-card .gate-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.gate-card h2 { margin-bottom: 0.5rem; }
.gate-card p  { margin-bottom: 1.5rem; font-size: 0.9rem; }

/* ---------- Item Card (Public Form) ---------- */
.item-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.item-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px var(--shadow); }
.item-card.selected { border-color: var(--accent); background: rgba(90,138,90,0.05); }

.item-card .item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.item-card .item-name { font-family: var(--font-head); font-size: 1.05rem; font-weight: 600; }
.item-card .item-desc { font-size: 0.85rem; color: var(--text3); margin-bottom: 0.75rem; }

.contributors {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}
.contributors .contrib-title { font-size: 0.78rem; font-weight: 700; color: var(--text3); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.4rem; }
.contributor-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    margin: 0.15rem;
    color: var(--text2);
}

.expand-fields { margin-top: 0.75rem; }
.expand-fields.hidden { display: none; }

/* ---------- Tab Navigation ---------- */
.tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.3rem;
    margin-bottom: 2rem;
}
.tab-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    border-radius: calc(var(--radius-sm) - 2px);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.tab-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 6px var(--shadow);
}
.tab-btn:hover:not(.active) { color: var(--text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Admin Nav ---------- */
.admin-nav {
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0;
}
.admin-nav ul {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    flex-wrap: wrap;
}
.admin-nav a {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.admin-nav a:hover, .admin-nav a.active { background: var(--surface); color: var(--text); }

/* ---------- Stats Cards ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    text-align: center;
}
.stat-card .stat-num { font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; color: var(--amber); line-height: 1; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text3); margin-top: 0.25rem; font-weight: 600; letter-spacing: 0.04em; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .hero { padding: 2rem 0 1.5rem; }
    .site-header .inner { flex-wrap: wrap; }
    .tabs { flex-direction: column; }
    .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease forwards; }

.card, .item-card { animation: fadeUp 0.35s ease forwards; }

/* ---------- Print ---------- */
@media print {
    .site-header, .admin-nav, .theme-toggle, .btn, .no-print { display: none !important; }
    body { background: white; color: black; }
    table { border: 1px solid #ccc; }
}
