/* ═══════════════════════════════════════════════════════════════
   Void Frontier – Custom CSS
   Ergänzt Tailwind um HUD-Spezialeffekte, Starfield, Animationen
   ═══════════════════════════════════════════════════════════════ */

/* ── Basis-Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #020617; }
::-webkit-scrollbar-thumb { background: rgba(6, 182, 212, 0.3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(6, 182, 212, 0.5); }

.scrollbar-hide { scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ── Starfield-Layers ─────────────────────────────────────────── */
.stars-sm {
    background-image:
        radial-gradient(1px 1px at 5%   8%,  rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 18%  22%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 32%  5%,  rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 45%  35%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 62%  15%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 78%  42%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 88%  8%,  rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 12%  58%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 25%  72%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 55%  65%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 70%  82%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 90%  55%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 38%  88%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 82%  92%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 50%  50%, rgba(255,255,255,0.5) 0%, transparent 100%);
    background-size: 400px 400px;
    animation: stars-drift 120s linear infinite;
}

.stars-md {
    background-image:
        radial-gradient(1.5px 1.5px at 10% 30%, rgba(200,230,255,0.8) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 35% 60%, rgba(200,230,255,0.9) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 60% 20%, rgba(200,230,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 80% 70%, rgba(200,230,255,0.8) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 20% 80%, rgba(200,230,255,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 50% 10%, rgba(200,230,255,0.9) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 90% 40%, rgba(200,230,255,0.7) 0%, transparent 100%);
    background-size: 600px 600px;
    animation: stars-drift 180s linear infinite reverse;
}

.stars-lg {
    background-image:
        radial-gradient(2px 2px at 15% 45%, rgba(150,200,255,0.6) 0%, transparent 100%),
        radial-gradient(2px 2px at 70% 15%, rgba(150,200,255,0.5) 0%, transparent 100%),
        radial-gradient(2px 2px at 45% 75%, rgba(150,200,255,0.7) 0%, transparent 100%),
        radial-gradient(3px 3px at 85% 85%, rgba(180,220,255,0.4) 0%, transparent 100%);
    background-size: 800px 800px;
    animation: stars-twinkle 4s ease-in-out infinite alternate;
}

@keyframes stars-drift {
    from { transform: translateY(0); }
    to   { transform: translateY(-400px); }
}

@keyframes stars-twinkle {
    0%   { opacity: 0.15; }
    100% { opacity: 0.35; }
}

/* ── HUD-Card ─────────────────────────────────────────────────── */
.card-hud {
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(6, 182, 212, 0.12);
    position: relative;
    transition: border-color 0.2s ease;
}

.card-hud:hover {
    border-color: rgba(6, 182, 212, 0.2);
}

/* Subtiler innerer Gradient */
.card-hud::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.03) 0%, transparent 60%);
    pointer-events: none;
    border-radius: inherit;
}

/* ── Eck-Akzente ──────────────────────────────────────────────── */
.corner-tl, .corner-tr, .corner-bl, .corner-br {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: rgba(6, 182, 212, 0.5);
    border-style: solid;
}
.corner-tl { top: 0; left: 0;  border-width: 2px 0 0 2px; border-radius: 2px 0 0 0; }
.corner-tr { top: 0; right: 0; border-width: 2px 2px 0 0; border-radius: 0 2px 0 0; }
.corner-bl { bottom: 0; left: 0;  border-width: 0 0 2px 2px; border-radius: 0 0 0 2px; }
.corner-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; border-radius: 0 0 2px 0; }

.corner-tl-sm, .corner-tr-sm, .corner-bl-sm, .corner-br-sm {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: rgba(6, 182, 212, 0.35);
    border-style: solid;
}
.corner-tl-sm { top: 0; left: 0;  border-width: 1px 0 0 1px; }
.corner-tr-sm { top: 0; right: 0; border-width: 1px 1px 0 0; }
.corner-bl-sm { bottom: 0; left: 0;  border-width: 0 0 1px 1px; }
.corner-br-sm { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

/* ── HUD-Input ────────────────────────────────────────────────── */
.hud-input {
    display: block;
    width: 100%;
    padding: 0.65rem 0.875rem;
    background: rgba(5, 8, 16, 0.8);
    border: 1px solid rgba(6, 182, 212, 0.18);
    border-radius: 0.375rem;
    color: #e2e8f0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
    outline: none;
    -webkit-appearance: none;
}

.hud-input:focus {
    border-color: rgba(6, 182, 212, 0.55);
    box-shadow:
        0 0 0 2px rgba(6, 182, 212, 0.08),
        0 0 12px rgba(6, 182, 212, 0.08);
}

.hud-input::placeholder {
    color: rgba(100, 116, 139, 0.5);
    font-weight: 400;
}

.hud-input:autofill,
.hud-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px #0a0e1a inset;
    -webkit-text-fill-color: #e2e8f0;
}

