/* Theme-System CSS-Variablen */
/* Diese Datei wird dynamisch durch PHP generiert basierend auf Benutzer-Theme-Einstellungen */

:root {
    /* Hauptfarben */
    --theme-primary: #cd661d;
    --theme-secondary: #a6c;
    --theme-success: #1ec1b0;
    --theme-warning: #fda600;
    --theme-danger: #ff737b;
    --theme-info: #5a9ee0;
    --theme-light: #fff;
    --theme-dark: #4a5779;
    
    /* Layout-spezifische Farben */
    --theme-sidebar-bg: #4a5779;
    --theme-navbar-bg: #fff;
    --theme-text-primary: #4a5779;
    --theme-text-secondary: #7286a2;
    --theme-border-color: rgba(0,0,0,0.1);
    --theme-background-color: #f8f9fa;
    
    /* Abgeleitete Farben für verschiedene Zustände */
    --theme-primary-hover: color-mix(in srgb, var(--theme-primary) 85%, black);
    --theme-primary-light: color-mix(in srgb, var(--theme-primary) 20%, white);
    --theme-primary-dark: color-mix(in srgb, var(--theme-primary) 80%, black);
    
    --theme-secondary-hover: color-mix(in srgb, var(--theme-secondary) 85%, black);
    --theme-secondary-light: color-mix(in srgb, var(--theme-secondary) 20%, white);
    
    --theme-success-hover: color-mix(in srgb, var(--theme-success) 85%, black);
    --theme-success-light: color-mix(in srgb, var(--theme-success) 20%, white);
    
    --theme-warning-hover: color-mix(in srgb, var(--theme-warning) 85%, black);
    --theme-warning-light: color-mix(in srgb, var(--theme-warning) 20%, white);
    
    --theme-danger-hover: color-mix(in srgb, var(--theme-danger) 85%, black);
    --theme-danger-light: color-mix(in srgb, var(--theme-danger) 20%, white);
    
    --theme-info-hover: color-mix(in srgb, var(--theme-info) 85%, black);
    --theme-info-light: color-mix(in srgb, var(--theme-info) 20%, white);
    
    /* Schatten und Transparenzen */
    --theme-shadow-primary: rgba(var(--theme-primary-rgb), 0.15);
    --theme-shadow-light: rgba(0, 0, 0, 0.05);
    --theme-shadow-medium: rgba(0, 0, 0, 0.1);
    --theme-shadow-dark: rgba(0, 0, 0, 0.2);
}

/* Fallback für ältere Browser ohne color-mix Unterstützung */
@supports not (color: color-mix(in srgb, red, blue)) {
    :root {
        --theme-primary-hover: #b85a19;
        --theme-primary-light: #f4e6d9;
        --theme-primary-dark: #a35516;
        
        --theme-secondary-hover: #9966bb;
        --theme-secondary-light: #f2e6ff;
        
        --theme-success-hover: #1aad9e;
        --theme-success-light: #d9f7f4;
        
        --theme-warning-hover: #e49500;
        --theme-warning-light: #fff4d9;
        
        --theme-danger-hover: #ff5a63;
        --theme-danger-light: #ffe6e7;
        
        --theme-info-hover: #4d8dca;
        --theme-info-light: #e6f2ff;
    }
}

/* Theme-Anwendung auf bestehende Klassen */
.btn-primary {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--theme-primary-hover) !important;
    border-color: var(--theme-primary-hover) !important;
}

.btn-secondary {
    background-color: var(--theme-secondary) !important;
    border-color: var(--theme-secondary) !important;
}

.btn-success {
    background-color: var(--theme-success) !important;
    border-color: var(--theme-success) !important;
}

.btn-warning {
    background-color: var(--theme-warning) !important;
    border-color: var(--theme-warning) !important;
}

.btn-danger {
    background-color: var(--theme-danger) !important;
    border-color: var(--theme-danger) !important;
}

.btn-info {
    background-color: var(--theme-info) !important;
    border-color: var(--theme-info) !important;
}

