/**
 * Hytale Server Control Panel - Main Styles
 * Material Design mit Minecraft/Hytale Block-Ästhetik
 */

/* ============================================
   CUSTOM FONT
   ============================================ */
@font-face {
    font-family: 'Hytale';
    src: url('../font/hytale.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   CSS VARIABLEN - LIGHT THEME
   ============================================ */
:root {
    /* Hytale Farben */
    --primary-color: #7BBDE9;      /* Eisblau */
    --secondary-color: #FFFFFF;     /* Weiß */
    --accent-color: #6E747A;        /* Felsgrau */
    
    /* UI Farben */
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --info-color: #2196F3;
    
    /* Background */
    --bg-image: url('https://cdn.hytale.com/5e7ba01e50cbcd001176c5f7_26___zone_2_fight.jpg');
    --bg-overlay: rgba(255, 255, 255, 0.92);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(123, 189, 233, 0.3);
    
    /* Text */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    
    /* Schatten */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.25);
    
    /* Block-Effekte */
    --block-border: 3px;
    --block-shadow: 
        3px 3px 0 rgba(0,0,0,0.2),
        6px 6px 0 rgba(0,0,0,0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="dark"] {
    --bg-overlay: rgba(26, 26, 26, 0.92);
    --card-bg: rgba(40, 40, 40, 0.95);
    --card-border: rgba(123, 189, 233, 0.2);
    
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #707070;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.5);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.6);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background mit Hytale Bild */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
    filter: brightness(0.8);
}
    width: 100%;
    height: 100%;
}

/* Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: -1;
    width: 100%;
    height: 100%;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Hytale', 'Segoe UI', sans-serif;
    font-weight: normal;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.75rem; }
h5 { font-size: 1.5rem; }
h6 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.container-fluid {
    width: 100%;
    padding: 20px;
}

/* ============================================
   BLOCK CARD - Material + Minecraft Style
   ============================================ */
.block-card {
    background: var(--card-bg);
    border: var(--block-border) solid var(--card-border);
    border-radius: 0;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--block-shadow);
    transition: all var(--transition-normal);
    position: relative;
    image-rendering: pixelated;
}

.block-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        transparent 50%, 
        var(--primary-color) 100%
    );
}

.block-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        4px 4px 0 rgba(0,0,0,0.2),
        8px 8px 0 rgba(0,0,0,0.1),
        0 8px 16px rgba(123, 189, 233, 0.3);
}

.block-card-header {
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.block-card-title {
    font-family: 'Hytale', sans-serif;
    font-size: 1.75rem;
    margin: 0;
    color: var(--primary-color);
}

.block-card-body {
    color: var(--text-primary);
}

/* ============================================
   BUTTONS - Block Style
   ============================================ */
.btn {
    font-family: 'Hytale', sans-serif;
    font-size: 1rem;
    padding: 12px 24px;
    border: var(--block-border) solid;
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    transition: left var(--transition-normal);
}

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

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
}

.btn:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Button Variants */
.btn-primary {
    background: var(--primary-color);
    border-color: #5a9ec4;
    color: white;
}

.btn-success {
    background: var(--success-color);
    border-color: #3d8b40;
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    border-color: #cc7a00;
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    border-color: #c62828;
    color: white;
}

.btn-secondary {
    background: var(--accent-color);
    border-color: #5a5f63;
    color: white;
}

.btn-outline {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* ============================================
   STATUS BADGE - Pixelated Style
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid;
    font-family: 'Hytale', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
    image-rendering: pixelated;
}

.status-online {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.status-online .status-indicator {
    background: #fff;
}

.status-offline {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.status-offline .status-indicator {
    background: #fff;
}

.status-loading {
    background: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

.status-loading .status-indicator {
    background: #fff;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================
   CONSOLE - Retro Terminal Style
   ============================================ */
.console-container {
    background: #1a1a1a;
    border: var(--block-border) solid #333;
    padding: 16px;
    margin-top: 20px;
    box-shadow: 
        inset 0 0 20px rgba(123, 189, 233, 0.1),
        var(--block-shadow);
    font-family: 'Courier New', 'Consolas', monospace;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid #333;
    color: var(--primary-color);
}

.console-output {
    background: #000;
    border: 2px solid #222;
    padding: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    color: #0f0;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

/* Scrollbar für Console */
.console-output::-webkit-scrollbar {
    width: 12px;
    background: #1a1a1a;
}

.console-output::-webkit-scrollbar-track {
    background: #000;
    border: 1px solid #333;
}

.console-output::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border: 1px solid #333;
}

.console-output::-webkit-scrollbar-thumb:hover {
    background: #5a9ec4;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Hytale', sans-serif;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 3px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
    font-family: inherit;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.1);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 
        inset 2px 2px 0 rgba(0,0,0,0.1),
        0 0 0 3px rgba(123, 189, 233, 0.2);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   ALERTS - Block Style
   ============================================ */
.alert {
    padding: 16px 20px;
    margin-bottom: 20px;
    border: var(--block-border) solid;
    box-shadow: var(--block-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: var(--success-color);
    border-color: #3d8b40;
    color: white;
}

.alert-danger {
    background: var(--danger-color);
    border-color: #c62828;
    color: white;
}

.alert-warning {
    background: var(--warning-color);
    border-color: #cc7a00;
    color: white;
}

.alert-info {
    background: var(--info-color);
    border-color: #1976D2;
    color: white;
}

.alert i {
    font-size: 1.5rem;
}

/* ============================================
   TOGGLE SWITCH - Pixelated
   ============================================ */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--accent-color);
    border: 3px solid rgba(0,0,0,0.2);
    transition: var(--transition-normal);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border: 2px solid rgba(0,0,0,0.1);
    transition: var(--transition-normal);
}

input:checked + .toggle-slider {
    background-color: var(--success-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* ============================================
   GRID SYSTEM
   ============================================ */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ============================================
   LOADING SPINNER - Pixelated
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    image-rendering: pixelated;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    
    .container {
        padding: 10px;
    }
    
    .block-card {
        padding: 16px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}
