/* ============================================================================
   AVATAR-RESERVIERUNG — LA MIDNIGHT BRUTALIST
   Author: Rogue RPG BB

   Klassen-Prefix: .lam-avres__*  (BEM)

   Hinweis: .avres_category bleibt als Legacy-Tag in den Templates erhalten,
   weil avatarreservierung_search_js.html (JS-Filter) auf diese Klasse zielt
   sowie auf #search_input und tbody tr mit td:first-child / td:nth-child(2).
   ============================================================================ */


/* ============================================
   HEADER mit Ghost-Wording
   ============================================ */
.lam-avres__header {
    position: relative;
    padding: var(--space-2xl) 0;
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--text-dark);
    overflow: hidden;
}

.lam-avres__header::before {
    content: attr(data-ghost);
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    font-family: var(--font-display);
    font-size: clamp(8rem, 18vw, 14rem);
    line-height: 0.8;
    color: transparent;
    /* --ghost-stroke ist semi-transparent → kein opacity nötig */
    -webkit-text-stroke: 1px var(--ghost-stroke);
    pointer-events: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.lam-avres__title-wrap {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.lam-avres__label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--accent);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
}

.lam-avres__title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    color: var(--text);
}

.lam-avres__title .accent {
    color: var(--accent);
}

.lam-avres__intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 580px;
    line-height: 1.7;
}


/* ============================================
   FRISTEN-LEISTE im Hero
   Vier Stat-Boxen mit den ACP-Werten
   ============================================ */
.lam-avres__rules {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--text-dark);
}

.lam-avres__rule {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--text-dark);
    background: rgba(255, 255, 255, 0.01);
    min-width: 130px;
}

/* Label oben — Mono dim */
.lam-avres__rule-label {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 0.25em;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* Wert unten — Bebas, prominent */
.lam-avres__rule-value {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* Verlängerung (letzte Box) — accent-Farbe */
.lam-avres__rule:last-child .lam-avres__rule-value {
    color: var(--accent);
}


/* ============================================
   STATUS-MELDUNGEN
   ============================================ */
.lam-avres__message {
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
    border-left: 3px solid var(--text-dark);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.lam-avres__message--error {
    color: var(--error);
    border-left-color: var(--error);
    background: var(--error-bg);
}

.lam-avres__message--success {
    color: var(--success);
    border-left-color: var(--success);
    background: var(--success-bg);
}


/* ============================================
   SECTION-HEADER
   ============================================ */
.lam-avres__section {
    margin-bottom: var(--space-2xl);
}

.lam-avres__section-head {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--text-dark);
}

.lam-avres__section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--text);
}

.lam-avres__section-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.15em;
}


/* ============================================
   RESERVIER-FORM
   ============================================ */
.lam-avres__form-card {
    padding: var(--space-xl);
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--text-dark);
}

.lam-avres__form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.lam-avres__form-row--full {
    grid-column: 1 / -1;
}

.lam-avres__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.lam-avres__field-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    text-transform: uppercase;
}

.lam-avres__field-hint {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-top: var(--space-xs);
    text-transform: none;
}

.lam-avres__input,
.lam-avres__select {
    padding: 0.75rem 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--text-dark);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    transition: border-color 0.3s var(--ease);
    width: 100%;
}

.lam-avres__input:focus,
.lam-avres__select:focus {
    outline: none;
    border-color: var(--accent);
}

.lam-avres__select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    cursor: pointer;
}

.lam-avres__form-submit {
    padding-top: var(--space-md);
    border-top: 1px solid var(--text-dark);
}


/* ============================================
   BUTTONS — Brutalist
   ============================================ */
.lam-avres__btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.85rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--text-dark);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.lam-avres__btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.lam-avres__btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.lam-avres__btn--primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--bg);
}

/* Klein — für Inline-Aktionen in der Liste */
.lam-avres__btn--sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.5rem;
}

.lam-avres__btn--danger {
    border-color: var(--text-dark);
    color: var(--text-muted);
}

