/**
 * KAP – Krankes ARK Paradies
 * Globales Stylesheet
 * STATUS: FINAL (Abgeschlossen)
 */

/* --- Variablen für konsistente Farben --- */
:root {
    --primary: #06b6d4;      /* Cyan-400 */
    --secondary: #d946ef;    /* Fuchsia-500 */
    --accent: #6366f1;       /* Indigo-500 */
    --bg-dark: #020617;
    --card-bg: rgba(10, 15, 28, 0.8);
    --border-light: rgba(34, 211, 238, 0.2);
    --header-height: 80px;
}

/* --- Globaler Body & Fonts --- */
body { 
    /*background: radial-gradient(circle at center, #0f172a 0%, var(--bg-dark) 100%); */
    background: #020617;
    font-family: 'Inter', sans-serif; 
    color: #e2e8f0; 
    overflow-x: hidden; 
    min-height: 100vh;
    margin: 0;
    padding-top: var(--header-height); /* Verhindert das Verschwinden unter dem Header */
}

.gaming-font { font-family: 'Orbitron', sans-serif; }

/* --- Navigation & Header --- */
.glass { 
    background: #0a0f1c !important; 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light); 
    z-index: 9999; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

/* Nav-Links Hover Effekt */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--primary);
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* --- Mobile Navigation --- */
.mobile-nav-link {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    color: rgb(209 213 219);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    color: rgb(34 211 238);
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.25);
}

/* --- Cluster-Karten (Startseite) --- */
.server-card {
    background: var(--card-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    position: relative;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.server-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

/* --- Global Card Styles (Regelwerk & Content) --- */
.sexy-card, .section-card {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Gradient Border Effekt für aktive Karten */
.sexy-card.active, .section-card.active {
    border: 1px solid var(--primary);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

/* Header-Bereiche der Karten */
.main-header, .sexy-card > div:first-child {
    padding: 1.25rem 2rem !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.3s ease;
}

.main-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* --- Accordion Logic --- */
.content-wrapper, .section-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding-left: 2rem;       /* ← horizontal IMMER da */
    padding-right: 2rem;
    padding-top: 0;            /* vertikal animiert */
    padding-bottom: 0;
    transition: 
        max-height 0.5s cubic-bezier(0, 1, 0, 1),
        opacity 0.3s ease,
        padding-top 0.5s ease,
        padding-bottom 0.5s ease;
}

.active > .content-wrapper, 
.active > .section-content {
    max-height: 5000px; 
    opacity: 1;
    padding-top: 1rem;
    padding-bottom: 2rem;
    transition: 
        max-height 1s ease-in-out, 
        opacity 0.5s ease,
        padding-top 0.5s ease,
        padding-bottom 0.5s ease;
}

.arrow {
    transition: transform 0.3s ease;
}

/* Nur den Pfeil im direkten Header der aktiven Karte drehen,
   nicht die Pfeile von Sub-Cards. */
.sexy-card.active > div:first-child > .arrow,
.sub-card.active > .sub-header > .arrow,
.section-card.active > .main-header > .arrow {
    transform: rotate(180deg);
    color: var(--secondary) !important;
}

/* --- Unter-Karten (Sub-Cards) --- */
.sub-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0 1rem;
    transition: border-color 0.3s ease;
}

.sub-card.active {
    border-color: var(--accent);
}

/* --- Handelsrechner Spezial-Klassen --- */
.calc-main-wrapper {
    min-height: calc(100vh - var(--header-height));
    padding: 2rem 0;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* Utility Klassen */
.text-cyan-400 { color: var(--primary); }
.text-fuchsia-500 { color: var(--secondary); }

/* ========================================
   KALKULATOR – TAB SWITCHER
   ======================================== */

.tab-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.9rem 1.75rem;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #64748b;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Subtiler Hover: Text aufhellen, Border anheben */
.tab-btn:hover {
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-1px);
}

/* Animierter Glow-Streifen unten – wie bei deinen nav-links */
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.4s ease;
}

.tab-btn.active::after {
    width: 70%;
}

/* --- AKTIVER DINO-TAB (Cyan) --- */
.tab-btn.active[data-tab="dino"] {
    color: var(--primary);
    border-color: var(--border-light);
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.1),
                inset 0 0 20px rgba(6, 182, 212, 0.05);
}

/* --- AKTIVER ITEM-TAB (Fuchsia) --- */
.tab-btn.active[data-tab="item"] {
    color: var(--secondary);
    border-color: rgba(217, 70, 239, 0.3);
    background: rgba(217, 70, 239, 0.08);
    box-shadow: 0 0 15px rgba(217, 70, 239, 0.1),
                inset 0 0 20px rgba(217, 70, 239, 0.05);
}

