/* =====================================================
   StableOSX – Public CSS (Besucheransicht)
===================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ── */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.header-left  { display: flex; align-items: center; gap: 16px; }
.header-center { flex: 1; text-align: center; }
.header-right { display: flex; align-items: center; }

.back-btn {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.15s;
}
.back-btn:hover { color: var(--gold); }

.site-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-name { font-size: 17px; color: var(--text-primary); }
.logo-name em { font-style: normal; color: var(--gold); }

.stable-title {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-login-btn {
    font-family: var(--font-ui);
    font-size: 11px;
    background: transparent;
    border: 1px solid var(--border-mid);
    color: var(--gold);
    padding: 5px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    letter-spacing: 1px;
    transition: background 0.15s;
}
.admin-login-btn:hover { background: var(--bg-card-2); }

/* ── HERO / STATS ── */
.hero {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 20px;
}
.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.hero-stats { display: flex; gap: 10px; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 18px;
    text-align: center;
}
.stat-card.stat-green  { border-color: var(--green-border); background: var(--green-bg); }
.stat-card.stat-yellow { border-color: var(--yellow-border); background: var(--yellow-bg); }
.stat-num { font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-card.stat-green  .stat-num { color: var(--green); }
.stat-card.stat-yellow .stat-num { color: var(--yellow); }
.stat-label { font-family: var(--font-ui); font-size: 10px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 3px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: 12px; color: var(--text-muted); }
.dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.dot-green  { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-red    { background: var(--red); }
.dot-purple { background: var(--purple); }

/* ── TABS ── */
.pub-tabs {
    display: flex;
    gap: 4px;
    padding: 14px 20px 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    max-width: 100%;
    overflow-x: auto;
}
.pub-tab {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 7px 18px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    bottom: -1px;
    white-space: nowrap;
}
.pub-tab:hover { color: var(--text-primary); background: var(--bg-card); }
.pub-tab.active { color: var(--gold); background: var(--bg-card); border-color: var(--border-mid); border-bottom-color: var(--bg-card); }

/* ── MAIN ── */
.main-content { flex: 1; max-width: 1200px; margin: 0 auto; width: 100%; padding: 0 20px 60px; }

/* ── STALLPLAN ── */
.pub-section { }
.pub-plan-wrap { overflow-x: auto; padding: 24px 0; }
.pub-plan-grid {
    display: grid;
    gap: 8px;
    padding: 20px;
    background:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 108px 92px;
    background-position: -8px -8px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: fit-content;
}
.pub-cell-empty { width: 100px; height: 84px; }

/* ── BOX KACHELN ── */
.pub-box {
    width: 100px;
    height: 84px;
    border-radius: 9px;
    border: 1.5px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pub-box:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 5; }
.pub-box-available   { background: var(--green-bg);  border-color: var(--green-border); }
.pub-box-soon        { background: var(--yellow-bg); border-color: var(--yellow-border); }
.pub-box-unavailable { background: var(--red-bg);    border-color: var(--red-border); }
.pub-box-reserved    { background: var(--purple-bg); border-color: var(--purple-border); }
.pub-box-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.2; }
.pub-box-num { font-family: var(--font-ui); font-size: 11px; font-weight: 700; letter-spacing: 0.5px; position: relative; z-index: 1; text-align: center; }
.pub-box-available   .pub-box-num { color: var(--green); }
.pub-box-soon        .pub-box-num { color: var(--yellow); }
.pub-box-unavailable .pub-box-num { color: var(--red); }
.pub-box-reserved    .pub-box-num { color: var(--purple); }
.pub-box-price, .pub-box-date { font-family: var(--font-ui); font-size: 10px; color: var(--text-muted); position: relative; z-index: 1; }
.pub-box-status-dot { position: absolute; bottom: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; }
.pub-box-available   .pub-box-status-dot { background: var(--green); }
.pub-box-soon        .pub-box-status-dot { background: var(--yellow); }
.pub-box-unavailable .pub-box-status-dot { background: var(--red); }
.pub-box-reserved    .pub-box-status-dot { background: var(--purple); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-dim); }
.empty-state p { font-family: var(--font-ui); font-size: 14px; }

/* ── MODAL ── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(2px); }
.modal-box {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 17px; color: var(--text-primary); }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius); transition: color 0.15s; }
.modal-close:hover { color: var(--text-primary); }

/* Detail-Modal Inhalte */
.detail-status { display: inline-block; padding: 3px 10px; border-radius: 4px; font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: 0.5px; margin-bottom: 10px; }
.detail-status-available   { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-border); }
.detail-status-soon        { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-border); }
.detail-status-unavailable { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-border); }
.detail-status-reserved    { background: var(--purple-bg); color: var(--purple); border: 1px solid var(--purple-border); }
.detail-price { background: rgba(0,0,0,0.2); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 5px; }
.detail-price-row { display: flex; justify-content: space-between; font-family: var(--font-ui); font-size: 13px; color: var(--text-muted); }
.detail-price-extra { font-size: 12px; }
.detail-price-total { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 3px; font-weight: 700; font-size: 15px; color: var(--text-primary); }
.detail-contact { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0; }
.detail-contact a { font-family: var(--font-ui); font-size: 13px; color: var(--gold); text-decoration: none; }
.detail-contact a:hover { text-decoration: underline; }

/* ── BUTTONS ── */
.btn-contact {
    font-family: var(--font-ui);
    font-size: 13px;
    background: var(--gold);
    color: var(--bg);
    border: none;
    border-radius: var(--radius);
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: background 0.15s;
}
.btn-contact:hover { background: var(--gold-light); }
.btn-contact:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── FORMS ── */
.setup-form { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
label { font-family: var(--font-ui); font-size: 12px; color: var(--text-muted); }
input[type="text"], input[type="email"], input[type="tel"], textarea {
    background: var(--bg);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
    width: 100%;
    transition: border-color 0.15s;
}
input:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 80px; }

/* ── FOOTER ── */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    margin-top: auto;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.footer-promo { font-family: var(--font-ui); font-size: 12px; color: var(--text-dim); }
.footer-promo a { color: var(--gold); text-decoration: none; font-weight: 500; }
.footer-promo a:hover { text-decoration: underline; }
.footer-right { font-family: var(--font-ui); font-size: 11px; color: var(--text-dim); }
.footer-right a { color: var(--gold); text-decoration: none; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .hero-inner { flex-direction: column; align-items: flex-start; }
    .header-center { display: none; }
    .form-row { flex-direction: column; }
    .pub-plan-grid { min-width: unset; }
}