/* ── Primär-Button ────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 0.375rem;
    color: #22d3ee;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.1), transparent);
    transition: left 0.4s ease;
}

.btn-primary:hover::before { left: 100%; }

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(6, 182, 212, 0.12));
    border-color: rgba(6, 182, 212, 0.65);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
    color: #67e8f9;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary:disabled::before { display: none; }

/* ── Glow-Effekte ─────────────────────────────────────────────── */
.glow-text-cyan {
    text-shadow:
        0 0 10px rgba(6, 182, 212, 0.7),
        0 0 20px rgba(6, 182, 212, 0.3),
        0 0 40px rgba(6, 182, 212, 0.1);
}

.glow-text-amber {
    text-shadow:
        0 0 10px rgba(245, 158, 11, 0.7),
        0 0 20px rgba(245, 158, 11, 0.3);
}

/* ── Navigation Aktiv-State ───────────────────────────────────── */
.nav-item.nav-active,
a[data-nav-path].nav-active {
    color: #22d3ee !important;
    background-color: rgba(6, 182, 212, 0.1) !important;
    border-color: rgba(6, 182, 212, 0.25) !important;
}

/* ── Toast-Animationen ────────────────────────────────────────── */
.toast-enter {
    animation: toast-in 0.3s ease forwards;
}

.toast-leave {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

/* ── PWA: Safe Area (Notch / Home-Indicator) ──────────────────── */
.safe-area-bottom {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

/* ── Loading-Overlay ─────────────────────────────────────────── */
#page-loader {
    position: fixed;
    inset: 0;
    background: #020617;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    transition: opacity 0.3s ease;
}

.spinner-hud {
    width: 3rem;
    height: 3rem;
    border: 2px solid rgba(6, 182, 212, 0.15);
    border-top-color: rgba(6, 182, 212, 0.8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive Utility ───────────────────────────────────────── */
@media (max-width: 640px) {
    .hud-input { font-size: 1rem; } /* Verhindert iOS-Zoom bei <16px */
}

/* ── Phase 27: Kampfberichte ─────────────────────────────────── */
.battle-report-card {
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.battle-report-victory  { border-left: 3px solid #22c55e; }
.battle-report-defeat   { border-left: 3px solid #ef4444; }
.battle-report-escaped  { border-left: 3px solid #f59e0b; }
.battle-report-draw     { border-left: 3px solid #6b7280; }

.round-entry {
    opacity: 0;
    animation: fadeInDown 0.3s ease forwards;
}

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

.battle-outcome-banner {
    animation: scalePop 0.5s ease forwards;
}

@keyframes scalePop {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Phase 29b: Flotten-Übersicht ────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-docked     { background: #064e3b; color: #6ee7b7; }
.status-in_transit { background: #1e3a5f; color: #93c5fd; }
.status-combat     { background: #450a0a; color: #fca5a5; }
.status-mining     { background: #451a03; color: #fcd34d; }
.status-salvaging  { background: #1c1917; color: #d6d3d1; }
.status-scanning   { background: #1e1b4b; color: #c4b5fd; }

.btn-active {
    background: #0e7490;
    color: #fff;
    border-color: #0e7490;
}
.btn-sm {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: #1e293b;
    color: #94a3b8;
    cursor: pointer;
    border: 1px solid #334155;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn-sm:hover { background: #334155; color: #e2e8f0; }
.btn-xs {
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.7rem;
    background: #0f172a;
    color: #64748b;
    cursor: pointer;
    border: 1px solid #1e293b;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn-xs:hover { background: #1e293b; color: #94a3b8; }
.select-sm {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: #0f172a;
    color: #94a3b8;
    border: 1px solid #334155;
    cursor: pointer;
}
.fleet-group h3,
.fleet-group span.font-orbitron {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}
.ship-list-row:hover td { background: rgba(255,255,255,0.015); }
