/* VeoBanana - Modern Dark Mode Cinematic Design - COMPLETE REWRITE */

:root {
  /* Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --bg-card: #1e1e1e;
  --bg-hover: #2d2d2d;
  
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-muted: #666666;
  
  --accent-primary: #ff6b35;
  --accent-secondary: #ffaa00;
  --accent-gradient: linear-gradient(135deg, #ff6b35, #ffaa00);
  
  --success: #00ff88;
  --warning: #ffaa00;
  --error: #ff4444;
  --info: #00aaff;
  
  --border-color: #333333;
  --border-hover: #444444;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.3);
  
  /* Transitions */
  --transition: all 0.2s ease;
  
  /* Z-indexes - KORRIGIERT */
  --z-header: 100;
  --z-modal: 10000;
  --z-loading: 10001;
  --z-notifications: 10002;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.5rem;
}

.logo-icon {
  font-size: 2rem;
}

.logo-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  gap: var(--space-md);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  transition: var(--transition);
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--accent-primary);
  background: rgba(255, 107, 53, 0.1);
}

/* Main Content */
.main {
  min-height: calc(100vh - 140px);
  padding: var(--space-xl) 0;
}

/* Page Header */
.page-header {
  margin-bottom: var(--space-2xl);
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.page-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
}

.card-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.card-content {
  padding: var(--space-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.btn-success {
  background: var(--success);
  color: var(--bg-primary);
}

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

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-family);
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-lg) 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-brand {
  font-weight: 600;
  color: var(--accent-primary);
}

/* MODAL STYLES - KORRIGIERT FÜR Z-INDEX */
.modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.9) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: var(--z-modal) !important;
  padding: var(--space-md);
  backdrop-filter: blur(4px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  display: none !important;
}

.modal-content {
  background: var(--bg-card) !important;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: calc(var(--z-modal) + 1) !important;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.modal-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* Image Modal Specific */
.image-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
}

/* VEOBANANA LOADING OVERLAY */
.vb-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loading);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.vb-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.vb-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  background: var(--bg-card);
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.vb-loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-tertiary);
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  animation: vb-spin 1s linear infinite;
}

.vb-loading-text {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 500;
  text-align: center;
}

/* VEOBANANA NOTIFICATIONS */
.vb-notifications-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-notifications);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 400px;
  pointer-events: none;
}

.vb-notification {
  pointer-events: all;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: vb-slide-in 0.3s ease;
  backdrop-filter: blur(10px);
}

.vb-notification-success {
  border-left: 4px solid var(--success);
  background: rgba(0, 255, 136, 0.1);
}

.vb-notification-error {
  border-left: 4px solid var(--error);
  background: rgba(255, 68, 68, 0.1);
}

.vb-notification-warning {
  border-left: 4px solid var(--warning);
  background: rgba(255, 170, 0, 0.1);
}

.vb-notification-info {
  border-left: 4px solid var(--info);
  background: rgba(0, 170, 255, 0.1);
}

.vb-notification-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-md);
  gap: var(--space-md);
}

.vb-notification-message {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.vb-notification-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
}

.vb-notification-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ANIMATIONS */
@keyframes vb-spin {
  from { 
    transform: rotate(0deg); 
  }
  to { 
    transform: rotate(360deg); 
  }
}

@keyframes vb-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-spin {
  animation: vb-spin 1s linear infinite;
}

/* Utility Classes */
.hidden { 
  display: none !important; 
}

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

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

/* Responsive */
@media (max-width: 768px) {
  .header-content { 
    flex-direction: column; 
    gap: var(--space-md); 
  }
  
  .nav { 
    flex-wrap: wrap; 
    justify-content: center; 
  }
  
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .vb-notifications-container {
    left: 10px;
    right: 10px;
    max-width: none;
  }
  
  .vb-loading-content {
    margin: var(--space-md);
    padding: var(--space-lg);
  }
  
  .modal {
    padding: var(--space-sm);
  }
  
  .modal-content {
    margin: var(--space-sm);
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }
  
  .card-content {
    padding: var(--space-md);
  }
  
  .page-header h1 {
    font-size: 2rem;
  }
  
  .modal-content {
    margin: var(--space-xs);
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }
}