/* ═══════════════════════════════════════════════════════════════════════════
   Filial-Marktplatz – Haupt-Stylesheet  ·  Design angelehnt an viba.de
   Farbwelt: Pink/Himbeere + Gold + warme Cremetöne
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Google Font ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

/* ── Basis ───────────────────────────────────────────────────────────────── */
:root {
    --fm-primary:       #c4003d;   /* Viba-Pink / Himbeere           */
    --fm-primary-dark:  #9e0031;
    --fm-primary-light: #fde8ef;
    --fm-gold:          #c8a227;   /* Viba-Gold                      */
    --fm-gold-light:    #fdf3d6;
    --fm-demand:        #c4003d;
    --fm-surplus:       #2d8a4e;
    --fm-bg:            #fdf6ee;   /* warmes Créme                   */
    --fm-card-bg:       #fffdf9;
    --fm-border:        #ecdcc8;
    --fm-text:          #1a0c02;   /* tiefes Dunkelbraun             */
    --fm-text-muted:    #7a5c3a;
    --fm-radius:        0.75rem;
    --fm-shadow:        0 1px 3px 0 rgba(60,20,0,.08), 0 1px 2px -1px rgba(60,20,0,.06);
    --fm-shadow-md:     0 4px 16px -2px rgba(60,20,0,.12), 0 2px 6px -2px rgba(60,20,0,.08);

    /* Bootstrap-Overrides via CSS-Variablen */
    --bs-body-bg:       #fdf6ee;
    --bs-body-color:    #1a0c02;
    --bs-primary:       #c4003d;
    --bs-primary-rgb:   196, 0, 61;
    --bs-border-color:  #ecdcc8;
    --bs-progress-bar-bg: #c4003d;
}

html, body {
    height: 100%;
}