.lam-avres__btn--danger:hover {
    border-color: var(--error);
    color: var(--error);
}


/* ============================================
   SUCH-BAR
   ============================================ */
.lam-avres__search {
    margin-bottom: var(--space-2xl);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--text-dark);
    border-bottom: 1px solid var(--text-dark);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.lam-avres__search-icon {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-left: var(--space-sm);
}

.lam-avres__search-input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.lam-avres__search-input:focus {
    outline: none;
}

.lam-avres__search-input::placeholder {
    color: var(--text-dark);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
}


/* ============================================
   KATEGORIE-BLOCK
   ============================================ */
.lam-avres__category {
    margin-bottom: var(--space-2xl);
}

.lam-avres__category-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--text-dark);
}

.lam-avres__category-name {
    font-family: var(--font-display);
    font-size: 2.25rem;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--text);
}

.lam-avres__category-count {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    white-space: nowrap;
}


/* ============================================
   TABELLEN-LAYOUT als CSS Grid
   HTML bleibt <table> (für JS-Filter & A11y),
   aber via display: grid wird sie zur 4-Spalten-Optik:
   AVATAR | SPIELER | RESERVIERT | AKTIONEN
   ============================================ */
.lam-avres__table {
    width: 100%;
    border-collapse: collapse;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr auto;
}

/* thead/tbody verschwinden visuell — tr/td werden direkte Grid-Children */
.lam-avres__table thead,
.lam-avres__table tbody,
.lam-avres__table tr {
    display: contents;
}

/* Header-Reihe: Mono-Labels, dezent */
.lam-avres__table thead td {
    padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-dim);
    border-bottom: 1px solid var(--text-dark);
}

/* Body-Zellen */
.lam-avres__table tbody td {
    padding: var(--space-md) var(--space-md) var(--space-md) 0;
    border-bottom: 1px solid var(--text-dark);
    display: flex;
    align-items: center;
}

/* Erste Spalte: Avatar-Name in Bebas Neue, groß */
.lam-avres__table tbody td:nth-child(1) {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* Zweite Spalte: Spieler-Name in Mono */
.lam-avres__table tbody td:nth-child(2) {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.lam-avres__table tbody td:nth-child(2) a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.lam-avres__table tbody td:nth-child(2) a:hover {
    color: var(--accent);
}

/* Dritte Spalte: Tage in Mono accent */
.lam-avres__table tbody td:nth-child(3) {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--accent);
    text-transform: uppercase;
}

/* Vierte Spalte: Aktionen — Buttons rechts */
.lam-avres__table tbody td:nth-child(4) {
    gap: var(--space-xs);
    justify-content: flex-end;
    white-space: nowrap;
}

/* Inline-Forms in der Action-Zelle haben kein margin */
.lam-avres__table tbody td form {
    margin: 0;
    display: inline-flex;
}

/* Gast-Label (für nicht-eingeloggte Reservierer) */
.lam-avres__guest-label,
.guest_label {
    font-style: italic;
    color: var(--text-dim);
    font-size: 0.65rem;
    margin-left: var(--space-xs);
}


/* ============================================
   EMPTY STATE
   ============================================ */
.lam-avres__empty {
    padding: var(--space-2xl);
    text-align: center;
    border: 1px dashed var(--text-dark);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 720px) {
    .lam-avres__form-grid {
        grid-template-columns: 1fr;
    }
    /* Tabelle: zurück zu Block-Layout */
    .lam-avres__table {
        display: block;
    }
    .lam-avres__table thead,
    .lam-avres__table tbody {
        display: block;
    }
    .lam-avres__table thead {
        display: none;
    }
    .lam-avres__table tr {
        display: block;
        padding: var(--space-md) 0;
        border-bottom: 1px solid var(--text-dark);
    }
    .lam-avres__table tbody td {
        display: block;
        padding: var(--space-xs) 0;
        border-bottom: none;
    }
    .lam-avres__table tbody td:nth-child(4) {
        justify-content: flex-start;
        margin-top: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .lam-avres__category-name {
        font-size: 1.75rem;
    }
}