/* common_base.css - Modern Sci-Fi Design System */

/* ==========================================================================
   FONTS & VARIABLES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
    /* Colors */
    --bg-deep: #050810;
    --bg-panel: rgba(13, 18, 30, 0.95); /* Etwas undurchsichtiger für Sidebar */
    --bg-panel-hover: rgba(20, 28, 45, 0.9);
    
    --primary: #00f3ff; /* Cyan Neon */
    --primary-dim: rgba(0, 243, 255, 0.15);
    --secondary: #0099cc;
    
    --text-main: #e0e6ed;
    --text-muted: #8b9bb4;
    --text-highlight: #ffffff;
    
    --accent-success: #00ff9d;
    --accent-danger: #ff2a2a;
    --accent-warning: #ffcc00;
    
    /* Borders & Effects */
    --hud-border: 1px solid rgba(0, 243, 255, 0.3);
    --glass-blur: blur(12px);
    --neon-glow: 0 0 10px rgba(0, 243, 255, 0.4);
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 54.2px; /* Einheitliche Header-Größe für alle Seiten */
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-deep);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
}

body {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    background-color: var(--bg-deep);
    /* Sci-Fi Grid Background */
    background: url('../img/Background.png') no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-main);
    height: 100vh; /* Volle Höhe für App-Layout */
    overflow: hidden; /* Kein Scrollen am Body */
    line-height: 1.5;
    font-size: 16px;
    position: relative;
}

/* Overlay for better readability over background image */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 16, 0.85); /* Dark overlay matching theme */
    z-index: -1;
    pointer-events: none;
}

/* ==========================================================================
   APP LAYOUT (SIDEBAR + CONTENT)
   ========================================================================== */

.game-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-panel);
    border-right: 1px solid rgba(0, 243, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 100;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.sidebar-header {
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: url('../img/logo.png') no-repeat center center;
    background-size: 100% 100%;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(5, 8, 16, 0.8) 100%);
    z-index: 0;
}

.sidebar-header > * {
    position: relative;
    z-index: 1;
}

.user-status-floating {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    font-size: 0.9em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.8), 0 0 10px #000;
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: url('../img/Background-Navbar.png') repeat-y center top;
    background-size: 100% auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9em;
    letter-spacing: 1px;
    background: rgba(13, 18, 30, 0.6);
}

.nav-item:hover, .nav-item.active {
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.2) 0%, rgba(13, 18, 30, 0.8) 100%);
    color: #fff;
    border-left-color: var(--primary);
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
}

.nav-icon {
    margin-right: 15px;
    width: 24px;
    text-align: center;
    font-size: 1.2em;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-danger);
    color: #fff;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: url('../img/Background-Navbar.png') repeat-x center bottom;
    background-size: 100% auto;
    position: relative;
}

.sidebar-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 16, 0.8);
    z-index: 0;
}

.sidebar-footer > * {
    position: relative;
    z-index: 1;
}

.tick-countdown {
    margin-bottom: 15px;
    text-align: center;
}

.tick-countdown .label {
    font-size: 0.7em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tick-countdown .time {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    font-size: 1.2em;
}

.sidebar-actions {
    display: flex;
    justify-content: space-around;
}

.action-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.2em;
    padding: 5px;
    transition: color 0.2s;
}

