:root {
    /* Farbvariablen */
    --primary-color: #2271b1;
    --primary-dark: #135e96;
    --primary-light: #e3f2fd;
    --primary-border: #bbdefb;
    --background-color: #fff;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --light-bg: #f8f9fa;
    --light-hover: #e9ecef;
    --success-color: #00a32a;
    --error-color: #d63638;
    --warning-color: #dba617;
    
    /* Effekt-Variablen */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --border-radius-sm: 4px;
}

/* Modal Overlay */
.diwidu-event-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.diwidu-event-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.diwidu-event-modal {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    width: 100%;
}

/* Responsive Breiten */
@media (min-width: 769px) {
    .diwidu-event-modal {
        width: 80%;
        max-width: 1200px;
    }
}

@media (max-width: 768px) {
    .diwidu-event-modal {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* Modal Header */
.diwidu-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
}

.diwidu-modal-title {
    margin: 0;
    font-size: 1.5em;
    color: #2271b1;
}

.diwidu-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diwidu-modal-close:hover {
    color: #495057;
}

/* Modal Content */
.diwidu-modal-content {
    padding: 20px;
}

/* Modal-spezifische Grid-Regeln */
.diwidu-event-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.diwidu-event-left-column {
    grid-column: 1;
}

.diwidu-event-right-column {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.diwidu-event-full-width {
    grid-column: 1 / -1;
    margin-top: 0;
}

/* Modal-spezifische Datums- und Kategorie-Styles */
.diwidu-event-date-time {
    font-size: 1.5em;
    font-weight: 600;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;

}

.diwidu-event-categories,
.diwidu-event-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.diwidu-event-categories .diwidu-meta-label,
.diwidu-event-tags .diwidu-meta-label {
    margin-right: 10px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.diwidu-event-categories a,
.diwidu-event-tags a {
    padding: 8px 15px;
    background: #e9ecef;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95em;
}

.diwidu-event-categories a:hover,
.diwidu-event-tags a:hover {
    background: #dee2e6;
    color: #000;
}

.diwidu-custom-links {
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.diwidu-custom-links .diwidu-meta-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.diwidu-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.diwidu-link {
    display: inline-block;
    padding: 8px 15px;
    background: #e9ecef;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95em;
}

.diwidu-link:hover {
    background: #dee2e6;
    color: #000;
}

/* Toggle Box Styles - ANGEPASST FÜR KOMPATIBILITÄT */
.diwidu-modal-content .diwidu-toggle-box {
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.diwidu-modal-content .diwidu-toggle-header {
    cursor: pointer;
    padding: 12px 15px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em; /* Schriftgröße angepasst an andere Felder */
    font-weight: 600;
}

/* +/- Zeichen links positioniert */
.diwidu-modal-content .diwidu-toggle-icon {
    order: -1; /* Zeichen nach links verschieben */
    font-size: 1.2em;
    width: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.diwidu-modal-content .diwidu-toggle-header h4 {
    margin: 0;
    font-size: 1.0em; /* Schriftgröße angepasst */
    font-weight: 600;
    flex-grow: 1;
}

.diwidu-modal-content .diwidu-toggle-content {
    padding: 15px;
    background: #fff;
    display: none;
}

.diwidu-modal-content .diwidu-toggle-box.active .diwidu-toggle-content {
    display: block;
}

.diwidu-modal-content .diwidu-toggle-box.active .diwidu-toggle-icon {
    transform: rotate(45deg); /* Aus Plus wird Minus */
}

/* Verhindert Klick-Weiterleitung vom Toggle-Header zum Modal */
.diwidu-modal-content .diwidu-toggle-header * {
    pointer-events: none;
}

/* Loading State */
.diwidu-modal-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.diwidu-modal-loading .spinner {
    float: none;
    margin: 0;
}

/* Responsive Design für Modal */
@media (max-width: 768px) {
    .diwidu-event-grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .diwidu-event-left-column,
    .diwidu-event-right-column {
        grid-column: 1;
    }
    
    .diwidu-event-date-time {
        font-size: 1.3em;
        padding: 15px;
    }
}

/* Recurring Events Box Styles für Modal */
.diwidu-recurring-events-box {
    padding: 1.5rem;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.diwidu-recurring-events-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;	
}

.diwidu-recurring-events-list,
.diwidu-all-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.diwidu-recurring-event-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.diwidu-recurring-event-item:last-child {
    border-bottom: none;
}

.diwidu-recurring-event-item .event-date {
    font-weight: bold;
    text-decoration: none;
    color: #0073aa;
}

.diwidu-recurring-event-item .event-date:hover {
    color: #005177;
}

.diwidu-recurring-event-item.current-event .event-date {
    color: #333;
    cursor: default;
}

.diwidu-recurring-event-item .event-status {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

.diwidu-show-all-events {
    margin-top: 1rem;
}

.diwidu-show-all-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 0.9em;
}

.diwidu-show-all-link:hover {
    color: #005177;
    text-decoration: underline;
}

.diwidu-all-events-container {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* Beitragsbild Styles für Modal */
.diwidu-event-featured-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.diwidu-event-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.diwidu-event-featured-image:hover img {
    transform: scale(1.02);
}

/* Custom Buttons für Modal */
.diwidu-custom-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.diwidu-custom-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--wp--preset--color--primary, #2271b1);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.diwidu-custom-button:hover {
    background: var(--wp--preset--color--primary-darker, #135e96);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Zusätzliche Modal-spezifische Responsive-Regeln */
@media (max-width: 768px) {
    .diwidu-custom-buttons {
        flex-direction: column;
    }
    
    .diwidu-custom-button {
        width: 100%;
    }
}


/* Kategorien und Tags mit Komma-Trennung */
.diwidu-event-categories .diwidu-meta-value,
.diwidu-event-tags .diwidu-meta-value {
    color: var(--text-light);
    font-size: 0.95em;
    line-height: 1.5;
}

.diwidu-event-categories .diwidu-meta-label,
.diwidu-event-tags .diwidu-meta-label {
    font-weight: 600;
    color: var(--text-color);
    margin-right: 8px;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .diwidu-event-categories,
    .diwidu-event-tags {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
    }
    
    .diwidu-event-categories .diwidu-meta-label,
    .diwidu-event-tags .diwidu-meta-label {
        margin-right: 6px;
        flex-shrink: 0;
    }
    
    .diwidu-event-categories .diwidu-meta-value,
    .diwidu-event-tags .diwidu-meta-value {
        flex: 1;
        min-width: 0;
    }
}