/* =========================
   LOGIN
========================= */

.login-body {
    background-color: #1a1111;
    color: #f5f5f5;
    min-height: 100vh;
}

.login-wrapper {
    max-width: 420px;
    margin: 0 auto;
}

.login-card {
    background-color: #2a1818;
    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 16px;

    padding: 2rem;

    box-shadow:
        0 0 25px rgba(0,0,0,0.35);
}

.login-title {
    color: #ffffff;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-heading {
    text-align: left;
}

.login-title-with-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
}

.login-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.login-subtitle {
    color: rgba(255,255,255,0.7);
    margin-bottom: 0;
}

.login-card .form-label {
    color: #f5f5f5;
}

.login-card input {
    width: 100%;

    background-color: #3a2424 !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 8px;

    color: #ffffff !important;

    padding: 0.45rem 0.75rem;
}

.login-card input:focus {
    background-color: #3a2424 !important;

    border-color: rgba(255,255,255,0.2) !important;

    box-shadow: none !important;

    color: #ffffff !important;
}

.login-button {
    display: flex;
    width: 100%;
    justify-content: center;

    margin-top: 0.25rem;
    padding: 0.65rem 1rem;

    border: 1px solid #d08a95;
    border-radius: 8px;
}

.login-card .alert-danger {
    background-color: rgba(220,53,69,0.15);
    border: 1px solid rgba(220,53,69,0.3);
    color: #ffb8c0;
}

/* =========================
   Grundlayout / Theme
========================= */

body {
    background-color: #1c1517;
    color: #f5f5f5;
}

.app-header {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.app-user-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.app-main-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.app-title-row {
    display: flex;
    justify-content: flex-start;
    min-width: 0;
}

.app-title {
    color: #f8f1f2;
}

.app-title-with-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.app-logo {
    width: 75px;
    height: 75px;
    object-fit: contain;
    flex-shrink: 0;
}

.current-user {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #ffffff;
}

.page-title {
    font-size: 1.5rem;
    color: #f5f5f5;
    margin: 0;
}

.logout-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.logout-link {
    display: inline-flex;
    align-items: center;

    background: transparent !important;
    border: none !important;
    box-shadow: none !important;

    color: #ffffff !important;
    text-decoration: none !important;

    padding: 0;
    margin: 0;

    font: inherit;
    line-height: inherit;

    cursor: pointer;
}

.logout-link:hover {
    color: #ffffff !important;
    text-decoration: none !important;
    opacity: 0.8;
}

.user-separator {
    opacity: 0.7;
}

.app-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-left: auto;
}

.desktop-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.mobile-nav {
    display: none;
    position: relative;
}

.mobile-menu-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    color: #f5f5f5;
    font-weight: 500;

    padding: 4px 6px;

    cursor: pointer;
    list-style: none;
}

.mobile-menu-summary::-webkit-details-marker {
    display: none;
}

