/* ============================================================================
   THEME CSS - MODERN INDUSTRIAL DESIGN SYSTEM
   ============================================================================
   
   STRUKTUR:
   1. CSS Variablen (Design Tokens)
   2. Reset & Base
   3. Layout (Container)
   4. Komponenten (Cards, Buttons, Forms, Tables, Menu, Dropdowns, etc.)
   5. Utility Classes
   6. Animations
   7. Responsive
   8. Accessibility
   
   ============================================================================ */


/* ============================================================================
   1. CSS VARIABLEN (DESIGN TOKENS)
   ============================================================================ */

:root {
  /* ----- Design Intensity (0 = minimal, 1 = full effects) ----- */
  --design-intensity: 1;
  
  /* ----- Border Radius ----- */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --border-radius: calc(var(--radius-md) * var(--design-intensity));
  --border-radius-lg: calc(var(--radius-lg) * var(--design-intensity));
  --small-radius: calc(var(--radius-sm) * var(--design-intensity));
  
  /* ----- Spacing ----- */
  --card-padding: 40px;
  --standard-margin: 32px;
  
  /* ----- Colors (overridden by colors/*.css) ----- */
  --primary-color-rgb: 0, 120, 160;
  --secondary-color-rgb: 255, 194, 17;
  --tertiary-color-rgb: 190, 190, 190;
  --danger-color-rgb: 229, 89, 52;
  --success-color-rgb: 2, 164, 205;
  --warning-color-rgb: 255, 194, 17;
  
  --accent-color: #5F412F;
  --accent-light: #FFEEB0;
  --background-color: #f8f9fa;
  --card-color: #fff;
  --card-color-rgb: 255, 255, 255;
  --menu-bg: #3b3d41;
  --text-primary: #2c2d30;
  --text-secondary: #6e6e6e;
  --heading-color: #1a1c1f;
  --border-color: #e8e9ea;
  --input-background: #f8f9fa;
  --success-color: #02A4CD;
  --danger-color: #E55934;
  --warning-color: #FFC211;
  
  /* ----- Shadows ----- */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.02), 0 2px 4px rgba(0,0,0,0.02);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.03), 0 8px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 16px 32px rgba(0,0,0,0.06);
  --card-shadow: var(--shadow-md);
  --card-shadow-hover: 0 4px 8px rgba(var(--primary-color-rgb),0.15), 0 12px 24px rgba(0,0,0,0.08);
  --shadow-glow-primary: 0 0 20px rgba(var(--primary-color-rgb),0.15), 0 0 40px rgba(var(--primary-color-rgb),0.08);
  --shadow-glow-secondary: 0 0 20px rgba(var(--secondary-color-rgb),0.15), 0 0 40px rgba(var(--secondary-color-rgb),0.08);
  
  /* ----- Glassmorphism ----- */
  --blur-light: 8px;
  --blur-medium: 16px;
  --blur-strong: 24px;
  --glass-opacity: 0.88;
  --glass-border: rgba(var(--primary-color-rgb), 0.12);
  
  /* ----- Transitions ----- */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.1, 1);
  
  /* ----- Z-Index ----- */
  --z-dropdown: 1010;
  --z-sticky: 990;
  --z-fixed: 1000;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-toast: 10000;
}

[data-theme="dark"] {
  --accent-color: #483124;
  --accent-light: #F7D980;
  --background-color: #0d0e0f;
  --card-color: #1a1c1f;
  --card-color-rgb: 26, 28, 31;
  --menu-bg: #0d0e0f;
  --text-primary: #e8e9ea;
  --text-secondary: #9a9c9e;
  --heading-color: #e8e9ea;
  --border-color: #2a2c30;
  --input-background: #1a1c1f;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
  --card-shadow-hover: 0 4px 12px rgba(var(--primary-color-rgb),0.15), 0 12px 32px rgba(0,0,0,0.4);
  --glass-opacity: 0.82;
  --glass-border: rgba(var(--primary-color-rgb), 0.18);
}