.tab-btn.active[data-tab="item"]::after {
    background: var(--secondary);
}

/* Icon-Spacing im Button */
.tab-btn i {
    margin-right: 0.5rem;
    font-size: 0.85rem;
}

/* ========================================
   KALKULATOR – THEME-SYSTEM
   Ein Theme steuert alle Glows gleichzeitig.
   ======================================== */

/* Theme-Variablen am Wrapper */
#calcWrapper {
    --glow-color: var(--primary);
    --glow-rgb: 6, 182, 212;
}

#calcWrapper.theme-item {
    --glow-color: var(--secondary);
    --glow-rgb: 217, 70, 239;
}

/* Preis-Panel rechts */
.price-panel {
    border: 2px solid rgba(var(--glow-rgb), 0.5);
    box-shadow: 0 0 30px rgba(var(--glow-rgb), 0.2);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Kalkulator-Cards (Dino + Item) –
   per ID und !important, um die generische
   .sexy-card.active-Regel sicher zu überschreiben. */
#dinoCard.sexy-card,
#itemCard.sexy-card,
#dinoCard.sexy-card.active,
#itemCard.sexy-card.active {
    border: 2px solid rgba(var(--glow-rgb), 0.5) !important;
    box-shadow: 0 0 30px rgba(var(--glow-rgb), 0.2) !important;
    transition: border-color 0.4s ease, box-shadow 0.4s ease !important;
}

/* Bonus: "PKT" im Preis-Panel mit dem Theme mitwechseln */
#calcWrapper .price-panel .gaming-font.text-lg {
    color: var(--glow-color);
    transition: color 0.4s ease;
}

/* Feedback-Animation wenn ein Stat-Wert auf 200 gekappt wurde */
.stat-capped {
    animation: statCapFlash 0.6s ease;
}

@keyframes statCapFlash {
    0%   { background: rgba(245, 158, 11, 0.0); }
    30%  { background: rgba(245, 158, 11, 0.3); }
    100% { background: rgba(245, 158, 11, 0.0); }
}

.page-shell {
    min-height: calc(100vh - var(--header-height));
    padding: 3rem 1.5rem 5rem;
    background: #020617;
}

.page-title-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    color: #fff;
}

.page-subtitle {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-style: italic;
}

@media (min-width: 768px) {
    .page-title {
        font-size: 2.5rem;
        line-height: 1;
    }
}

.calc-panel-card {
    margin-bottom: 0;
}

#calcWrapper .calc-card-header,
#calcWrapper .sexy-card > .calc-card-header {
    padding: 1.5rem 2rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-start !important;
    align-items: center;
    cursor: default !important;
    background: rgba(255, 255, 255, 0.02);
}

.calc-card-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calc-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(var(--glow-rgb), 0.16);
    color: var(--glow-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex: 0 0 auto;
    transition: color 0.4s ease, background 0.4s ease;
}

.calc-card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ========================================
   TRADING MAP – Marktplatz-Modul
   ======================================== */

 
/* Statistik-Pillen */
.stat-pill {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.stat-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #94a3b8;
}
.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}
 
/* Karten-Container */
.trading-map-card,
.detail-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    overflow: hidden;
}
 
.detail-panel {
    align-self: start;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}
 
/* Legende-Punkt */
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px currentColor;
}
 
/* ============= Das Grid ============= */
.trading-grid {
    display: grid;
    gap: 4px;
    /* aspect-ratio gehalten, damit sich Zellen quadratisch anfühlen */
}
 
/* Standard-Zelle: alle gleich groß, quadratisch */
.trading-grid > * {
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
 
/* Straßen */
.cell-street {
    background: rgba(71, 85, 105, 0.35);
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(255, 255, 255, 0.03) 4px,
            rgba(255, 255, 255, 0.03) 8px
        );
}
 
/* Grünflächen */
.cell-grass {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.2);
    background-image:
        radial-gradient(
            circle at 30% 40%,
            rgba(34, 197, 94, 0.3) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 70% 70%,
            rgba(34, 197, 94, 0.2) 0%,
            transparent 50%
        );
}
 
/* Slots – Basis */
.cell-slot {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
 
.cell-slot:hover {
    transform: scale(1.08);
    z-index: 10;
}
 
.slot-id {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.6rem, 1.2vw, 0.85rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #fff;
    line-height: 1;
}
 
.slot-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 4px;
    box-shadow: 0 0 6px currentColor;
}
 
