/* ============================================
   EnWo-CMS - Mature & Modern WoW Design
   Inspired by "Endless Worlds"
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Endless Worlds Palette - Mature Dark */
    --bg-dark: #05070a;
    --bg-surface: #0d1117;
    --bg-card: #161b22;
    --bg-card-hover: #1c2128;
    
    /* Primary Accent - Endless Worlds Cyan/Blue */
    --primary: #1f6feb; /* Alias für accent-secondary für Kompatibilität */
    --accent-primary: #58a6ff;
    --accent-primary-dim: rgba(88, 166, 255, 0.1);
    --accent-secondary: #1f6feb;
    
    /* Semantic Colors - Mature Tones */
    --success: #3fb950;
    --warning: #d29922;
    --error: #f85149;
    --info: #388bfd;
    
    /* Neutral / Text */
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --text-bright: #f0f6fc;
    --border-main: #30363d;
    --border-light: rgba(240, 246, 252, 0.1);
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 72px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    /* Shadows - Deep & Subtle */
    --shadow-sm: 0 1px 0 rgba(1, 4, 9, 0.4);
    --shadow-md: 0 8px 24px rgba(1, 4, 9, 0.5);
    --shadow-lg: 0 12px 48px rgba(1, 4, 9, 0.7);
    
    /* Transitions */
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    /* WoW Class Colors (Modernized) */
    --wow-warrior: #C79C6E;
    --wow-paladin: #F58CBA;
    --wow-hunter: #ABD473;
    --wow-rogue: #FFF569;
    --wow-priest: #FFFFFF;
    --wow-deathknight: #C41F3B;
    --wow-shaman: #0070DE;
    --wow-mage: #69CCF0;
    --wow-warlock: #9482C9;
    --wow-monk: #00FF96;
    --wow-druid: #FF7D0A;
    --wow-demonhunter: #A330C9;
    --wow-evoker: #33937F;
}

/* ============================================
   Base Reset & Typography
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: var(--bg-dark) !important;
    scrollbar-gutter: stable;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark) !important;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-bright);
    font-weight: 700;
}

/* ============================================
   Layout Components
   ============================================ */
#app {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-dark);
    width: 100%;
}

#main-content {
    flex: 1;
    padding: 40px;
    background-color: var(--bg-dark);
    min-width: 0; /* Fix flex overflow */
}

/* Sidebar - Deep Glassmorphism */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 50;
    transition: width var(--transition);
}

.sidebar-header {
    padding: 32px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-main);
}

.sidebar-logo-img {
    height: 56px;
    width: auto;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 0 16px 24px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 24px 12px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-link:hover {
    background-color: var(--bg-card);
    color: var(--text-bright);
}

.nav-link.active {
    background-color: var(--accent-primary-dim);
    color: var(--accent-primary);
}

.nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.nav-link.active .nav-icon {
    opacity: 1;
}

/* Header */
#header {
    min-height: var(--header-height);
    background-color: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    background: transparent !important;
}

.header-title-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-bright) !important;
    margin: 0;
    line-height: 1.3;
    font-family: 'Plus Jakarta Sans', sans-serif;
    padding-top: 2px;
    background: transparent !important;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    background: transparent !important;
}

.header-title-container {
    background: transparent !important;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    background-color: var(--bg-card);
    border-color: var(--border-main);
    color: var(--text-bright);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Cards & UI Components
   ============================================ */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    padding: 24px 24px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 24px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 24px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-main);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-bright);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--accent-secondary);
    color: white;
}

.btn-primary:hover {
    background-color: #2f81f7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 111, 235, 0.3);
}

.btn-secondary {
    background-color: var(--bg-card);
    border-color: var(--border-main);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--text-muted);
}

/* Tables */
.table-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: var(--bg-card);
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-main);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-main);
    font-size: 14px;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-primary { background: var(--accent-primary-dim); color: var(--accent-primary); border: 1px solid rgba(88, 166, 255, 0.2); }
.badge-success { background: rgba(63, 185, 80, 0.1); color: var(--success); border: 1px solid rgba(63, 185, 80, 0.2); }
.badge-warning { background: rgba(210, 153, 34, 0.1); color: var(--warning); border: 1px solid rgba(210, 153, 34, 0.2); }
.badge-error { background: rgba(248, 81, 73, 0.1); color: var(--error); border: 1px solid rgba(248, 81, 73, 0.2); }

/* Forms */
.form-group { margin-bottom: 24px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-bright); margin-bottom: 8px; }
.form-input {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-dim);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

/* Staggered load */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* ============================================
   Login Page Override
   ============================================ */
.login-page {
    background: radial-gradient(circle at top right, #161b22, #05070a);
}

.login-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-main);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted) !important;
    margin-bottom: 0;
    background: transparent !important;
}

.breadcrumbs a {
    color: var(--text-muted) !important;
    background: transparent !important;
}

.breadcrumb-separator { opacity: 0.3; }
.breadcrumb-item.active { color: var(--text-bright); font-weight: 600; }

/* Dropdowns */
.user-menu { position: relative; }
.user-menu-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.user-menu-button:hover {
    background-color: var(--bg-surface);
    border-color: var(--border-main);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent-primary-dim);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info { text-align: left; line-height: 1.2; }
.user-name { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.user-role { font-size: 12px; color: var(--text-muted); }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 100;
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.dropdown-item:hover {
    background-color: var(--bg-card);
    color: var(--text-bright);
}

.dropdown-item.danger:hover {
    background-color: rgba(248, 81, 73, 0.1);
    color: var(--error);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-main);
    margin: 8px 0;
}

/* ============================================
   Utility Classes
   ============================================ */
.w-full,
.btn.w-full,
.form-input.w-full {
    width: 100% !important;
    max-width: 100% !important;
}
.h-full { height: 100% !important; }
.hidden { display: none !important; }
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-center { justify-content: center !important; }
.gap-2 { gap: 8px !important; }
.gap-4 { gap: 16px !important; }
.mt-4 { margin-top: 16px !important; }
.mb-4 { margin-bottom: 16px !important; }
.p-4 { padding: 16px !important; }
.text-center { text-align: center !important; }

/* ============================================
   Dashboard Styles
   ============================================ */
.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.dashboard-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary-dim);
    border-radius: var(--radius-md);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.clickable-card {
    cursor: pointer;
    transition: all var(--transition);
}

.clickable-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* Responsive */
@media (max-width: 1024px) {
    #sidebar { width: 80px; }
    .sidebar-logo-img { height: 40px; }
    .nav-link span, .nav-section-title { display: none; }
    .nav-link { justify-content: center; padding: 12px; }
}

@media (max-width: 768px) {
    #sidebar { position: fixed; left: -100%; height: 100%; width: 280px; }
    #sidebar.open { left: 0; }
    #main-content { padding: 24px; }
    .nav-link span, .nav-section-title { display: block; }
    .nav-link { justify-content: flex-start; }
}