/* ============================================================================
   2. RESET & BASE
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  margin: 0;
  padding: 70px 0 80px 0;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5em 0;
}

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

p { margin: 0 0 1rem 0; }

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


/* ============================================================================
   3. LAYOUT
   ============================================================================ */

.container { max-width: 1280px; margin: var(--standard-margin) auto; padding: var(--standard-margin); }
.container-small { max-width: 960px; margin: var(--standard-margin) auto; padding: var(--standard-margin); }
.container-super-small { max-width: 800px; margin: var(--standard-margin) auto; padding: var(--standard-margin); }
.container-big { max-width: 1680px; margin: var(--standard-margin) auto; padding: var(--standard-margin); }

.background-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(var(--primary-color-rgb),0.04), transparent 50%),
              radial-gradient(ellipse at bottom left, rgba(var(--secondary-color-rgb),0.04), transparent 50%);
  z-index: -1;
  pointer-events: none;
}

.bg-overlay-admin {
  background: radial-gradient(ellipse at top left, rgba(var(--secondary-color-rgb),0.04), transparent 50%),
              radial-gradient(ellipse at bottom right, rgba(var(--primary-color-rgb),0.04), transparent 50%);
}


/* ============================================================================
   4.1 CARDS
   ============================================================================ */

.card {
  background: rgba(var(--card-color-rgb), var(--glass-opacity));
  backdrop-filter: blur(var(--blur-strong)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(120%);
  padding: var(--card-padding);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin-bottom: var(--standard-margin);
  text-align: center;
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* Glassmorphic Glow-Line on Top */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent,
    rgba(var(--primary-color-rgb), 0.6),
    transparent
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Subtle Gradient Overlay */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(255,255,255,0.05) 0%,
    transparent 50%,
    rgba(0,0,0,0.02) 100%
  );
  pointer-events: none;
  border-radius: var(--border-radius);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.card:hover::before {
  opacity: 1;
}

/* Card Variants - Full Background with Gradient */
.card-full-primary { 
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); 
  color: white; 
  border: none;
  box-shadow: var(--card-shadow), 0 8px 32px rgba(var(--primary-color-rgb), 0.25);
}
.card-full-primary::after {
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
}
.card-full-primary:hover {
  box-shadow: var(--card-shadow-hover), 0 12px 40px rgba(var(--primary-color-rgb), 0.35);
}

.card-full-secondary { 
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark)); 
  color: #2c2d30; 
  border: none;
  box-shadow: var(--card-shadow), 0 8px 32px rgba(var(--secondary-color-rgb), 0.25);
}
.card-full-secondary::after {
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
}

.card-full-tertiary { 
  background: linear-gradient(135deg, var(--tertiary-color), var(--tertiary-dark)); 
  color: var(--text-primary); 
  border: none;
}

/* Card Variants - Light Glassmorphic Background */
.card-light-primary { 
  background: linear-gradient(135deg,
    rgba(var(--primary-color-rgb), 0.15),
    rgba(var(--primary-color-rgb), 0.05)
  );
  border: 1px solid rgba(var(--primary-color-rgb), 0.2);
  backdrop-filter: blur(var(--blur-medium)) saturate(150%);
  position: relative;
  overflow: hidden;
}
.card-light-primary::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.2) 0%, transparent 70%);
  pointer-events: none;
}
.card-light-primary:hover {
  background: linear-gradient(135deg,
    rgba(var(--primary-color-rgb), 0.2),
    rgba(var(--primary-color-rgb), 0.08)
  );
  border-color: rgba(var(--primary-color-rgb), 0.35);
}

.card-light-secondary { 
  background: linear-gradient(135deg,
    rgba(var(--secondary-color-rgb), 0.15),
    rgba(var(--secondary-color-rgb), 0.05)
  );
  border: 1px solid rgba(var(--secondary-color-rgb), 0.2);
  backdrop-filter: blur(var(--blur-medium)) saturate(150%);
  position: relative;
  overflow: hidden;
}
.card-light-secondary::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(var(--secondary-color-rgb), 0.2) 0%, transparent 70%);
  pointer-events: none;
}
.card-light-secondary:hover {
  background: linear-gradient(135deg,
    rgba(var(--secondary-color-rgb), 0.2),
    rgba(var(--secondary-color-rgb), 0.08)
  );
}