/* Slot-Status-Varianten */
.cell-slot.status-free {
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.12), inset 0 0 12px rgba(34, 211, 238, 0.06);
}
.cell-slot.status-free .slot-status-dot { background: #22d3ee; color: #22d3ee; }
.cell-slot.status-free:hover {
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.4), inset 0 0 12px rgba(34, 211, 238, 0.12);
}

.cell-slot.status-paid {
    border-color: rgba(217, 70, 239, 0.5);
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.12), inset 0 0 12px rgba(217, 70, 239, 0.06);
}
.cell-slot.status-paid .slot-status-dot { background: #d946ef; color: #d946ef; }
.cell-slot.status-paid:hover {
    box-shadow: 0 0 18px rgba(217, 70, 239, 0.4), inset 0 0 12px rgba(217, 70, 239, 0.12);
}
 
.cell-slot.status-unpaid {
    border-color: rgba(251, 113, 133, 0.55);
    box-shadow: 0 0 10px rgba(251, 113, 133, 0.18), inset 0 0 12px rgba(251, 113, 133, 0.08);
    animation: unpaidPulse 2.5s ease-in-out infinite;
}
.cell-slot.status-unpaid .slot-status-dot { background: #fb7185; color: #fb7185; }
 
@keyframes unpaidPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(251, 113, 133, 0.18), inset 0 0 12px rgba(251, 113, 133, 0.08); }
    50%      { box-shadow: 0 0 20px rgba(251, 113, 133, 0.45), inset 0 0 14px rgba(251, 113, 133, 0.18); }
}
 
/* Selektion */
.cell-slot.cell-selected {
    transform: scale(1.1);
    border-color: #ffffff;
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.45), inset 0 0 14px rgba(255, 255, 255, 0.1);
    z-index: 15;
}
 
/* ============= Detail-Panel ============= */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.detail-row:last-child { border-bottom: none; }
 
.detail-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #94a3b8;
}
.detail-value {
    font-weight: 700;
    font-size: 0.95rem;
}
 
/* Status-Badges im Detail-Panel */
.badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 700;
}
.badge-free   { background: rgba(34, 211, 238, 0.15); color: #22d3ee;  border: 1px solid rgba(34, 211, 238, 0.4); }
.badge-paid   { background: rgba(217, 70, 239, 0.15); color: #d946ef;  border: 1px solid rgba(217, 70, 239, 0.4); }
.badge-unpaid { background: rgba(251, 113, 133, 0.15); color: #fb7185; border: 1px solid rgba(251, 113, 133, 0.4); }
 
/* Mobile: Detail-Panel nicht mehr sticky */
@media (max-width: 1024px) {
    .detail-panel {
        position: static;
    }
}

/* Discord-Button im Trading-Map-Detail-Panel */
.discord-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg,
                rgba(88, 101, 242, 0.15) 0%,
                rgba(34, 211, 238, 0.15) 100%);
    border: 1px solid rgba(34, 211, 238, 0.4);
    border-radius: 0.75rem;
    color: #22d3ee;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.discord-btn i {
    font-size: 1.1rem;
}

.discord-btn:hover {
    background: linear-gradient(135deg,
                rgba(88, 101, 242, 0.3) 0%,
                rgba(34, 211, 238, 0.3) 100%);
    border-color: rgba(34, 211, 238, 0.7);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.3);
}

.discord-btn:active {
    transform: translateY(0);
}

.quality-select {
    background-color: #0a0f1c;
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Primitive */
.quality-primitive {
    color: #9ca3af;
}

/* Ramshackle */
.quality-ramshackle {
    color: #22c55e;
}

/* Apprentice */
.quality-apprentice {
    color: #3b82f6;
}

/* Journeyman */
.quality-journeyman {
    color: #a855f7;
}

/* Mastercraft */
.quality-mastercraft {
    color: #facc15;
}

/* Ascendant */
.quality-ascendant {
    color: #06b6d4;
}

/* Select-Zustand je nach Auswahl */
select.quality-primitive {
    color: #9ca3af;
    border-color: rgba(156, 163, 175, 0.6);
    box-shadow: 0 0 16px rgba(156, 163, 175, 0.12);
}

select.quality-ramshackle {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.12);
}

select.quality-apprentice {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.12);
}

select.quality-journeyman {
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.12);
}

select.quality-mastercraft {
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.65);
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.14);
}

select.quality-ascendant {
    color: #06b6d4;
    border-color: rgba(6, 182, 212, 0.7);
    box-shadow: 0 0 18px rgba(6, 182, 212, 0.16);
}

/* Options im Dropdown */
#itemQuality option {
    background-color: #0a0f1c;
}