body {
    background-color: var(--fm-bg);
    color: var(--fm-text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.9375rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5,
.navbar-brand,
.card-header .fw-bold,
.display-6 {
    font-family: 'Playfair Display', Georgia, serif;
}

.container-fluid {
    flex: 1;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
    background: linear-gradient(135deg, #1a0c02 0%, #2d1407 60%, #3d1e0a 100%) !important;
    border-bottom: 3px solid var(--fm-gold);
}

.navbar-brand {
    font-size: 1.15rem;
    letter-spacing: 0.01em;
    color: #fff !important;
}

.navbar-brand i {
    color: var(--fm-gold);
}

.nav-link {
    border-radius: 0.4rem;
    transition: background .15s, color .15s;
    padding-left: .6rem !important;
    padding-right: .6rem !important;
    color: rgba(255,255,255,.85) !important;
}

.nav-link:hover, .nav-link.active {
    background: rgba(200,162,39,.18);
    color: var(--fm-gold) !important;
}

/* Abmelden-Button */
.btn-outline-light {
    border-color: var(--fm-gold);
    color: var(--fm-gold) !important;
}
.btn-outline-light:hover {
    background: var(--fm-gold);
    color: #1a0c02 !important;
    border-color: var(--fm-gold);
}

/* ── Karten ──────────────────────────────────────────────────────────────── */
.card {
    background-color: var(--fm-card-bg);
    border-radius: var(--fm-radius);
    border: 1px solid var(--fm-border);
}

.card-header {
    border-radius: calc(var(--fm-radius) - 1px) calc(var(--fm-radius) - 1px) 0 0;
    font-size: .95rem;
    border-bottom: 1px solid var(--fm-border);
    background-color: #fdf0e0;
}

.card-hover {
    transition: transform .15s, box-shadow .15s;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--fm-shadow-md) !important;
}

/* ── Marktplatz Typ-Header ───────────────────────────────────────────────── */
.type-header-demand {
    background: linear-gradient(135deg, #fde8ef, #fcd0df);
    color: #7a001e;
    border-bottom: 2px solid #f9a8c4;
}

.type-header-surplus {
    background: linear-gradient(135deg, #e8f5ee, #c6e8d2);
    color: #145228;
    border-bottom: 2px solid #86efac;
}

/* ── Listing-Karten in der Liste ─────────────────────────────────────────── */
.listing-card {
    transition: background .12s;
    border-color: var(--fm-border) !important;
    background-color: var(--fm-card-bg);
}

.listing-card:hover {
    background-color: #fdf0e0 !important;
}

.listing-card:last-child {
    border-bottom: none !important;
}

/* ── Offer-Status ────────────────────────────────────────────────────────── */
.offer-item-accepted { background-color: #f0fdf4; }
.offer-item-rejected { background-color: #fef2f2; opacity: .75; }
.offer-item-pending  { background-color: #fffbeb; }

/* ── Statistik-Karten ────────────────────────────────────────────────────── */
.stat-card {
    border-radius: var(--fm-radius);
    transition: transform .15s;
}

.stat-card:hover { transform: translateY(-3px); }

.stat-icon {
    font-size: 2rem;
    opacity: .85;
}

.stat-mini-card {
    border-radius: .5rem;
    min-height: 80px;
}

/* ── Login-Seite ─────────────────────────────────────────────────────────── */
.login-page {
    background: linear-gradient(135deg, #1a0c02 0%, #3d1407 40%, #c4003d 100%);
}

.login-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #c4003d, #9e0031);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(196,0,61,.4);
}

.login-page .card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    background: var(--fm-card-bg);
}

/* ── Filial-Profil ───────────────────────────────────────────────────────── */
.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fde8ef, #fcd0df);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--fm-primary);
}

/* ── Fortschrittsbalken ──────────────────────────────────────────────────── */
.progress {
    background-color: #e8d5c0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 999px;
    transition: width .7s cubic-bezier(.4,0,.2,1);
}

/* Viba-Pink als primary Progress-Farbe */
.progress-bar.bg-primary {
    background-color: var(--fm-primary) !important;
}

.progress-bar.bg-warning {
    background-color: var(--fm-gold) !important;
}

/* ── Tabellen ────────────────────────────────────────────────────────────── */
.table-responsive {
    border-radius: 0 0 var(--fm-radius) var(--fm-radius);
}

.table > :not(caption) > * > * {
    padding: .65rem 1rem;
}

.table-hover > tbody > tr:hover > * {
    background-color: #fdf0e0;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    letter-spacing: .01em;
}

.badge.bg-primary {
    background-color: var(--fm-primary) !important;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    border-radius: .5rem;
    font-weight: 500;
    font-size: .875rem;
    transition: all .15s;
}

.btn-primary {
    background: var(--fm-primary);
    border-color: var(--fm-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--fm-primary-dark);
    border-color: var(--fm-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(196,0,61,.35);
}

.btn-lg { font-size: 1rem; padding: .65rem 1.5rem; }

/* Gold-Accent Button */
.btn-gold {
    background: var(--fm-gold);
    border-color: var(--fm-gold);
    color: #1a0c02;
}
.btn-gold:hover {
    background: #a8861e;
    border-color: #a8861e;
    color: #1a0c02;
}

/* ── Formulare ───────────────────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: .5rem;
    border-color: #d5bfa0;
    font-size: .9375rem;
    background-color: #fffdf9;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--fm-primary);
    box-shadow: 0 0 0 3px rgba(196,0,61,.15);
    background-color: #fffdf9;
}

.form-label {
    font-size: .875rem;
    margin-bottom: .3rem;
    color: var(--fm-text-muted);
    font-weight: 500;
}

.input-group-text {
    background: #fdf0e0;
    border-color: #d5bfa0;
    color: var(--fm-text-muted);
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
    border-radius: .6rem;
    border-left-width: 3px;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--fm-border);
    background-color: #fdf0e0;
}

/* ── Dropdown ────────────────────────────────────────────────────────────── */
.dropdown-menu {
    border-radius: .65rem;
    border: 1px solid var(--fm-border);
    box-shadow: var(--fm-shadow-md);
    padding: .35rem;
    background-color: var(--fm-card-bg);
}

.dropdown-item {
    border-radius: .4rem;
    padding: .45rem .8rem;
    font-size: .875rem;
    color: var(--fm-text);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--fm-primary-light);
    color: var(--fm-primary);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .container-fluid { padding-left: 1rem; padding-right: 1rem; }
    h4.fw-bold { font-size: 1.1rem; }
    .display-6 { font-size: 1.5rem; }
    .table > :not(caption) > * > * { padding: .5rem .75rem; }
}

/* ── Animationen ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn .2s ease-out;
}

/* ── Scrollbalken (Webkit) ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #fdf6ee; }
::-webkit-scrollbar-thumb { background: #d5bfa0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b89878; }

/* ── Filial-Info Button ──────────────────────────────────────────────────── */
.btn.branch-info-btn {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    vertical-align: baseline;
    background: none;
    border: none;
    text-decoration: none;
    cursor: pointer;
}

.btn.branch-info-btn:hover,
.btn.branch-info-btn:focus {
    color: var(--fm-primary) !important;
    text-decoration: underline !important;
    background: none;
    box-shadow: none;
}

/* ── btn-check Labels ────────────────────────────────────────────────────── */
.btn-check + .btn {
    transition: all .2s;
    border-width: 2px;
}

.btn-check:checked + .btn {
    box-shadow: 0 0 0 3px rgba(196,0,61,.15);
}

/* ── Gold-Trennlinie für Sektionen ──────────────────────────────────────── */
.section-divider {
    border-color: var(--fm-gold);
    opacity: .35;
}

/* ── Text-Farb-Helfer ────────────────────────────────────────────────────── */
.text-primary { color: var(--fm-primary) !important; }
.text-gold    { color: var(--fm-gold) !important; }