.card-light-tertiary { 
  background: linear-gradient(135deg,
    rgba(var(--tertiary-color-rgb), 0.15),
    rgba(var(--tertiary-color-rgb), 0.05)
  );
  border: 1px solid rgba(var(--tertiary-color-rgb), 0.2);
}

/* Card Variants - Accent Style (Glassmorphic Glow) */
.card-primary { 
  text-align: left; 
  border: 1px solid rgba(var(--primary-color-rgb), 0.3);
  background: linear-gradient(135deg, 
    rgba(var(--primary-color-rgb), 0.1) 0%,
    rgba(var(--card-color-rgb), var(--glass-opacity)) 30%
  );
  box-shadow: var(--card-shadow), 0 0 20px rgba(var(--primary-color-rgb), 0.15);
}
.card-primary:hover {
  border-color: rgba(var(--primary-color-rgb), 0.5);
  box-shadow: var(--card-shadow-hover), 0 0 30px rgba(var(--primary-color-rgb), 0.25);
}

.card-secondary { 
  text-align: left; 
  border: 1px solid rgba(var(--secondary-color-rgb), 0.3);
  background: linear-gradient(135deg, 
    rgba(var(--secondary-color-rgb), 0.1) 0%,
    rgba(var(--card-color-rgb), var(--glass-opacity)) 30%
  );
  box-shadow: var(--card-shadow), 0 0 20px rgba(var(--secondary-color-rgb), 0.15);
}
.card-secondary:hover {
  border-color: rgba(var(--secondary-color-rgb), 0.5);
  box-shadow: var(--card-shadow-hover), 0 0 30px rgba(var(--secondary-color-rgb), 0.25);
}

.card-tertiary { 
  text-align: left; 
  border: 1px solid rgba(var(--tertiary-color-rgb), 0.3);
  background: linear-gradient(135deg, 
    rgba(var(--tertiary-color-rgb), 0.1) 0%,
    rgba(var(--card-color-rgb), var(--glass-opacity)) 30%
  );
  box-shadow: var(--card-shadow), 0 0 20px rgba(var(--tertiary-color-rgb), 0.15);
}

.card-danger { 
  text-align: left; 
  border: 1px solid rgba(var(--danger-color-rgb), 0.3);
  background: linear-gradient(135deg, 
    rgba(var(--danger-color-rgb), 0.1) 0%,
    rgba(var(--card-color-rgb), var(--glass-opacity)) 30%
  );
  box-shadow: var(--card-shadow), 0 0 20px rgba(var(--danger-color-rgb), 0.15);
}

.card-success { 
  text-align: left; 
  border: 1px solid rgba(var(--success-color-rgb), 0.3);
  background: linear-gradient(135deg, 
    rgba(var(--success-color-rgb), 0.1) 0%,
    rgba(var(--card-color-rgb), var(--glass-opacity)) 30%
  );
  box-shadow: var(--card-shadow), 0 0 20px rgba(var(--success-color-rgb), 0.15);
}

.border-thin { border-left-width: 2px; }


/* ============================================================================
   4.2 BUTTONS
   ============================================================================ */

.button, button, input[type="submit"], input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--small-radius);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  background: var(--primary-color);
  color: white;
}

.button:hover, button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-primary);
}

.button:active, button:active { transform: translateY(0) scale(0.98); }

.button-primary { background: var(--primary-color); color: white; }
.button-secondary { background: var(--secondary-color); color: #2c2d30; }
.button-danger { background: var(--danger-color); color: white; }
.button-success { background: var(--success-color); color: white; }
.button-warning { background: var(--warning-color); color: #2c2d30; }

.button-outline-primary { background: transparent; color: var(--primary-color); border: 2px solid var(--primary-color); }
.button-outline-primary:hover { background: var(--primary-color); color: white; }

.button-sm { padding: 8px 16px; font-size: 14px; }
.button-lg { padding: 16px 32px; font-size: 16px; }
.button-block { display: block; width: 100%; }

/* Legacy */
.btn-primary { background: var(--primary-color); color: white; }
.btn-success { background: var(--success-color); color: white; }
.btn-danger { background: var(--danger-color); color: white; }
.cancel-btn { background: var(--text-secondary); color: white; }


/* ============================================================================
   4.3 FORMS
   ============================================================================ */

input, textarea, select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--small-radius);
  background: var(--input-background);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

input:hover, textarea:hover, select:hover { border-color: rgba(var(--primary-color-rgb),0.3); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--card-color);
  box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb),0.08);
}

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }

