/* SKW Ticketbörse – Look angepasst an wipperfelder-wiesn.de
   Schrift Rubik, Primärfarbe #149dcc, dunkle Navbar/Footer,
   pill-förmige Buttons, abwechselnde Sektionsfarben. */

/* ------------------------------------------------------------------
 * Reset & Basis
 * ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
    --primary:      #149dcc;
    --primary-dark: #0b566f;
    --navbar:       #333333;
    --footer:       #2e2e2e;
    --section-1:    #ffffff;
    --section-2:    #efefef;
    --section-3:    #cccccc;
    --text:         #232323;
    --text-muted:   #767676;
    --border:       #dfdfdf;
    --radius-pill:  100px;
}

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--section-1);
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover { color: var(--primary-dark); text-decoration: underline; }

img { max-width: 100%; }

main { padding: 0; }

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

/* ------------------------------------------------------------------
 * Navbar (dunkel, wie bei der Wiesn-Hauptseite)
 * ------------------------------------------------------------------ */
.boerse-navbar {
    background: var(--navbar);
    color: #ffffff;
    padding: 0.5rem 0;
    min-height: 77px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.boerse-navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}
.boerse-navbar .brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #ffffff;
}
.boerse-navbar .brand:hover { text-decoration: none; color: #ffffff; }
.boerse-navbar .brand img {
    height: 3.8rem;
    width: auto;
}
.boerse-navbar .brand-text {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.2;
}
.boerse-navbar .brand-text small {
    display: block;
    font-size: 0.78rem;
    font-weight: 300;
    opacity: 0.75;
}
.boerse-navbar .nav-link {
    color: #ffffff;
    font-size: 0.95rem;
    padding: 0.4rem 0.9rem;
}
.boerse-navbar .nav-link:hover { color: #c1c1c1; text-decoration: none; }

/* ------------------------------------------------------------------
 * Hero-Sektion (kompakt, dunkel mit Akzent)
 * ------------------------------------------------------------------ */
.hero {
    background:
        linear-gradient(rgba(79, 73, 67, 0.82), rgba(79, 73, 67, 0.92)),
        radial-gradient(circle at 30% 20%, #5a4a3e 0%, #2e2624 100%);
    color: #ffffff;
    padding: 3.5rem 0 3rem;
    text-align: center;
}
.hero h1 {
    font-family: 'Rubik', sans-serif;
    font-size: clamp(2.1rem, 5vw, 4.25rem);
    font-weight: 700;
    margin: 0 0 0.6rem;
    line-height: 1.2;
}
.hero .subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 300;
    margin: 0;
    opacity: 0.92;
}

/* ------------------------------------------------------------------
 * Sektionen (abwechselnd hell/grau wie auf der Wiesn-Seite)
 * ------------------------------------------------------------------ */
section.content {
    padding: 2.5rem 0;
}
section.content + section.content {
    background: var(--section-2);
}
section.content:nth-of-type(odd)   { background: var(--section-1); }
section.content:nth-of-type(even)  { background: var(--section-2); }

/* Headline-Style aus der Wiesn-Seite (display-1) */
section.content h2 {
    font-family: 'Rubik', sans-serif;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin: 0 0 1.5rem;
    line-height: 1.2;
}
section.content h3 {
    font-family: 'Rubik', sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 1.5rem 0 0.6rem;
}
section.content p {
    margin: 0 0 1rem;
}

/* MARKER-INTRO-V3 */
section.content p.intro,
.container > p.intro {
    text-align: center;
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* ------------------------------------------------------------------
 * Notices (Erfolg / Fehler / Info)
 * ------------------------------------------------------------------ */
.notice {
    border-radius: 6px;
    padding: 1rem 1.4rem;
    margin: 1.5rem auto;
    max-width: 700px;
    border: 1px solid transparent;
}
.notice p { margin: 0.3rem 0; }
.notice-success { background: #e3f1e6; border-color: #bbdfc2; color: #2f7d3b; }
.notice-error   { background: #fbe4e2; border-color: #efbab4; color: #a4180a; }
.notice-info    { background: #e6f4fa; border-color: #b8dcec; color: var(--primary-dark); }

/* ------------------------------------------------------------------
 * Filter-Buttons (pill, wie mbr-gallery-filter)
 * ------------------------------------------------------------------ */
.filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
}
.filter strong { margin-right: 0.5rem; }
.filter-btn {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: #ffffff;
    color: var(--text);
    font-size: 0.92rem;
    transition: all 0.2s;
}
.filter-btn span { color: var(--text-muted); margin-left: 0.2em; }
.filter-btn:hover {
    text-decoration: none;
    border-color: var(--primary);
    color: var(--primary);
}
.filter-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}
.filter-btn.active span { color: rgba(255,255,255,0.85); }
.filter-btn.active:hover { background: var(--primary-dark); color: #ffffff; }

/* ------------------------------------------------------------------
 * Listings
 * ------------------------------------------------------------------ */
.listings h2 { margin-bottom: 1.2rem; }

.listing-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: grid;
    gap: 0.9rem;
}
.listing {
    display: flex;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem 1.4rem;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow 0.2s;
}
.listing:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.listing.is-sold { background: #f7f5f0; opacity: 0.78; }
.listing.is-sold .listing-main h3 { text-decoration: line-through; }
.listing-main { flex: 1 1 320px; }
.listing-main h3 {
    margin: 0 0 0.3rem;
    font-size: 1.15rem;
    font-weight: 500;
}
.listing-main .meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.listing-main .meta strong { color: var(--text); }
.listing-main .comment {
    margin-top: 0.6rem;
    padding: 0.5rem 0.8rem;
    background: var(--section-2);
    border-left: 3px solid var(--primary);
    font-size: 0.93rem;
    border-radius: 0 4px 4px 0;
}
.listing-action .hint {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.empty {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px dashed var(--border);
    border-radius: 6px;
}

.badge {
    display: inline-block;
    background: var(--text-muted);
    color: #ffffff;
    font-size: 0.7rem;
    padding: 0.18em 0.6em;
    border-radius: 999px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
    vertical-align: middle;
    text-decoration: none !important;
}

/* ------------------------------------------------------------------
 * Buttons (pill, wie mbr-section-btn)
 * ------------------------------------------------------------------ */
.btn,
button[type="submit"],
.boerse-form button {
    display: inline-block;
    padding: 0.85rem 2.2rem;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #ffffff;
    font-family: 'Rubik', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover,
button[type="submit"]:hover,
.boerse-form button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

button.danger,
.btn.danger {
    background: transparent;
    color: #a4180a;
    border-color: #a4180a;
}
button.danger:hover,
.btn.danger:hover {
    background: #a4180a;
    color: #ffffff;
    border-color: #a4180a;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--text);
}
.btn-outline:hover {
    background: var(--text);
    color: #ffffff;
}

.cancel {
    display: inline-block;
    margin-left: 1rem;
    color: var(--text-muted);
    align-self: center;
}

/* ------------------------------------------------------------------
 * Formulare
 * ------------------------------------------------------------------ */
.form-section {
    background: var(--section-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.8rem;
    margin-top: 2rem;
}
.form-section h2 { text-align: left; margin-top: 0; }
.boerse-form .row { margin-bottom: 1.2rem; }
.boerse-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
}
.boerse-form input[type=text],
.boerse-form input[type=email],
.boerse-form input[type=number],
.boerse-form select,
.boerse-form textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    background: #ffffff;
    color: var(--text);
    transition: border-color 0.2s;
}
.boerse-form input:focus,
.boerse-form select:focus,
.boerse-form textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}
.boerse-form textarea { resize: vertical; min-height: 80px; }
.boerse-form small {
    display: block;
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-size: 0.85rem;
}
.checkbox-row label {
    display: flex;
    gap: 0.6rem;
    font-weight: normal;
    align-items: flex-start;
}
.checkbox-row input[type=checkbox] { margin-top: 0.3rem; flex-shrink: 0; }
.honeypot { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

/* ------------------------------------------------------------------
 * Verwalten-Seite / Key-Value-Tabelle
 * ------------------------------------------------------------------ */
.kv {
    border-collapse: collapse;
    margin: 1.2rem 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
}
.kv th, .kv td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.kv th {
    color: var(--text-muted);
    font-weight: 500;
    background: var(--section-2);
    width: 40%;
}

.inline-form {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem 1.4rem;
    margin: 1rem 0;
}
.inline-form button { margin-right: 1rem; }
.inline-form small {
    color: var(--text-muted);
    display: block;
    margin-top: 0.5rem;
    font-size: 0.88rem;
}

.listing-summary {
    background: var(--section-2);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.2rem;
    margin: 1.5rem 0;
    border-radius: 0 6px 6px 0;
}
.listing-summary p { margin: 0.3rem 0; }
.listing-summary .comment { color: var(--text-muted); font-style: italic; }

/* ------------------------------------------------------------------
 * Footer (dunkel, wie auf der Wiesn-Hauptseite)
 * ------------------------------------------------------------------ */
.boerse-footer {
    background: var(--footer);
    color: rgba(255,255,255,0.85);
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
}
.boerse-footer .container {
    text-align: center;
}
.boerse-footer .disclaimer {
    font-size: 0.92rem;
    font-style: italic;
    max-width: 720px;
    margin: 0 auto 1.5rem;
    color: rgba(255,255,255,0.75);
}
.boerse-footer a {
    color: #ffffff;
    margin: 0 0.6rem;
}
.boerse-footer a:hover { color: var(--primary); text-decoration: none; }
.boerse-footer .footer-links {
    margin-top: 0.5rem;
    font-size: 0.92rem;
}

/* ------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 640px) {
    .boerse-navbar { min-height: 60px; padding: 0.4rem 0; }
    .boerse-navbar .container { flex-direction: row; flex-wrap: wrap; }
    .boerse-navbar .brand img { height: 2.6rem; }
    .boerse-navbar .brand-text { font-size: 0.95rem; }
    .boerse-navbar .nav-link { font-size: 0.85rem; padding: 0.3rem 0.5rem; }

    .hero { padding: 2.5rem 0 2rem; }

    section.content { padding: 1.8rem 0; }

    .listing { padding: 1rem; }
    .listing-action { width: 100%; }
    .listing-action .btn { display: block; text-align: center; }

    .form-section { padding: 1.2rem; }

    .inline-form button { display: block; width: 100%; margin: 0.4rem 0; }
}

/* Admin-Seite kleinere Tabelle */
table.admin {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
    background: #ffffff;
    border: 1px solid var(--border);
}
table.admin th, table.admin td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}
table.admin tr.s-pending  { background: #fffbe6; }
table.admin tr.s-deleted  { color: var(--text-muted); }
table.admin tr.s-sold     { color: #666; }
.admin-actions form { display: inline; }
.admin-actions button {
    font-size: 0.78rem;
    padding: 0.35rem 0.9rem;
}
.filter-bar { margin: 1rem 0; }
.filter-bar a { margin-right: 0.5rem; }