.mobile-menu-panel {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;

    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;

    min-width: 220px;
    margin-top: 0.5rem;
    padding: 0.75rem;

    background-color: #2a2225;
    border: 1px solid #3a3033;
    border-radius: 14px;

    align-items: flex-end;
    text-align: right;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.mobile-menu-link {
    display: block;
    padding: 0.45rem 0.25rem;
}


/* =========================
   Karten
========================= */

.card,
.form-section {
    background-color: #2a2225;
    color: #f5f5f5;
    border: 1px solid #3a3033;
    border-radius: 14px;
}

.card-title,
.card-text,
.card-body,
.card-body p,
.card-body span,
.card-body div,
.form-section h5,
.form-section label,
.form-label,
.form-check-label {
    color: #f5f5f5;
}

.text-muted {
    color: #b8aeb1 !important;
}


/* =========================
   Buttons / Links
========================= */

.btn-app {
    border-radius: 8px;
    font-weight: 500;
    padding: 6px 14px;
    font-size: 0.9rem;
    transition: transform 0.1s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-app-primary {
    background-color: #7a1f2b;
    color: white;
    border: none;
}

.btn-app-primary:hover {
    background-color: #8f2a38;
    color: white;
}

.btn-app-secondary {
    background-color: #5a4a4f;
    color: white;
    border: none;
}

.btn-app-secondary:hover {
    background-color: #6b5960;
    color: white;
}

.btn-app-ghost {
    background-color: transparent;
    border: 1px solid #d08a95;
    color: #f5f5f5;
}

.btn-app-ghost:hover {
    background-color: #7a1f2b;
    color: white;
}

.btn-app-link {
    background: none;
    border: none;
    color: #f5f5f5;
    font-weight: 500;
    padding: 4px 6px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.btn-app-link:hover {
    color: #d08a95;
    text-decoration: underline;
}

.btn-app.clicked {
    transform: scale(0.85);
    box-shadow: 0 0 0 4px rgba(208, 138, 149, 0.35);
    filter: brightness(1.2);
}


/* =========================
   Formulare allgemein
========================= */

.required-marker {
    color: #d08a95;
    font-weight: 700;
    margin-left: 0.15rem;
}

.required-hint {
    color: #b8aeb1;
    font-size: 0.85rem;
}

.form-control,
.form-select {
    background-color: #33292d;
    border: 1px solid #4a3d42;
    color: #f5f5f5;
}

.form-control:focus,
.form-select:focus {
    background-color: #3a3033;
    border-color: #b57a86;
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(181, 122, 134, 0.22);
}

.form-control::placeholder {
    color: #b8aeb1;
}

.form-select option {
    background-color: #33292d;
    color: #f5f5f5;
}

/* Weisser Dropdown-Pfeil */

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='white' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592c.86 0 1.32 1.013.753 1.658L8.753 11.14a1 1 0 0 1-1.506 0z'/%3e%3c/svg%3e");
}

/* Helle Pfeile bei Zahlenfeldern */

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    filter: invert(1);
    opacity: 1;
}

/* Datumsfelder linksbündig anzeigen, besonders iPad / iPhone Safari */

input[type="date"].form-control {
    text-align: left !important;
}

input[type="date"].form-control::-webkit-date-and-time-value {
    text-align: left !important;
}


/* =========================
   Select2
========================= */

.select2-container--default .select2-selection--single {
    height: 38px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    background-color: #33292d;
    border: 1px solid #4a3d42;
    color: #f5f5f5;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #f5f5f5;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #b8aeb1;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-dropdown {
    background-color: #33292d;
    color: #f5f5f5;
    border: 1px solid #4a3d42;
}

.select2-container--default .select2-results > .select2-results__options {
    background-color: #33292d;
    color: #f5f5f5;
}

.select2-container--default .select2-results__option {
    background-color: #33292d;
    color: #f5f5f5;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #7a1f2b;
    color: #ffffff;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #4a3d42;
    color: #ffffff;
}

.select2-search--dropdown .select2-search__field {
    background-color: #2a2225;
    color: #f5f5f5;
    border: 1px solid #4a3d42;
}


/* =========================
   Wein-Karten / Übersicht
========================= */

.wein-card {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.wein-card.archiviert {
    opacity: 0;
    transform: scale(0.96);
}

.wine-image {
    height: 180px;
    object-fit: contain;
    background-color: #33292d;
    padding: 10px;
    border-radius: 16px 16px 0 0;
}

.wine-image-placeholder {
    height: 180px;
    background-color: #33292d;
    border-radius: 16px 16px 0 0;
    font-size: 3rem;
}

.card-img-top {
    padding: 10px;
    border-radius: 16px 16px 0 0;
}

.wine-placeholder-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    opacity: 0.9;
}

.detail-placeholder-logo {
    width: 110px;
    height: 110px;
}

/* Listenansicht Thumbnail */

.list-wine-thumb-wrapper {
    flex: 0 0 auto;
}

.list-wine-thumb,
.list-wine-thumb-placeholder {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    background-color: #33292d;
}

.list-wine-thumb {
    object-fit: contain;
    padding: 5px;
}

.list-wine-thumb-placeholder {
    overflow: hidden;
}

.list-wine-placeholder-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    opacity: 0.9;
}

@media (max-width: 576px) {
    .list-wine-thumb,
    .list-wine-thumb-placeholder {
        width: 52px;
        height: 52px;
    }

    .list-wine-placeholder-logo {
        width: 28px;
        height: 28px;
    }
}

/* Listenansicht Meta-Zeilen */

.list-wine-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.45rem;
}

.list-meta-row {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.list-meta-row:not(:last-child)::after {
    content: "|";
    margin-left: 0.35rem;
    color: #b8aeb1;
}

@media (max-width: 576px) {
    .list-wine-meta {
        display: flex;
        flex-direction: column;
        gap: 0.12rem;
    }

    .list-meta-row {
        display: flex;
        flex-wrap: wrap;
        line-height: 1.25;
    }

    .list-meta-row:not(:last-child)::after {
        content: "";
        margin-left: 0;
    }

    .desktop-meta-separator {
        display: inline;
    }
}


/* =========================
   Auswertungsdetails Bewegungen
========================= */

.auswertung-bewegung-card {
    overflow: hidden;
}

.auswertung-thumb-wrapper {
    flex: 0 0 auto;
}

.auswertung-thumb,
.auswertung-thumb-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background-color: #33292d;
}

.auswertung-thumb {
    object-fit: contain;
    padding: 6px;
}

.auswertung-thumb-placeholder {
    overflow: hidden;
}

.auswertung-placeholder-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    opacity: 0.9;
}

.auswertung-weinname {
    line-height: 1.15;
}

.auswertung-desktop-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(150px, 0.8fr);
    gap: 1.25rem;
    align-items: start;
}

.auswertung-info-block {
    min-width: 0;
}