.checkbox-container { display: flex; align-items: center; gap: 10px; }
.checkbox-container input[type="checkbox"] { width: auto; }

.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 48px;
  text-align: center;
  background: var(--input-background);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.upload-area:hover, .upload-area.dragover { border-color: var(--primary-color); }


/* ============================================================================
   4.4 TABLES
   ============================================================================ */

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { font-weight: 600; background: var(--input-background); }
tbody tr:hover { background: rgba(var(--primary-color-rgb),0.04); }
.table-striped tbody tr:nth-child(even) { background: var(--input-background); }
.table-responsive { overflow-x: auto; }


/* ============================================================================
   4.5 MENU / NAVIGATION
   ============================================================================ */

#menu-container {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: var(--z-fixed);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

#menu-container nav {
  padding: 12px 24px;
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(var(--primary-color-rgb), 0.55);
  backdrop-filter: blur(var(--blur-strong)) saturate(220%);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(220%);
  z-index: var(--z-fixed);
  box-sizing: border-box;
  isolation: isolate;
}

#menu-container nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#menu-container nav li { display: flex; align-items: center; }

#menu-container nav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--small-radius);
  font-size: 15px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

#menu-container nav a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

#menu-container nav a:hover::before {
  width: 200px;
  height: 200px;
}

#menu-container nav a:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.profile-menu { position: relative; }

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: white;
  padding: 8px 12px;
  border-radius: var(--small-radius);
  transition: all var(--transition-fast);
}

.profile-trigger:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.profile-picture {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

.profile-username {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.dropdown-arrow {
  margin-left: 5px;
  font-size: 12px;
  transition: transform 0.4s ease;
}

.profile-menu.open .dropdown-arrow { transform: rotate(180deg); }

/* Dashboard Main Link */
.dashboard-main { position: absolute; left: 50%; transform: translateX(-50%); }

.main-link {
  font-size: 18px !important;
  font-weight: 700 !important;
  padding: 12px 24px !important;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(var(--primary-color-rgb),0.3);
}
.main-link:hover { transform: translateY(-3px) !important; box-shadow: var(--shadow-glow-primary); }


/* ============================================================================
   4.6 DROPDOWNS
   ============================================================================ */

.profile-dropdown {
  position: absolute;
  top: 74px;
  left: 0;
  margin-top: 8px;
  background: rgba(var(--card-color-rgb),0.95);
  backdrop-filter: blur(var(--blur-medium));
  -webkit-backdrop-filter: blur(var(--blur-medium));
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-border);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: all var(--transition-normal);
  z-index: var(--z-dropdown);
}

.profile-menu.open .profile-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: rgba(var(--primary-color-rgb),0.08); padding-left: 22px; }
.dropdown-item i { width: 20px; text-align: center; color: var(--primary-color); }

.dropdown-section {
  padding: 10px 18px;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--input-background);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menuetext { color: var(--text-primary) !important; }
.menuetext:hover { color: var(--primary-color) !important; }

/* Submenu */
.submenu-container { position: relative; }
.submenu-arrow { margin-left: auto; font-size: 10px; transition: transform var(--transition-fast); }
.submenu-container:hover .submenu-arrow { transform: rotate(90deg); }

.submenu-container,
.submenu-trigger { position: relative; }

.submenu {
  position: absolute;
  top: 0; left: 100%;
  background: rgba(var(--card-color-rgb),0.95);
  backdrop-filter: blur(var(--blur-medium));
  -webkit-backdrop-filter: blur(var(--blur-medium));
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-border);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all var(--transition-fast);
  z-index: 1050;
  pointer-events: none;
}