/* Text-Farben */
.text-primary {
    color: var(--theme-primary) !important;
}

.text-secondary {
    color: var(--theme-secondary) !important;
}

.text-success {
    color: var(--theme-success) !important;
}

.text-warning {
    color: var(--theme-warning) !important;
}

.text-danger {
    color: var(--theme-danger) !important;
}

.text-info {
    color: var(--theme-info) !important;
}

/* Hintergrund-Farben */
.bg-primary {
    background-color: var(--theme-primary) !important;
    color: white !important;
}

.bg-secondary {
    background-color: var(--theme-secondary) !important;
    color: white !important;
}

.bg-success {
    background-color: var(--theme-success) !important;
    color: white !important;
}

.bg-warning {
    background-color: var(--theme-warning) !important;
    color: white !important;
}

.bg-danger {
    background-color: var(--theme-danger) !important;
    color: white !important;
}

.bg-info {
    background-color: var(--theme-info) !important;
    color: white !important;
}

.bg-light {
    background-color: var(--theme-light) !important;
    color: var(--theme-text-primary) !important;
}

.bg-dark {
    background-color: var(--theme-dark) !important;
    color: white !important;
}

.bg-white {
    background-color: #fff !important;
    color: var(--theme-text-primary) !important;
}

/* Border-Farben */
.border-primary {
    border-color: var(--theme-primary) !important;
}

.border-secondary {
    border-color: var(--theme-secondary) !important;
}

.border-success {
    border-color: var(--theme-success) !important;
}

.border-warning {
    border-color: var(--theme-warning) !important;
}

.border-danger {
    border-color: var(--theme-danger) !important;
}

.border-info {
    border-color: var(--theme-info) !important;
}

/* Navigation Items */
.nav-item {
    color: var(--theme-text-primary) !important;
}

.nav-item .nav-link {
    color: var(--theme-text-primary) !important;
    background-color: transparent !important;
}

.nav-item .nav-link:hover {
    color: var(--theme-primary) !important;
    background-color: var(--theme-primary-light) !important;
}

.nav-item.active .nav-link,
.nav-item .nav-link.active {
    color: var(--theme-primary) !important;
    background-color: var(--theme-primary-light) !important;
    font-weight: 600 !important;
}

/* Sidebar Navigation Items */
.dsh-sidebar .nav-item .nav-link,
.sidebar .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

.dsh-sidebar .nav-item .nav-link:hover,
.sidebar .nav-item .nav-link:hover {
    color: white !important;
    background-color: var(--theme-primary-light) !important;
}

.dsh-sidebar .nav-item.active .nav-link,
.dsh-sidebar .nav-item .nav-link.active,
.sidebar .nav-item.active .nav-link,
.sidebar .nav-item .nav-link.active {
    color: white !important;
    background-color: var(--theme-primary) !important;
    font-weight: 600 !important;
}

/* Spezielle Anwendungen für Ihre bestehenden Klassen */
.jstree-default .jstree-clicked {
    background: var(--theme-success) !important;
}

.toast-success {
    background-color: var(--theme-success) !important;
}

.toast-warning {
    background-color: var(--theme-warning) !important;
}

.toast-info {
    background-color: var(--theme-info) !important;
}

.toast-error {
    background-color: var(--theme-danger) !important;
}

/* Navigation und Sidebar */
.dsh-sidebar,
.sidebar {
    background-color: var(--theme-sidebar-bg) !important;
}

.navbar,
.dsh-navbar {
    background-color: var(--theme-navbar-bg) !important;
}

.nav-pills .nav-link {
    color: var(--theme-text-primary) !important;
}

.nav-pills .nav-link:hover {
    background-color: var(--theme-primary-light) !important;
    color: var(--theme-primary) !important;
}

.nav-pills .nav-link.active {
    background-color: var(--theme-primary) !important;
    color: white !important;
}

.nav-pills .show > .nav-link {
    background-color: var(--theme-primary) !important;
    color: white !important;
}

.nav-tabs .nav-link {
    color: var(--theme-text-primary) !important;
    border-color: transparent !important;
}