.auswertung-meta-label {
    color: #b8aeb1;
    margin-bottom: 0.15rem;
}

.auswertung-mengen-block {
    text-align: right;
}

.min-width-0 {
    min-width: 0;
}

@media (max-width: 768px) {
    .auswertung-desktop-grid {
        display: flex;
        flex-direction: column;
        gap: 0.7rem;
    }

    .auswertung-mengen-block {
        text-align: left;
    }
}

@media (max-width: 576px) {
    .auswertung-thumb,
    .auswertung-thumb-placeholder {
        width: 58px;
        height: 58px;
        border-radius: 10px;
    }

    .auswertung-placeholder-logo {
        width: 30px;
        height: 30px;
    }

    .auswertung-weinname {
        font-size: 1.05rem !important;
    }
}


/* =========================
   Favoriten / Bestand
========================= */

.favorit-btn {
    border: none;
    background: transparent;
    color: #f5f5f5;
    font-size: 1.35rem;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

.favorit-btn:hover {
    transform: scale(1.15);
}

.quantity-action {
    border: none;
    background: transparent;
    color: #f5f5f5;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
}

.quantity-action:hover {
    color: #d08a95;
    transform: scale(1.15);
}

.anzahl-wert {
    display: inline-block;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    padding: 2px 6px;
    border-radius: 6px;
}

.anzahl-wert.aktualisiert {
    transform: scale(1.15);
}


/* =========================
   Detailbild / Bild-Modal
========================= */

.detail-wine-image {
    max-height: 300px;
    object-fit: contain;
    cursor: pointer;
    background-color: #33292d;
    padding: 10px;
    border-radius: 12px;
}

.detail-wine-image:hover {
    opacity: 0.9;
    transform: scale(1.01);
}

.edit-wine-image {
    max-height: 180px;
    object-fit: contain;
    background-color: #33292d;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
}

.edit-wine-image:hover {
    opacity: 0.9;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.image-modal-img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 14px;
}

.image-modal-close {
    position: absolute;
    top: 18px;
    right: 28px;
    color: white;
    font-size: 38px;
    font-weight: bold;
    cursor: pointer;
}

.edit-wine-thumb {
    width: 125px;
    height: 125px;
    object-fit: cover;
    background-color: #33292d;
    padding: 6px;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.edit-wine-thumb:hover {
    opacity: 0.9;
}

/* =========================
   Bewegungs-Historie
========================= */

.bewegungs-details {
    background-color: transparent;
}

.bewegungs-summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;

    color: #f5f5f5;
    font-size: 1.15rem;
    font-weight: 700;

    cursor: pointer;
    list-style: none;
}

.bewegungs-summary::-webkit-details-marker {
    display: none;
}

.bewegungs-summary::before {
    content: "▶";
    color: #d08a95;
    font-size: 0.9rem;
    transition: transform 0.15s ease;
}

.bewegungs-details[open] .bewegungs-summary::before {
    transform: rotate(90deg);
}

.bewegungs-summary:hover {
    color: #d08a95;
}

.bewegungs-content {
    padding-left: 0.2rem;
}

/* =========================
   ALERTS / FEHLERMELDUNGEN
========================= */

.alert-danger {
    background-color: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.35);
    color: #ffb8c0;
}

.alert-info {
    background-color: rgba(208, 138, 149, 0.12);
    border: 1px solid rgba(208, 138, 149, 0.35);
    color: #f5f5f5;
    border-radius: 14px;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.18);
}

/* =========================
   Responsive
========================= */

@media (max-width: 576px) {
    .app-logo {
        width: 48px;
        height: 48px;
    }

    .login-logo {
        width: 42px;
        height: 42px;
    }

    .current-user {
        font-size: 0.9rem;
    }

    .app-title {
        margin-bottom: 0;
    }

    .filter-action-row {
        align-items: flex-start !important;
    }

    .filter-button-row {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {
    .app-main-header-row {
        align-items: center;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-nav {
        display: flex;
        justify-content: flex-end;
    }
}


/* =========================
   Weinbild-Platzhalter Logo
========================= */

.wine-image-placeholder {
    overflow: hidden;
}

.wine-image-placeholder .wine-placeholder-logo {
    display: block !important;

    width: 72px !important;
    height: 72px !important;

    max-width: 45% !important;
    max-height: 45% !important;

    object-fit: contain !important;
    opacity: 0.9;
}

.wine-image-placeholder .detail-placeholder-logo {
    width: 110px !important;
    height: 110px !important;

    max-width: 55% !important;
    max-height: 55% !important;
}

@media (max-width: 576px) {
    .wine-image-placeholder .wine-placeholder-logo {
        width: 58px !important;
        height: 58px !important;

        max-width: 38% !important;
        max-height: 38% !important;
    }

    .wine-image-placeholder .detail-placeholder-logo {
        width: 90px !important;
        height: 90px !important;

        max-width: 45% !important;
        max-height: 45% !important;
    }
}