.submenu-container:hover > .submenu,
.submenu-trigger:hover > .submenu { 
  opacity: 1; 
  visibility: visible; 
  transform: translateX(0);
  pointer-events: auto;
}

.submenu-container > .dropdown-item,
.submenu-trigger.dropdown-item { justify-content: space-between; }

.submenu-container:hover > .dropdown-item .submenu-arrow,
.submenu-trigger:hover .submenu-arrow { transform: rotate(90deg); }

.logout-btn {
  background: linear-gradient(135deg, var(--danger-color), #c82333);
  color: white;
  width: 100%;
  border: none;
  padding: 14px 18px;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-fast);
}
.logout-btn:hover { filter: brightness(0.9); }


/* ============================================================================
   4.7 SEARCH
   ============================================================================ */

.search-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: var(--small-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.search-toggle:hover { background: rgba(255,255,255,0.15); }
.search-toggle-container { margin-left: auto; }

.search-container {
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  background: color-mix(in srgb, var(--card-color) 40%, transparent);
  backdrop-filter: blur(var(--blur-strong)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(120%);
  padding: 24px 32px;
  box-sizing: border-box;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 16px 64px rgba(0, 0, 0, 0.08);
  transform: translateY(-100%);
  transition: transform 0.4s var(--transition-smooth);
  z-index: 990;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-color);
  visibility: hidden;
  opacity: 0;
}
.search-container.active { transform: translateY(0); visibility: visible; opacity: 1; }

.search-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.search-header h3 { margin: 0; }

.search-close {
  width: 36px;
  height: 36px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  line-height: 1;
  font-size: 24px;

  background: var(--input-background);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}



.search-close:hover {
  background: var(--danger-color);
  color: white;
}

.search-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--input-background);
  padding: 6px;
  border-radius: var(--border-radius);
}

.search-tab {
  padding: 10px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: var(--small-radius);
  font-weight: 500;
  transition: all var(--transition-fast);
}
.search-tab:hover { background: var(--card-color); color: var(--text-primary); }
.search-tab.active { background: var(--primary-color); color: white; box-shadow: var(--shadow-glow-primary); }

.search-input-container { position: relative; margin-bottom: 20px; }
.search-input { width: 100%; padding: 14px 18px 14px 48px; }
.search-icon { position: absolute; top: 50%; left: 16px; transform: translateY(-50%); color: var(--text-secondary); }

.search-results { max-height: 400px; overflow-y: auto; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}
.search-result-item:hover { background: rgba(var(--primary-color-rgb),0.06); padding-left: 24px; border-left: 3px solid var(--primary-color); }

.result-image { width: 48px; height: 48px; border-radius: var(--small-radius); object-fit: cover; }
.result-info { flex: 1; overflow: hidden; }
.result-title { font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-subtitle { font-size: 13px; color: var(--text-secondary); }


/* ============================================================================
   4.8 NOTIFICATIONS
   ============================================================================ */

.notification-menu, .messages-menu { position: relative; }

.notification-trigger, .messages-trigger {
  cursor: pointer;
  color: white;
  padding: 10px 16px;
  border-radius: var(--small-radius);
  position: relative;
  transition: all var(--transition-fast);
}
.notification-trigger:hover, .messages-trigger:hover { background: rgba(255,255,255,0.15); }

.notification-count, .message-count {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--danger-color);
  color: white;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-dropdown {
  position: absolute;
  top: 100%; right: -100px;
  margin-top: 8px;
  background: rgba(var(--card-color-rgb),0.95);
  backdrop-filter: blur(var(--blur-medium));
  -webkit-backdrop-filter: blur(var(--blur-medium));
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-border);
  width: 360px;
  max-width: 90vw;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: all var(--transition-normal);
  z-index: var(--z-dropdown);
}
.notification-menu.open .notification-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--input-background);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}
.dropdown-header h3 { margin: 0; font-size: 17px; }

.mark-all-read {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--small-radius);
  transition: all var(--transition-fast);
}
.mark-all-read:hover { background: rgba(var(--primary-color-rgb),0.1); }

