/**
 * VMHB Theme System - CSS Custom Properties
 * 
 * Zentrales CSS-Variablen-System für Dark/Light Mode
 * Wird vom Admin-Backend gesteuert
 * 
 * Hintergrund: Immer von WordPress (wird NICHT verändert)
 * Overlays: Abdunkelung je nach Mode
 */

:root {
    /* ============================================
       THEME MODE VARIABLEN (vom Admin gesetzt)
       ============================================ */
    
    --vmhb-theme-mode: light;  /* 'light' oder 'dark' */
    --vmhb-overlay-opacity: 0.1;  /* 0.1 (light) oder 0.3 (dark) */
    --vmhb-accent-color: #667eea;
    --vmhb-bg-attachment: scroll;
    --vmhb-text-color: #333;
    --vmhb-bg-color: #fff;
    
    /* ============================================
       LIGHT MODE - Standard Farben
       ============================================ */
    
    --vmhb-light-bg: #ffffff;
    --vmhb-light-text: #333333;
    --vmhb-light-text-secondary: #666666;
    --vmhb-light-text-muted: #999999;
    --vmhb-light-border: #e0e0e0;
    --vmhb-light-card-bg: rgba(255, 255, 255, 0.95);
    --vmhb-light-overlay: rgba(0, 0, 0, 0.1);
    --vmhb-light-shadow: rgba(0, 0, 0, 0.08);
    
    /* ============================================
       DARK MODE - Farben
       ============================================ */
    
    --vmhb-dark-bg: #1a1a2e;
    --vmhb-dark-text: #e5e5e5;
    --vmhb-dark-text-secondary: #b0b0b0;
    --vmhb-dark-text-muted: #808080;
    --vmhb-dark-border: #333333;
    --vmhb-dark-card-bg: rgba(255, 255, 255, 0.08);
    --vmhb-dark-overlay: rgba(0, 0, 0, 0.3);
    --vmhb-dark-shadow: rgba(0, 0, 0, 0.4);
    
    /* ============================================
       DYNAMIC COLORS (werden vom JS gesetzt)
       ============================================ */
    
    --vmhb-current-text: var(--vmhb-light-text);
    --vmhb-current-text-secondary: var(--vmhb-light-text-secondary);
    --vmhb-current-text-muted: var(--vmhb-light-text-muted);
    --vmhb-current-border: var(--vmhb-light-border);
    --vmhb-current-card-bg: var(--vmhb-light-card-bg);
    --vmhb-current-shadow: var(--vmhb-light-shadow);
    --vmhb-current-overlay: rgba(0, 0, 0, var(--vmhb-overlay-opacity));
}

/* ============================================
   DARK MODE - CSS Custom Properties
   ============================================ */

html[data-vmhb-theme="dark"] {
    --vmhb-theme-mode: dark;
    --vmhb-current-text: var(--vmhb-dark-text);
    --vmhb-current-text-secondary: var(--vmhb-dark-text-secondary);
    --vmhb-current-text-muted: var(--vmhb-dark-text-muted);
    --vmhb-current-border: var(--vmhb-dark-border);
    --vmhb-current-card-bg: var(--vmhb-dark-card-bg);
    --vmhb-current-shadow: var(--vmhb-dark-shadow);
    --vmhb-current-overlay: rgba(0, 0, 0, var(--vmhb-overlay-opacity));
}

/* ============================================
   BASE STYLES - Theme-aware
   ============================================ */

body {
    color: var(--vmhb-current-text);
    background-attachment: var(--vmhb-bg-attachment);
    background-size: cover;
    background-position: center;
    transition: color 0.3s ease, background-color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--vmhb-current-text);
}

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

a:hover {
    opacity: 0.8;
}

.vmhb-card,
.vmhb-container {
    background: var(--vmhb-current-card-bg);
    color: var(--vmhb-current-text);
    border: 1px solid var(--vmhb-current-border);
    box-shadow: 0 4px 15px var(--vmhb-current-shadow);
}

.vmhb-text-secondary {
    color: var(--vmhb-current-text-secondary);
}

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

.vmhb-border {
    border-color: var(--vmhb-current-border);
}

/* ============================================
   OVERLAY SYSTEM FÜR SHORTCODES
   ============================================ */

.vmhb-hero-overlay,
.vmhb-hero-banner-overlay,
.vmhb-news-overlay,
.vmhb-slider-overlay,
.vmhb-teaser-overlay {
    background: var(--vmhb-current-overlay);
    transition: background 0.3s ease;
}

/* Gradient Overlays - passen sich an Overlay-Opacity an */

.vmhb-hero-banner-overlay-left,
.vmhb-hero-banner-overlay-right {
    background: linear-gradient(
        to right,
        var(--vmhb-accent-color) 0%,
        rgba(0, 0, 0, var(--vmhb-overlay-opacity)) 100%
    );
}

.vmhb-news-slider-overlay {
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, var(--vmhb-overlay-opacity)) 0%,
        rgba(0, 0, 0, calc(var(--vmhb-overlay-opacity) * 0.5)) 70%,
        rgba(0, 0, 0, 0) 100%
    );
}

/* ============================================
   BUTTONS & INPUTS - Theme-aware
   ============================================ */

.vmhb-btn,
button,
input[type="button"],
input[type="submit"] {
    background: var(--vmhb-accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.vmhb-btn:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    background: var(--vmhb-current-card-bg);
    color: var(--vmhb-current-text);
    border: 1px solid var(--vmhb-current-border);
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--vmhb-accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================
   TABLES - Theme-aware
   ============================================ */

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

thead {
    background: var(--vmhb-accent-color);
    color: white;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--vmhb-current-border);
}

tbody tr:hover {
    background: var(--vmhb-current-card-bg);
}

/* ============================================
   CODE BLOCKS - Theme-aware
   ============================================ */

code,
pre {
    background: var(--vmhb-current-card-bg);
    color: var(--vmhb-current-text);
    border: 1px solid var(--vmhb-current-border);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

pre {
    padding: 15px;
    overflow-x: auto;
}

/* ============================================
   SCROLLBAR - Theme-aware
   ============================================ */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--vmhb-current-card-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--vmhb-accent-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--vmhb-accent-color);
    opacity: 0.8;
}

/* ============================================
   TRANSITIONS & ANIMATIONS
   ============================================ */

.vmhb-theme-transition {
    transition: all 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    body {
        background: white;
        color: #000;
    }
    
    .vmhb-no-print {
        display: none;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .vmhb-card {
        padding: 15px;
    }
}