.action-btn:hover {
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

/* --- MAIN CONTENT WRAPPER --- */
.main-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.top-bar {
    height: var(--header-height);
    background: url('../img/banner.png') no-repeat center center;
    background-size: 100% 100%;
    background-position: center center;
    background-color: rgba(13, 18, 30, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center; /* Center content (resources-bar) */
    padding: 0 20px;
    z-index: 90;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

/* Header controls */
.mobile-menu-toggle,
.resource-toggle {
    display: none;
}

.planet-selector-mobile {
    position: absolute;
    left: 20px;
    display: flex;
    align-items: center;
    z-index: 2;
}

.planet-selector-mobile select {
    height: 34px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 243, 255, 0.3);
    background: rgba(13, 18, 30, 0.85);
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    outline: none;
    min-width: 170px;
}

.planet-selector-mobile select:focus {
    border-color: rgba(0, 243, 255, 0.7);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

/* Dark overlay for top-bar readability - Removed global overlay */
.top-bar::before {
    display: none;
}

.top-bar > * {
    position: relative;
    z-index: 1;
}

.page-title-mobile {
    display: none; /* Desktop hidden */
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #fff;
    position: absolute; /* Absolute positioning to not mess with centering */
    left: 20px;
}

/* --- RESOURCES BAR (COMPACT) --- */
.resources-bar {
    display: flex;
    gap: 20px;
    justify-content: center; /* Center items inside */
    align-items: center;
    
    /* Overlay Styles applied directly to resources-bar */
    background: rgba(13, 18, 30, 0.8);
    backdrop-filter: blur(5px);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.resource-icon {
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
}

.metal-icon {
    background-image: url('../img/Metall.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.crystal-icon {
    background-image: url('../img/Kris.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.deuterium-icon {
    background-image: url('../img/Deut.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.energy-icon {
    background-image: url('../img/Energy.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Icons via CSS Shapes/Colors for now if images missing */
.resource-icon.metal { background-color: #999; box-shadow: 0 0 5px #999; }
.resource-icon.crystal { background-color: #00f3ff; box-shadow: 0 0 5px #00f3ff; }
.resource-icon.deuterium { background-color: #0066cc; box-shadow: 0 0 5px #0066cc; }
.resource-icon.energy { background-color: #ffcc00; box-shadow: 0 0 5px #ffcc00; }

.resource-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.resource-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9em;
    color: var(--text-highlight);
    font-weight: 700;
}

.production {
    font-size: 0.7em;
    color: var(--accent-success);
    font-weight: 500;
}

.resource-storage-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 3px;
    border-radius: 2px;
    overflow: hidden;
}

.resource-storage-bar .fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s ease;
}

.production {
    font-size: 0.7em;
}
.production.positive { color: var(--accent-success); }
.production.negative { color: var(--accent-danger); }


/* --- CONTENT AREA --- */
.content-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px;
    scroll-behavior: smooth;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.content-header h1 {
    margin: 0;
    font-size: 2em;
}

.admin-badge {
    background: var(--accent-danger);
    color: #fff;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.7em;
    font-weight: 700;
    text-decoration: none;
}

.main-footer {
    margin-top: 50px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8em;
    color: var(--text-muted);
}

.main-footer a {
    color: var(--text-muted);
    text-decoration: none;
}
.main-footer a:hover { color: var(--primary); }

/* ==========================================================================
   COMMON UI ELEMENTS
   ========================================================================== */

.card, .fleet-card, .queue-item {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--hud-border);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh; /* Mindestens volle Höhe für Scrollen */
}

/* TYPOGRAPHY */
h1, h2, h3, h4 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8em;
    color: var(--primary);
    border: 1px solid var(--primary);
    background: rgba(0, 243, 255, 0.05);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn:hover, .btn-primary:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary);
}

.btn-primary {
    /* Same as default .btn */
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 243, 255, 0.05);
}

.btn-secondary {
    border-color: var(--text-muted);
    color: var(--text-muted);
}
.btn-secondary:hover {
    background: var(--text-muted);
    color: #000;
    box-shadow: 0 0 15px var(--text-muted);
}

.btn-success {
    border-color: var(--accent-success);
    color: var(--accent-success);
    background: rgba(0, 255, 157, 0.05);
}
.btn-success:hover {
    background: var(--accent-success);
    color: #000;
    box-shadow: 0 0 15px var(--accent-success);
}

.btn-info {
    border-color: var(--secondary);
    color: var(--secondary);
    background: rgba(0, 153, 204, 0.05);
}
.btn-info:hover {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 0 15px var(--secondary);
}

.btn-danger {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
    background: rgba(255, 42, 42, 0.05);
}
.btn-danger:hover {
    background: var(--accent-danger);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-danger);
}

/* FORMS */
input, select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px;
    font-family: 'Rajdhani', sans-serif;
    width: 100%;
}
input:focus, select:focus {
    border-color: var(--primary);
    outline: none;
}

/* UTILS */
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }

/* ==========================================================================
   SIDEBAR ACTIONS
   ========================================================================== */

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ==========================================================================
   ADMIN BUTTON
   ========================================================================== */

#admin-button-container {
    margin-bottom: 12px;
}

.admin-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(238, 90, 36, 0.2);
}

.admin-button:hover {
    background: linear-gradient(135deg, #ee5a24 0%, #dc4426 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(238, 90, 36, 0.3);
}

.admin-button i {
    font-size: 16px;
}

.admin-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(238, 90, 36, 0.2);
}

/* ==========================================================================
   RESPONSIVE (MOBILE)
   ========================================================================== */

@media (max-width: 900px) {
    /* Hide resource details on smaller tablets */
    .resource-storage-bar { display: none; }
    .production { display: none; }
    .resource-item { min-width: auto; }
}

@media (max-width: 768px) {
    .game-layout {
        flex-direction: column-reverse; /* Nav at bottom */
    }
    
    .sidebar {
        width: 100%;
        height: 60px; /* Bottom bar height */
        flex-direction: row;
        border-right: none;
        border-top: 1px solid rgba(0, 243, 255, 0.3);
        padding: 0;
    }
    
    .sidebar-header, .sidebar-footer {
        display: none;
    }
    
    .sidebar-nav {
        flex-direction: row;
        padding: 0;
        justify-content: space-around;
        align-items: stretch;
        width: 100%;
    }
    
    .nav-item {
        flex-direction: column;
        justify-content: center;
        padding: 5px;
        font-size: 0.7em;
        border-left: none;
        border-top: 3px solid transparent;
        flex: 1;
    }
    
    .nav-item:hover, .nav-item.active {
        background: transparent;
        border-top-color: var(--primary);
        border-left-color: transparent;
    }
    
    .nav-icon {
        margin: 0;
        font-size: 1.5em;
        margin-bottom: 2px;
    }
    
    .nav-text {
        font-size: 0.9em;
    }
    
    /* Top Bar Mobile */
    .top-bar {
        padding: 0 10px;
    }
    
    .page-title-mobile {
        display: block;
        font-size: 1.1em;
        margin-right: 10px;
        left: 200px;
    }
    
    .planet-selector-mobile {
        left: 10px;
    }

    .planet-selector-mobile select {
        min-width: 180px;
    }

    .resources-bar {
        justify-content: flex-end;
        gap: 10px;
    }
    
    .resource-item {
        gap: 5px;
    }
    
    .resource-value {
        font-size: 0.8em;
    }
    
    .resource-icon {
        width: 20px;
        height: 20px;
    }
    
    /* Content Mobile */
    .content-scroll-area {
        padding: 15px;
        padding-bottom: 80px; /* Space for bottom nav */
    }
    
    .content-header {
        display: none; /* Title is in top bar now */
    }
}

@media (max-width: 480px) {
    .nav-text {
        display: none; /* Icon only on very small screens */
    }
    
    .resources-bar {
        flex-wrap: wrap; /* Allow wrapping on very small screens */
        gap: 8px;
    }
    
    .resources-bar .resource {
        min-width: 60px;
    }
}