.notification-list { max-height: 400px; overflow-y: auto; }

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}
.notification-item:hover { background: rgba(var(--primary-color-rgb),0.04); }

.notification-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(var(--primary-color-rgb),0.1);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-content { flex: 1; }
.notification-text { margin-bottom: 6px; font-size: 14px; }
.notification-time { font-size: 12px; color: var(--text-secondary); }

.notification-unread { background: rgba(var(--primary-color-rgb),0.06); }
.notification-unread .notification-icon { background: var(--primary-color); color: white; }

.dropdown-footer {
  padding: 12px 20px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: var(--input-background);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}
.dropdown-footer a { color: var(--primary-color) !important; font-weight: 500; }

.loading-indicator, .empty-notifications { padding: 32px 20px; text-align: center; color: var(--text-secondary); }


/* ============================================================================
   4.9 DIALOGS & MODALS
   ============================================================================ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(var(--blur-light));
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}
.overlay.active { opacity: 1; visibility: visible; }

.message-box {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--primary-color);
  color: white;
  padding: 32px;
  border-radius: var(--border-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 500px;
  width: 90%;
  text-align: center;
  z-index: var(--z-modal);
  opacity: 0;
  display: none;
  transition: all var(--transition-normal);
}
.message-box.show { display: block; opacity: 1; transform: translate(-50%, -50%) scale(1); }

#message-box, #confirm-box {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% - 20px)) scale(0.95);
  background: var(--card-color);
  color: var(--text-primary);
  padding: var(--card-padding);
  border-radius: var(--border-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
  max-width: 500px;
  z-index: var(--z-modal);
  opacity: 0;
  transition: all var(--transition-normal);
}
#message-box.visible, #confirm-box.visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.button-dialog-message {
  display: block;
  margin: 24px auto 0;
  padding: 12px 28px;
  background: var(--primary-dark);
  color: white;
  border: none;
  border-radius: var(--small-radius);
  cursor: pointer;
}


/* ============================================================================
   4.10 TOASTS & ALERTS
   ============================================================================ */

.toast-messages {
  position: fixed;
  top: 80px; right: 24px;
  z-index: var(--z-toast);
  max-width: 420px;
}

.toast-message {
  background: var(--card-color);
  backdrop-filter: blur(var(--blur-medium));
  color: var(--text-primary);
  padding: 16px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  opacity: 0;
  transform: translateX(120%);
  transition: all var(--transition-normal);
}
.toast-message.show { opacity: 1; transform: translateX(0); }
.toast-message.success { border-left-color: var(--success-color); }
.toast-message.error { border-left-color: var(--danger-color); }
.toast-message.warning { border-left-color: var(--warning-color); }

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  margin-left: 16px;
}

.flash-messages { position: fixed; top: 80px; right: 24px; z-index: var(--z-toast); max-width: 400px; }

.flash-message {
  padding: 16px 20px;
  border-radius: var(--small-radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
  color: white;
}
.flash-message.success { background: var(--success-color); }
.flash-message.error { background: var(--danger-color); }
.flash-message.warning { background: var(--warning-color); color: #2c2d30; }
.flash-message.info { background: var(--primary-color); }


/* ============================================================================
   4.11 LISTS & USER ITEMS
   ============================================================================ */

.list { list-style: none; padding: 0; margin: 0; max-height: 0; overflow: hidden; transition: max-height var(--transition-normal); }
.list.open { max-height: 2000px; }
.list.visible { max-height: none; }
.list li { padding: 12px 20px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: all var(--transition-fast); }
.list li:hover { background: var(--input-background); padding-left: 24px; }

.user-list { display: grid; gap: 16px; }

.user-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-radius: var(--border-radius);
  background: var(--card-color);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.user-item:hover { transform: translateX(6px); box-shadow: var(--shadow-md); }

.user-info { flex: 1; }
.user-info p { margin: 4px 0; color: var(--text-secondary); font-size: 14px; }

.profile-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--input-background);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  font-weight: 600;
  color: var(--primary-color);
  border: 2px solid var(--border-color);
}