.nav-tabs .nav-link:hover {
    border-color: var(--theme-border-color) !important;
    color: var(--theme-primary) !important;
}

.nav-tabs .nav-link.active {
    color: var(--theme-primary) !important;
    background-color: var(--theme-light) !important;
    border-color: var(--theme-border-color) var(--theme-border-color) var(--theme-light) !important;
}

/* Kalender-Events */
.fc-event {
    background-color: var(--theme-primary) !important;
    border: 1px solid var(--theme-primary) !important;
}

.fc-event.fc-event-primary {
    background-color: var(--theme-primary) !important;
    border: 1px solid var(--theme-primary) !important;
}

.fc-event.fc-event-secondary {
    background-color: var(--theme-secondary) !important;
    border: 1px solid var(--theme-secondary) !important;
}

.fc-event.fc-event-success {
    background-color: var(--theme-success) !important;
    border: 1px solid var(--theme-success) !important;
}

.fc-event.fc-event-warning {
    background-color: var(--theme-warning) !important;
    border: 1px solid var(--theme-warning) !important;
}

.fc-event.fc-event-danger {
    background-color: var(--theme-danger) !important;
    border: 1px solid var(--theme-danger) !important;
}

.fc-event.fc-event-info {
    background-color: var(--theme-info) !important;
    border: 1px solid var(--theme-info) !important;
}

/* Tooltips */
.tooltip-inner {
    background-color: var(--theme-dark) !important;
}

.tooltip-primary .tooltip-inner {
    background-color: var(--theme-primary) !important;
}

.tooltip-secondary .tooltip-inner {
    background-color: var(--theme-secondary) !important;
}

.tooltip-warning .tooltip-inner {
    background-color: var(--theme-warning) !important;
}

.tooltip-success .tooltip-inner {
    background-color: var(--theme-success) !important;
}

.tooltip-danger .tooltip-inner {
    background-color: var(--theme-danger) !important;
}

.tooltip-info .tooltip-inner {
    background-color: var(--theme-info) !important;
}

/* Allgemeine Text- und Hintergrundfarben */
body {
    background-color: var(--theme-background-color) !important;
    color: var(--theme-text-primary) !important;
}

/* Dropdowns */
.dropdown-menu {
    background-color: var(--theme-light) !important;
    border-color: var(--theme-border-color) !important;
    color: var(--theme-text-primary) !important;
}

.dropdown-item {
    color: var(--theme-text-primary) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--theme-primary) !important;
    color: white !important;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--theme-primary) !important;
    color: white !important;
}

.dropdown-divider {
    border-top-color: var(--theme-border-color) !important;
}

.dropdown-header {
    color: var(--theme-text-secondary) !important;
    background-color: var(--theme-primary-light) !important;
    font-weight: 600 !important;
}

/* User Dropdown */
.user-dropdown {
    background-color: var(--theme-light) !important;
    border-color: var(--theme-border-color) !important;
}

.user-dropdown .dropdown-item {
    color: var(--theme-text-primary) !important;
}

.user-dropdown .dropdown-item:hover {
    background-color: var(--theme-primary) !important;
    color: white !important;
}

/* Links */
a {
    color: var(--theme-primary) !important;
}

a:hover {
    color: var(--theme-primary-hover) !important;
}

/* Form-Elemente */
.form-control:focus {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 0.2rem var(--theme-primary-light) !important;
}

/* Cards */
.card {
    border-color: var(--theme-border-color) !important;
    background-color: var(--theme-light) !important;
}

.card-header {
    background-color: var(--theme-primary-light) !important;
    border-bottom-color: var(--theme-border-color) !important;
    color: var(--theme-text-primary) !important;
}

.card-body {
    background-color: var(--theme-light) !important;
    color: var(--theme-text-primary) !important;
}

.card-footer {
    background-color: var(--theme-primary-light) !important;
    border-top-color: var(--theme-border-color) !important;
    color: var(--theme-text-secondary) !important;
}

