/**
 * loadouts.css — Styling für die Loadout-Seite
 * Folgt dem GearBase Dark-Theme (braun/gold, #1c1c1a Hintergrund)
 */

/* ============================================================
   PAGE HEADER
   ============================================================ */
.lo-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.lo-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    color: #c8a87a;
    margin: 0;
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

.lo-icon-title {
    width: 26px;
    height: 26px;
    color: #c8a87a;
    flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.lo-btn {
    padding: 7px 16px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-family: Arial, sans-serif;
    transition: background 0.15s, border-color 0.15s;
}

.lo-btn--primary {
    background: #333330;
    color: #e8dcc8;
    border-color: rgba(200, 168, 122, 0.30);
}
.lo-btn--primary:hover { background: #3d3d39; border-color: rgba(200, 168, 122, 0.50); }

.lo-btn--secondary {
    background: #3a3a38;
    color: #ccc;
}
.lo-btn--secondary:hover { background: #4a4a48; }

.lo-btn--sm {
    padding: 4px 10px;
    font-size: 12px;
}

.lo-btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}
.lo-btn-icon:hover { color: #c8a87a; background: rgba(200,168,122,0.1); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.lo-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}
.lo-empty p { margin-bottom: 16px; font-size: 15px; }

.lo-empty-items {
    color: #888;
    text-align: center;
    padding: 32px 0;
    font-size: 14px;
}
.lo-empty-items a { color: #c8a87a; }

/* ============================================================
   LAYOUT (Liste + Detail)
   ============================================================ */
.lo-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lo-layout--split {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
}

.lo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    width: 280px;
}

.lo-layout:not(.lo-layout--split) .lo-list {
    width: 100%;
    max-width: 600px;
}

.lo-detail {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   LOADOUT CARDS (Liste)
   ============================================================ */
.lo-card {
    background: var(--gb-card-bg);
    border: 1px solid var(--gb-card-border);
    border-radius: var(--gb-radius-card);
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: border-color 0.15s, background 0.15s;
}

.lo-card:hover {
    border-color: var(--gb-card-border-hover);
    background: var(--gb-card-bg-hover);
}

.lo-card--active {
    border-color: rgba(200,168,122,0.6);
    background: var(--gb-card-bg-hover);
}

.lo-card__main { flex: 1; min-width: 0; }

.lo-card__name {
    color: #c8a87a;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lo-card__name:hover { text-decoration: underline; }

.lo-card__desc {
    color: #888;
    font-size: 12px;
    margin: 3px 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lo-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.lo-meta-item {
    font-size: 12px;
    color: #aaa;
}

.lo-badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 3px;
    border: 1px solid;
}

.lo-badge--public {
    background: rgba(47,89,39,0.2);
    border-color: rgba(106,184,106,0.4);
    color: #6ab86a;
}

.lo-card__actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

/* ============================================================
   ENTDECKEN (Discover-Grid)
   ============================================================ */
.disc-search {
    display: flex;
    gap: 8px;
    align-items: center;
}
.disc-search__input { width: 220px; max-width: 50vw; }

.disc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.disc-card {
    display: block;
    background: var(--gb-card-bg);
    border: 1px solid var(--gb-card-border);
    border-radius: var(--gb-radius-card);
    padding: 14px 16px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.disc-card:hover {
    border-color: var(--gb-card-border-hover);
    background: var(--gb-card-bg-hover);
    transform: translateY(-2px);
}

.disc-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.disc-card__name {
    color: #c8a87a;
    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.disc-card__owner {
    color: #888;
    font-size: 12px;
    margin-bottom: 8px;
}

.disc-card__desc {
    color: #aaa;
    font-size: 12px;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.disc-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #aaa;
}

/* ============================================================
   DETAIL-ANSICHT
   ============================================================ */
.lo-detail__header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.lo-detail__title {
    font-size: 1.2rem;
    color: #c8a87a;
    margin: 0 0 8px;
    font-family: 'Cinzel', serif;
}

.lo-detail__summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #aaa;
}

.lo-summary-sep { color: #555; }

.lo-detail__desc {
    margin: 8px 0 0;
    color: #888;
    font-size: 13px;
}

/* ============================================================
   GEWICHTSBUDGET (Fortschrittsbalken)
   ============================================================ */
.lo-budget {
    margin-top: 14px;
}

.lo-budget__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #aaa;
}

.lo-budget__label strong { color: #ddd; }

.lo-budget__remain {
    font-size: 12px;
    font-weight: bold;
}
.lo-budget__remain--green  { color: #6ab86a; }
.lo-budget__remain--yellow { color: #d8b34a; }
.lo-budget__remain--red    { color: #d86a6a; }

.lo-budget__bar {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 5px;
    overflow: hidden;
}

.lo-budget__fill {
    height: 100%;
    border-radius: 5px 0 0 5px;
    transition: width 0.3s ease, background 0.3s ease;
}
.lo-budget__fill--green  { background: #4f8f3f; }
.lo-budget__fill--yellow { background: #c39a2e; }
.lo-budget__fill--red    { background: #a83a3a; }

.lo-input-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #777;
}

/* Mini-Balken (Loadout-Liste + Picker) */
.lo-minibudget {
    width: 100%;
    height: 4px;
    margin-top: 8px;
    background: rgba(255,255,255,0.07);
    border-radius: 2px;
    overflow: hidden;
}

.lo-minibudget__fill {
    height: 100%;
    border-radius: 2px;
}
.lo-minibudget__fill--green  { background: #4f8f3f; }
.lo-minibudget__fill--yellow { background: #c39a2e; }
.lo-minibudget__fill--red    { background: #a83a3a; }

/* ============================================================
   ITEM-TABELLE
   ============================================================ */
.lo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lo-table th {
    color: #888;
    font-weight: normal;
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lo-th-num { text-align: right; }

.lo-table td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
    color: #ddd;
}

.lo-item-row:hover td { background: rgba(255,255,255,0.03); }

.lo-item-link {
    color: #c8a87a;
    text-decoration: none;
}
.lo-item-link:hover { text-decoration: underline; }

.lo-item-note {
    display: block;
    color: #777;
    font-size: 11px;
    margin-top: 2px;
}

.lo-item-cat { color: #999; font-size: 12px; }
.lo-cat-sep  { color: #555; margin: 0 3px; }

.lo-item-total { color: #c8a87a; font-weight: bold; }

/* Mengen-Stepper (+/−) */
.lo-qty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}
.lo-qty__btn {
    background: rgba(200,168,122,0.12);
    border: 1px solid rgba(200,168,122,0.35);
    color: #c8a87a;
    cursor: pointer;
    width: 22px;
    height: 22px;
    line-height: 1;
    border-radius: 4px;
    font-size: 15px;
    padding: 0;
    transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.lo-qty__btn:hover:not(:disabled) { background: rgba(200,168,122,0.28); color: #e6cfa6; }
.lo-qty__btn:disabled { opacity: 0.3; cursor: default; }
.lo-qty__val {
    min-width: 32px;
    text-align: center;
    color: #ddd;
    font-variant-numeric: tabular-nums;
}

.lo-total-row td {
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.15);
    border-bottom: none;
    color: #c8a87a;
}

.lo-toggle-public-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #aaa;
    border-radius: 3px;
    cursor: pointer;
    padding: 3px 10px;
    font-size: 12px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lo-toggle-public-btn:hover { background: rgba(255,255,255,0.12); }

/* Öffentlich-Zustand: grünliche Tönung wie das Listen-Badge .lo-badge--public.
   data-public wird von loadouts.js beim Umschalten gepflegt → Farbe folgt automatisch. */
.lo-toggle-public-btn[data-public="1"] {
    background: rgba(47,89,39,0.20);
    border-color: rgba(106,184,106,0.40);
    color: #6ab86a;
}
.lo-toggle-public-btn[data-public="1"]:hover { background: rgba(47,89,39,0.32); }

.lo-export-btn {
    display: inline-block;
    background: rgba(200,168,122,0.10);
    border: 1px solid rgba(200,168,122,0.30);
    color: #c8a87a;
    border-radius: 3px;
    padding: 3px 10px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.15s;
}
.lo-export-btn:hover { background: rgba(200,168,122,0.22); }

/* ============================================================
   MODAL
   ============================================================ */
.lo-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lo-modal__content {
    background: #1e1e1c;
    border: 1px solid rgba(200,168,122,0.25);
    border-radius: 5px;
    padding: 24px;
    width: 420px;
    max-width: 90vw;
    position: relative;
}

.lo-modal__close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}
.lo-modal__close:hover { color: #ccc; }

.lo-label {
    display: block;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lo-input {
    width: 100%;
    box-sizing: border-box;
    background: #111;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 3px;
    color: #ddd;
    padding: 8px 10px;
    font-size: 13px;
    font-family: Arial, sans-serif;
}
.lo-input:focus {
    outline: none;
    border-color: rgba(200,168,122,0.5);
}

.lo-textarea { resize: vertical; min-height: 56px; }

/* ============================================================
   TOAST (geteilt mit admin-toast, hier als Fallback)
   ============================================================ */
.lo-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2F5927;
    color: #fff;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 13px;
    z-index: 2000;
    animation: lo-fade-in 0.2s ease;
}
.lo-toast--error { background: #7a2020; }

@keyframes lo-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