/* ============================================================================
   4.12 BADGES
   ============================================================================ */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--small-radius);
  font-size: 12px;
  font-weight: 600;
}
.badge-primary { background: var(--primary-color); color: white; }
.badge-secondary { background: var(--secondary-color); color: #2c2d30; }
.badge-success { background: var(--success-color); color: white; }
.badge-danger { background: var(--danger-color); color: white; }
.badge-warning { background: var(--warning-color); color: #2c2d30; }

.admin-badge { display: inline-block; padding: 4px 10px; border-radius: var(--small-radius); font-size: 12px; font-weight: 600; text-transform: uppercase; margin-left: 10px; }
.admin-level-0 { background: var(--danger-color); color: white; }
.admin-level-1 { background: var(--success-color); color: white; }
.admin-level-2 { background: #f39c12; color: white; }


/* ============================================================================
   4.13 TABS
   ============================================================================ */

.tabs-nav {
  display: flex;
  gap: 8px;
  padding: 20px;
  background: var(--input-background);
  border-radius: var(--border-radius);
  margin-bottom: 24px;
}

.tab-item {
  padding: 12px 24px;
  border-radius: var(--small-radius);
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.tab-item:hover { background: var(--card-color); color: var(--text-primary); }
.tab-item.active { background: var(--primary-color); color: white; box-shadow: var(--shadow-glow-primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }


/* ============================================================================
   4.14 LOADING & SPINNER
   ============================================================================ */

.loading {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(var(--blur-light));
  z-index: var(--z-modal);
  display: none;
  justify-content: center;
  align-items: center;
}
.loading.show { display: flex; }

.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}


/* ============================================================================
   5. UTILITY CLASSES
   ============================================================================ */

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* Flexbox */
.flex { display: flex; }
.flex-column, .flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

/* Gap */
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }

/* Margin */
.m-0 { margin: 0 !important; }
.m-1 { margin: 8px !important; }
.m-2 { margin: 16px !important; }
.m-3 { margin: 24px !important; }
.m-4 { margin: 32px !important; }
.m-5 { margin: 40px !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-4 { margin-top: 32px !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }
.ml-1 { margin-left: 8px !important; }
.ml-2 { margin-left: 16px !important; }
.mr-1 { margin-right: 8px !important; }
.mr-2 { margin-right: 16px !important; }

/* Padding */
.p-0 { padding: 0 !important; }
.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }
.p-4 { padding: 32px !important; }

/* Text */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-white { color: white; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }
.text-gray { color: var(--text-secondary); }
.font-bold { font-weight: 600; }

/* Background */
.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--secondary-color); }
.bg-success { background-color: var(--success-color); }
.bg-danger { background-color: var(--danger-color); }
.bg-warning { background-color: var(--warning-color); }
.bg-primary-10 { background-color: rgba(var(--primary-color-rgb),0.1); }
.bg-danger-10 { background-color: rgba(var(--danger-color-rgb),0.1); }

/* Border Radius */
.rounded { border-radius: var(--small-radius); }
.rounded-lg { border-radius: var(--border-radius); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Width */
.w-100 { width: 100%; }
.w-auto { width: auto; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Hover Effects */
.hover-scale { transition: transform var(--transition-fast); }
.hover-scale:hover { transform: scale(1.03); }
.hover-lift { transition: all var(--transition-fast); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }


/* ============================================================================
   6. ANIMATIONS
   ============================================================================ */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.fade-in { animation: fadeIn 0.4s ease-out; }
.slide-in { animation: slideIn 0.4s ease-out; }
.scale-in { animation: scaleIn 0.3s ease-out; }


/* ============================================================================
   7. RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
  :root { --card-padding: 24px; --standard-margin: 20px; }
  body { padding-top: 60px; }
  .container, .container-small, .container-big { padding: 16px; }
  .card { padding: 20px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  
  #menu-container nav { padding: 10px 16px; }
  .profile-username { display: none; }
  .search-toggle span { display: none; }
  .notification-dropdown { right: -130px; width: 300px; }
  .submenu { left: auto; right: 100%; }
  
  .tabs-nav { flex-direction: column; padding: 16px; }
  .toast-messages, .flash-messages { top: 70px; right: 12px; left: 12px; max-width: none; }
}


/* ============================================================================
   8. ACCESSIBILITY
   ============================================================================ */

*:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ============================================================================
   ADDITIONAL COMPONENTS
   ============================================================================ */

.button-group { display: flex; gap: 12px; flex-wrap: wrap; }

.action-button { padding: 8px 16px; border: none; border-radius: var(--small-radius); font-size: 14px; cursor: pointer; transition: all var(--transition-fast); }
.action-button:hover { transform: translateY(-2px); }
.delete-button { background: var(--danger-color); color: white; }
.promote-button { background: var(--primary-color); color: white; }
.demote-button { background: #f39c12; color: white; }

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--small-radius);
  margin-bottom: 20px;
  transition: all var(--transition-fast);
}
.back-link:hover { background: rgba(var(--primary-color-rgb),0.1); color: var(--primary-color); transform: translateX(-4px); }

.heading-primary { color: var(--primary-color); }
.heading-secondary { color: var(--secondary-color); }
.heading-bordered { border-bottom: 3px solid var(--border-color); padding-bottom: 12px; margin-bottom: 24px; }
.heading-bordered-primary { border-bottom: 3px solid var(--primary-color); padding-bottom: 12px; margin-bottom: 24px; }

.theme-toggle-container { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-color); }
.theme-switch { position: relative; width: 52px; height: 28px; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--tertiary-color); border-radius: 28px; cursor: pointer; transition: var(--transition-normal); }
.slider:before { content: ""; position: absolute; height: 20px; width: 20px; left: 4px; bottom: 4px; background: white; border-radius: 50%; transition: var(--transition-normal); }
input:checked + .slider { background: var(--primary-color); }
input:checked + .slider:before { transform: translateX(24px); }