/* Modals */
.modal-content {
    background-color: var(--theme-light) !important;
    border-color: var(--theme-border-color) !important;
    color: var(--theme-text-primary) !important;
}

.modal-header {
    background-color: var(--theme-primary-light) !important;
    border-bottom-color: var(--theme-border-color) !important;
    color: var(--theme-text-primary) !important;
}

.modal-title {
    color: var(--theme-text-primary) !important;
}

.modal-body {
    background-color: var(--theme-light) !important;
    color: var(--theme-text-primary) !important;
}

.modal-footer {
    background-color: var(--theme-primary-light) !important;
    border-top-color: var(--theme-border-color) !important;
}

.modal-backdrop {
    background-color: rgba(74, 87, 121, 0.5) !important;
}

.close {
    color: var(--theme-text-primary) !important;
    opacity: 0.7;
}

.close:hover {
    color: var(--theme-text-primary) !important;
    opacity: 1;
}

/* Text-Farben für verschiedene Elemente */
h1, h2, h3, h4, h5, h6 {
    color: var(--theme-text-primary) !important;
}

p, span, div, label {
    color: var(--theme-text-primary);
}

.text-muted {
    color: var(--theme-text-secondary) !important;
}

/* Tables */
.table {
    color: var(--theme-text-primary) !important;
}

.table thead th {
    color: var(--theme-text-primary) !important;
    border-bottom-color: var(--theme-border-color) !important;
}

.table td, .table th {
    border-top-color: var(--theme-border-color) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--theme-primary-light) !important;
}

.table-hover tbody tr:hover {
    background-color: var(--theme-primary-light) !important;
}

/* List Groups */
.list-group-item {
    background-color: var(--theme-light) !important;
    border-color: var(--theme-border-color) !important;
    color: var(--theme-text-primary) !important;
}

.list-group-item:hover,
.list-group-item:focus {
    background-color: var(--theme-primary-light) !important;
    color: var(--theme-text-primary) !important;
}

.list-group-item.active {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-light) !important;
}

.list-group-item-primary {
    background-color: var(--theme-primary-light) !important;
    color: var(--theme-primary) !important;
}

.list-group-item-secondary {
    background-color: var(--theme-secondary-light) !important;
    color: var(--theme-secondary) !important;
}

.list-group-item-success {
    background-color: var(--theme-success-light) !important;
    color: var(--theme-success) !important;
}

.list-group-item-warning {
    background-color: var(--theme-warning-light) !important;
    color: var(--theme-warning) !important;
}

.list-group-item-danger {
    background-color: var(--theme-danger-light) !important;
    color: var(--theme-danger) !important;
}

.list-group-item-info {
    background-color: var(--theme-info-light) !important;
    color: var(--theme-info) !important;
}

/* Media Objects */
.media {
    color: var(--theme-text-primary) !important;
    background-color: transparent !important;
}

.media.bg-light {
    background-color: var(--theme-light) !important;
    color: var(--theme-text-primary) !important;
}

.media-body {
    color: var(--theme-text-primary) !important;
}

.media-body h1,
.media-body h2,
.media-body h3,
.media-body h4,
.media-body h5,
.media-body h6 {
    color: var(--theme-text-primary) !important;
}

.media-heading {
    color: var(--theme-text-primary) !important;
    font-weight: 600 !important;
}

/* Alerts */
.alert-primary {
    background-color: var(--theme-primary-light) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-primary-dark) !important;
}

.alert-secondary {
    background-color: var(--theme-secondary-light) !important;
    border-color: var(--theme-secondary) !important;
}

.alert-success {
    background-color: var(--theme-success-light) !important;
    border-color: var(--theme-success) !important;
}

.alert-warning {
    background-color: var(--theme-warning-light) !important;
    border-color: var(--theme-warning) !important;
}

.alert-danger {
    background-color: var(--theme-danger-light) !important;
    border-color: var(--theme-danger) !important;
}

.alert-info {
    background-color: var(--theme-info-light) !important;
    border-color: var(--theme-info) !important;
}
