/* Star Trek Galaxy - Stylesheet */
/* Farbschema basierend auf STU/Darkwood Design */

:root {
    /* Primäre Farben */
    --primary: #4b7bec;
    --primary-dark: #3867d6;
    --primary-light: #5a8af0;

    /* Akzentfarben */
    --accent: #fd9644;
    --accent-dark: #e68a2e;
    --gold: #ff9947;
    --magenta: #d1335b;
    --purple: #a939b9;
    --green: #2ecc71;

    /* Status-Farben */
    --success: #2ecc71;
    --danger: #d1335b;
    --warning: #ff9947;
    --info: #4b7bec;

    /* Hintergrund */
    --bg-dark: #252628;
    --bg-darker: #10171f;
    --bg-card: #2d2e30;
    --bg-card-hover: #353638;
    --bg-input: #292a2c;

    /* Text */
    --text: #d1d8e0;
    --text-bright: #ffffff;
    --text-muted: #8a959b;
    --text-dimmed: #6c7a89;

    /* Borders */
    --border: #3b3e43;
    --border-light: rgba(255, 255, 255, 0.12);
    --border-active: #fd9644;

    /* Gradient */
    --gradient-accent: linear-gradient(to right, #fd9644 0%, #4b7bec 100%);
    --gradient-primary: linear-gradient(to bottom, #4b7bec 0%, #3867d6 100%);

    /* Schatten */
    --shadow: 0px 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0px 4px 12px rgba(0, 0, 0, 0.3);

    /* Layout */
    --header-height: 64px;
    --sidebar-width: 220px;
    --border-radius: 4px;
    --border-radius-lg: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Ubuntu', 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.48;
    font-size: 15px;
}

/* Animated Stars Background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background:
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 230px 80px, #fff, transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent);
    background-size: 350px 200px;
    animation: stars 60s linear infinite;
    z-index: -1;
}

@keyframes stars {
    from { background-position: 0 0; }
    to { background-position: 350px 200px; }
}

/* Gradient Border Accent */
.gradient-border {
    width: 100%;
    height: 4px;
    background: var(--gradient-accent);
    position: absolute;
    left: 0;
    bottom: 0;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(to bottom, var(--bg-card) 0%, #252628 100%);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-bright);
}

.btn-accent {
    background: linear-gradient(to bottom, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-dark);
}

.btn-success {
    background: linear-gradient(to bottom, var(--success) 0%, #27ae60 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(to bottom, var(--danger) 0%, #b82a4d 100%);
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Links */
a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: #252628;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

/* Landing Page */
.landing .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.landing-header {
    padding: 4rem 0 2rem;
}

.landing-header h1 {
    font-size: 3.5rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.landing-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 3rem 0;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: var(--text-bright);
}

.feature p {
    color: var(--text-muted);
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: var(--bg-darker);
}

.auth-container {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.auth-container h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: normal;
    color: var(--text-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-input);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input::placeholder {
    color: var(--text-dimmed);
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--primary);
}

.auth-link a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-error {
    background: rgba(209, 51, 91, 0.15);
    border-color: var(--danger);
    color: #ff6b8a;
}

.alert-success {
    background: rgba(46, 204, 113, 0.15);
    border-color: var(--success);
    color: #5ddb9a;
}

.alert-warning {
    background: rgba(255, 153, 71, 0.15);
    border-color: var(--warning);
    color: #ffb77a;
}

.alert-info {
    background: rgba(75, 123, 236, 0.15);
    border-color: var(--info);
    color: #7da0f0;
}

/* Game Page Layout */
.game-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: var(--header-height);
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
}

.game-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.game-header .logo {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-bright);
    text-transform: uppercase;
}

.game-header .logo span {
    color: var(--accent);
}

.resources {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.resource {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resource-icon {
    font-size: 1.25rem;
}

.resource-name {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.resource-value {
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    color: var(--text-bright);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.game-container {
    display: flex;
    flex: 1;
}

/* Game Navigation */
.game-nav {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
}

.nav-section {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-dimmed);
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-bright);
}

.nav-item.active {
    background: rgba(75, 123, 236, 0.15);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-icon {
    font-size: 1.25rem;
}

/* Game Main Content */
.game-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg-dark);
}

.game-main h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-bright);
    position: relative;
}

.game-main h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100px;
    height: 3px;
    background: var(--gradient-accent);
}

/* Overview */
.planet-info {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.overview-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: border-color 0.2s;
}

.overview-card:hover {
    border-color: var(--primary);
}

.overview-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-bright);
}

.overview-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Building List */
.building-list, .ship-list, .research-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.building-card, .ship-card, .research-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.building-card:hover, .ship-card:hover, .research-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.building-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.building-header h4 {
    color: var(--text-bright);
}

.level {
    background: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.building-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.building-costs, .ship-costs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.cost-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cost-item.sufficient {
    color: var(--success);
}

.cost-item.insufficient {
    color: var(--danger);
}

.ship-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-light);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    color: var(--text-bright);
    font-weight: 500;
}

.ship-build {
    display: flex;
    gap: 0.5rem;
}

.ship-amount {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-input);
    color: var(--text);
}

.ship-amount:focus {
    border-color: var(--accent);
    outline: none;
}

.research-category {
    display: inline-block;
    background: var(--bg-card-hover);
    padding: 4px 8px;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.primary {
    background: var(--primary);
}

.progress-fill.success {
    background: var(--success);
}

.progress-fill.danger {
    background: var(--danger);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-card-hover);
    color: var(--text-bright);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

tr:hover td {
    background: var(--bg-card-hover);
}

/* Faction Colors */
.faction-federation { color: #4b7bec; }
.faction-klingon { color: #d1335b; }
.faction-romulan { color: #2ecc71; }
.faction-cardassian { color: #ff9947; }
.faction-ferengi { color: #ffd700; }
.faction-borg { color: #00ff00; }

/* Responsive */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
    }

    .game-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: flex;
        overflow-x: auto;
        padding: 0;
    }

    .nav-section {
        display: none;
    }

    .nav-item {
        padding: 1rem;
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .nav-item.active {
        border-left: none;
        border-bottom-color: var(--primary);
    }

    .resources {
        justify-content: center;
    }

    .landing-header h1 {
        font-size: 2.5rem;
    }

    .game-header {
        padding: 0.5rem 1rem;
        height: auto;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dimmed);
}

/* Utility Classes */
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-bright { color: var(--text-bright); }

.bg-primary { background-color: var(--primary); }
.bg-card { background-color: var(--bg-card); }
.bg-dark { background-color: var(--bg-dark); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