.menu-separator { border-top: 5px solid var(--input-background); margin: 1px 0; }

/* Scrollbar */
.search-results::-webkit-scrollbar, .notification-list::-webkit-scrollbar { width: 8px; }
.search-results::-webkit-scrollbar-track, .notification-list::-webkit-scrollbar-track { background: var(--input-background); border-radius: 10px; }
.search-results::-webkit-scrollbar-thumb, .notification-list::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 10px; }

.fade-out { opacity: 1; transition: opacity var(--transition-normal); }
.fade-out.hidden { opacity: 0; }


/* ============================================================================
   FOOTER
   ============================================================================ */

#global-footer {
  background: linear-gradient(135deg, 
    rgba(var(--primary-color-rgb), 0.04), 
    rgba(var(--secondary-color-rgb), 0.03)
  );
  backdrop-filter: blur(var(--blur-medium)) saturate(110%);
  -webkit-backdrop-filter: blur(var(--blur-medium)) saturate(110%);
  border-top: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 24px 0;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: var(--z-dropdown);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.04), 0 -8px 32px rgba(0,0,0,0.02);
  animation: footerSlideUp 0.6s ease-out;
}

[data-theme="dark"] #global-footer {
  background: linear-gradient(135deg, 
    rgba(var(--primary-color-rgb), 0.06), 
    rgba(var(--secondary-color-rgb), 0.04)
  );
  box-shadow: 0 -4px 16px rgba(0,0,0,0.2), 0 -8px 32px rgba(0,0,0,0.15);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.copyright {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 6px 12px;
  border-radius: var(--small-radius);
  transition: all var(--transition-fast);
}

.footer-links a::before {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 12px;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-normal);
}

.footer-links a:hover {
  color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.06);
  transform: translateY(-1px);
}

.footer-links a:hover::before {
  width: calc(100% - 24px);
}

.divider {
  color: var(--border-color);
  user-select: none;
}

@keyframes footerSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  #global-footer { padding: 20px 0; }
  .footer-container { padding: 0 20px; }
  .footer-content { flex-direction: column; text-align: center; gap: 16px; }
  .footer-links { justify-content: center; }
}