/* WP Event Collections - Styles */

/* Frontend & Admin */
.wpec-box{background:#fff;border:1px solid #e5e7eb;padding:16px;margin:12px 0;border-radius:8px;}
.wpec-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.wpec-admin-layout{display:flex;flex-direction:column;gap:16px;}
.wpec-admin-layout .wpec-col{width:100%;}
.wpec-col{min-width:0;}
@media(max-width:960px){.wpec-grid{grid-template-columns:1fr;}}
.wpec-badge{padding:2px 8px;border-radius:12px;font-size:12px;}
.wpec-badge.ok{background:#E8F7EE;color:#1B6B3A;}
.wpec-badge.warn{background:#FFF4E5;color:#8A5400;}

/* Statistics Dashboard */
.wpec-stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:16px;margin:20px 0;}
.wpec-stat-box{background:#fff;border:2px solid #e5e7eb;border-radius:8px;padding:20px;text-align:center;transition:all 0.3s;}
.wpec-stat-box:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,0.1);}
.wpec-stat-box.active{border-color:#00a32a;}
.wpec-stat-box.inactive{border-color:#dba617;}
.wpec-stat-box.upcoming{border-color:#0073aa;}
.wpec-stat-box.today{border-color:#d63638;}
.wpec-stat-number{font-size:32px;font-weight:700;line-height:1;margin-bottom:8px;color:#1d2327;}
.wpec-stat-label{font-size:14px;color:#646970;text-transform:uppercase;letter-spacing:0.5px;}

/* Collection Title */
.wpec-collection-title{margin:0 0 20px 0;font-size:1.75rem;font-weight:700;color:#1d2327;line-height:1.3;}

/* Toolbar - Improved Layout */
.wpec-toolbar{
    display:flex;
    flex-direction:column;
    gap:16px;
    margin-bottom:20px;
    padding:20px;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
}

/* Toolbar Top Row: View Switcher + Actions */
.wpec-toolbar-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    flex-wrap:wrap;
    padding-bottom:16px;
    border-bottom:1px solid #e5e7eb;
}

/* Toolbar Bottom Row: Filters */
.wpec-toolbar-bottom{
    display:flex;
    gap:16px;
    flex-wrap:wrap;
    align-items:flex-end;
}

/* ========================================
   View Switcher (Ansichts-Umschalter)
   ======================================== */

/* View Button Group Container */
.wpec-view-switcher {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* View Button Base Styles */
.wpec-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    cursor: pointer;
    background: #fff;
    border: none; /* kein Rand mehr pro Button */
    border-right: 1px solid #e5e7eb; /* Trennlinie zwischen Buttons */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 600;
    color: #646970;
    font-family: inherit;
    min-width: 100px;
}

.wpec-view-btn:last-child {
    /* border-right: none; /* Letzter trennt sich visuell, weil Container Rahmen hat */
}

/* Hover State */
.wpec-view-btn:hover {
    background: #f0f8ff;
    color: #0073aa;
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px #cce5f6;
}

/* Active State */
.wpec-view-btn.active {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
    z-index: 2;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.wpec-view-btn.active:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a6f 100%);
    transform: translateY(-1px);
}

/* Icon Styles */
.wpec-view-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.wpec-view-btn:hover .wpec-view-icon {
    transform: scale(1.1);
}

.wpec-view-btn.active .wpec-view-icon {
    transform: scale(1.15);
    filter: brightness(1.2);
}

/* Label Styles */
.wpec-view-label{
    white-space:nowrap;
    font-weight:600;
    letter-spacing:0.3px;
}

/* Responsive Design */
@media(max-width:768px){
    .wpec-view-label{
        display:none;
    }
    
    .wpec-view-btn{
        padding:12px 16px;
        min-width:70px;
    }
    
    .wpec-view-icon{
        font-size:20px;
    }
    
    .wpec-toolbar-top{
        flex-direction:column;
        align-items:stretch;
    }
    
    .wpec-toolbar-actions{
        width:100%;
        justify-content:space-between;
    }
    
    .wpec-filter-form{
        grid-template-columns:1fr;
    }
}

/* Modern Dropdown Styles (Elementor-like) */
.wpec-filter-form{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:16px;
    width:100%;
}
.wpec-filter-form label{
    display:flex;
    flex-direction:column;
    gap:8px;
    font-size:13px;
    font-weight:600;
    color:#1d2327;
}
.wpec-filter-form select.wpec-filter-select{
    width:100%;
    min-width:180px;
    padding:12px 40px 12px 14px;
    border:1px solid #d1d5db;
    border-radius:8px;
    background-color:#fff;
    font-size:14px;
    color:#1d2327;
    appearance:none;
    background-image:url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23646970' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 14px center;
    cursor:pointer;
    transition:all 0.2s ease;
    box-shadow:0 1px 2px rgba(0,0,0,0.05);
}
.wpec-filter-form select.wpec-filter-select:hover{
    border-color:#9ca3af;
    box-shadow:0 2px 4px rgba(0,0,0,0.1);
}
.wpec-filter-form select.wpec-filter-select:focus{
    outline:none;
    border-color:#0073aa;
    box-shadow:0 0 0 3px rgba(0,115,170,0.1);
}
.wpec-filter-form select.wpec-filter-select option{
    padding:8px;
    background-color:#fff;
    color:#1d2327;
}

/* Toggle Switch Styles */
.wpec-toggle{
    position:relative;
    display:inline-flex;
    align-items:center;
    gap:10px;
    cursor:pointer;
    user-select:none;
    font-size:14px;
    font-weight:500;
    color:#1d2327;
    white-space:nowrap;
}
.wpec-desc-toggle{
    position:absolute;
    opacity:0;
    width:0;
    height:0;
    pointer-events:none;
}
.wpec-toggle::before{
    content:'';
    display:inline-block;
    width:40px;
    height:22px;
    background-color:#d1d5db;
    border-radius:11px;
    transition:all 0.3s ease;
    box-shadow:inset 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink:0;
    position:relative;
}
.wpec-toggle::after{
    content:'';
    position:absolute;
    left:0;
    top:50%;
    transform:translateY(-50%);
    width:18px;
    height:18px;
    background-color:#fff;
    border-radius:50%;
    transition:all 0.3s ease;
    box-shadow:0 2px 4px rgba(0,0,0,0.2);
    margin-left:2px;
}
.wpec-toggle.has-checked::before,
.wpec-toggle:has(.wpec-desc-toggle:checked)::before{
    background-color:#0073aa;
}
.wpec-toggle.has-checked::after,
.wpec-toggle:has(.wpec-desc-toggle:checked)::after{
    transform:translateY(-50%) translateX(18px);
}
.wpec-desc-toggle:focus + .wpec-toggle::before,
.wpec-toggle:has(.wpec-desc-toggle:focus)::before{
    box-shadow:0 0 0 3px rgba(0,115,170,0.2),inset 0 2px 4px rgba(0,0,0,0.1);
}
.wpec-toggle span{
    font-size:14px;
    font-weight:500;
    color:inherit;
}

/* Toolbar Actions */
.wpec-toolbar-actions{
    display:flex;
    gap:12px;
    align-items:center;
    flex-wrap:wrap;
}

/* iCal Button Styling */
.wpec-ical-btn{
    padding:10px 20px;
    background-color:#0073aa;
    color:#fff;
    text-decoration:none;
    border-radius:6px;
    font-size:14px;
    font-weight:500;
    transition:all 0.2s ease;
    border:none;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    box-shadow:0 2px 4px rgba(0,115,170,0.2);
}
.wpec-ical-btn:hover{
    background-color:#005a87;
    color:#fff;
    box-shadow:0 4px 8px rgba(0,115,170,0.3);
    transform:translateY(-1px);
}
.wpec-ical-btn:active{
    transform:translateY(0);
    box-shadow:0 2px 4px rgba(0,115,170,0.2);
}

/* List View */
.wpec-list .wpec-item{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid #eee;transition:background 0.2s;}
.wpec-list .wpec-item:hover{background:#f9f9f9;}
.wpec-item-today{border-left:4px solid #0073aa;padding-left:8px;}
.wpec-item-date{min-width:160px;font-weight:600;color:#646970;}
.wpec-item-title{font-size:1.05rem;font-weight:600;margin-bottom:4px;}
.wpec-item-location{color:#555;margin-top:4px;display:flex;align-items:center;gap:4px;}
.wpec-month{margin:18px 0 6px;font-weight:700;font-size:1.1rem;color:#1d2327;}

/* Cards View */
.wpec-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px;}
.wpec-card{border:1px solid #eee;border-radius:10px;padding:14px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.04);transition:all 0.3s;position:relative;}
.wpec-card:hover{box-shadow:0 4px 12px rgba(0,0,0,.1);transform:translateY(-2px);}
.wpec-card-today{border:2px solid #0073aa;background:#f0f8ff;}
.wpec-card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;color:#666;}
.wpec-card-title{margin:8px 0 4px;font-size:1.1rem;color:#1d2327;}
.wpec-card-location{color:#555;margin-top:6px;display:flex;align-items:center;gap:4px;}

/* Calendar View */
.wpec-calendar{border:1px solid #eee;border-radius:10px;padding:10px;background:#fff;margin-bottom:20px;}
.wpec-cal-nav{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px;padding:10px;background:#f9f9f9;border-radius:8px;}
.wpec-cal-nav-btn{padding:8px 16px;background:#0073aa;color:#fff;text-decoration:none;border-radius:4px;transition:background 0.2s;}
.wpec-cal-nav-btn:hover{background:#005a87;color:#fff;}
.wpec-cal-head{font-weight:700;font-size:1.2rem;color:#1d2327;}
.wpec-cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;}
.wpec-cal-cell{border:1px solid #f0f0f0;min-height:90px;border-radius:8px;padding:6px;background:#fafafa;transition:background 0.2s;}
.wpec-cal-cell:hover{background:#f0f0f0;}
.wpec-cal-today{background:#e3f2fd!important;border:2px solid #0073aa!important;}
.wpec-cal-dow{background:#f7f7f7;font-weight:600;min-height:auto;text-align:center;padding:8px;}
.wpec-cal-empty{background:transparent;border:none;min-height:0;}
.wpec-cal-date{font-size:.9rem;font-weight:700;margin-bottom:4px;color:#1d2327;}
.wpec-cal-list{margin:0;padding-left:18px;font-size:0.85rem;}
.wpec-cal-event{cursor:pointer;padding:2px 0;transition:color 0.2s;}
.wpec-cal-event:hover{color:#0073aa;}

/* Badges */
.wpec-badge-multi{display:inline-block;background:#eef3ff;border:1px solid #d5defa;border-radius:10px;padding:0 6px;margin-right:6px;font-size:.72rem;line-height:1.6em;text-transform:uppercase;color:#1e3a8a;}

/* Modal */
.wpec-modal{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:20px;}
.wpec-modal-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.7);}
.wpec-modal-content{position:relative;background:#fff;border-radius:12px;padding:30px;max-width:600px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:0 10px 40px rgba(0,0,0,0.3);}
.wpec-modal-close{position:absolute;top:15px;right:15px;background:none;border:none;font-size:32px;cursor:pointer;color:#646970;line-height:1;width:32px;height:32px;display:flex;align-items:center;justify-content:center;}
.wpec-modal-close:hover{color:#1d2327;}
.wpec-modal-title{font-size:1.5rem;font-weight:700;margin-bottom:12px;color:#1d2327;}
.wpec-modal-date{font-weight:600;color:#0073aa;margin-bottom:12px;}
.wpec-modal-icon{margin-bottom:12px;font-size:1.2rem;}
.wpec-modal-description{margin-bottom:16px;line-height:1.6;color:#646970;}
.wpec-modal-location{color:#555;font-weight:500;}

/* Footnotes */
.wpec-footnotes{margin-top:30px;padding:20px;background:#f9f9f9;border-radius:8px;border-left:4px solid #0073aa;}
.wpec-footnotes-title{font-weight:700;margin-bottom:12px;color:#1d2327;}
.wpec-footnotes ul{margin:0;padding-left:20px;}
.wpec-footnotes li{margin-bottom:8px;line-height:1.6;}

/* Admin */
.wpec-row-inactive{color:#777;background:#fafafa;}
.wpec-row-inactive td{opacity:.75;}
.wpec-editable{cursor:pointer;position:relative;padding:4px 8px;border-radius:4px;transition:background 0.2s;}
.wpec-editable:hover{background:#f0f8ff;}
.wpec-editable input{width:100%;padding:4px;border:1px solid #0073aa;border-radius:4px;}
.wpec-actions{display:flex;gap:4px;flex-wrap:wrap;}
.wpec-pagination{display:flex;gap:8px;align-items:center;margin-top:20px;padding:15px;background:#f9f9f9;border-radius:8px;}
.hidden{display:none;}

/* Responsive */
@media(max-width:768px){
    .wpec-stats-grid{grid-template-columns:repeat(2,1fr);}
    .wpec-cards{grid-template-columns:1fr;}
    .wpec-cal-grid{grid-template-columns:repeat(7,1fr);gap:2px;}
    .wpec-cal-cell{min-height:60px;padding:4px;font-size:0.8rem;}
    .wpec-cal-list{font-size:0.7rem;padding-left:12px;}
    .wpec-toolbar{flex-direction:column;align-items:stretch;}
    .wpec-item-date{min-width:120px;font-size:0.9rem;}
    .wpec-modal-content{padding:20px;margin:10px;}
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .wpec-box{background:#1a1a1a;border-color:#333;color:#e0e0e0;}
    .wpec-card{background:#1a1a1a;border-color:#333;color:#e0e0e0;}
    .wpec-card:hover{box-shadow:0 4px 12px rgba(255,255,255,0.1);}
    .wpec-calendar{background:#1a1a1a;border-color:#333;color:#e0e0e0;}
    .wpec-cal-cell{background:#222;border-color:#333;color:#e0e0e0;}
    .wpec-cal-dow{background:#2a2a2a;color:#e0e0e0;}
    .wpec-cal-today{background:#1a3a5c!important;border-color:#0073aa!important;}
    .wpec-list .wpec-item{border-color:#333;}
    .wpec-list .wpec-item:hover{background:#222;}
    .wpec-item-today{border-left-color:#0073aa;}
    .wpec-stat-box{background:#1a1a1a;border-color:#333;color:#e0e0e0;}
    .wpec-stat-number{color:#fff;}
    .wpec-stat-label{color:#aaa;}
    .wpec-modal-content{background:#1a1a1a;color:#e0e0e0;}
    .wpec-modal-title{color:#fff;}
    .wpec-footnotes{background:#222;color:#e0e0e0;}
    .wpec-toolbar{background:#1a1a1a;border-color:#333;}
    .wpec-filter-form label{color:#e0e0e0;}
    .wpec-filter-form select.wpec-filter-select{
        background-color:#222;
        color:#e0e0e0;
        border-color:#444;
        background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e0e0e0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    }
    .wpec-filter-form select.wpec-filter-select:hover{
        border-color:#555;
    }
    .wpec-filter-form select.wpec-filter-select:focus{
        border-color:#0073aa;
    }
    .wpec-toggle{color:#e0e0e0;}
    .wpec-toggle::before{background-color:#444;}
    .wpec-toggle.has-checked::before{background-color:#0073aa;}
    .wpec-ical-btn{background-color:#0073aa;}
    .wpec-ical-btn:hover{background-color:#005a87;}
    .wpec-collection-title{color:#fff;}
    .wpec-view-switcher{border-color:#444;background:#2a2a2a;box-shadow:0 2px 4px rgba(0,0,0,0.3);}
    .wpec-view-btn{border-right-color:#444;color:#aaa;background:#2a2a2a;}
    .wpec-view-btn:hover{background:#333;color:#fff;box-shadow:0 2px 4px rgba(0,115,170,0.2);}
    .wpec-view-btn.active{background:linear-gradient(135deg, #0073aa 0%, #005a87 100%);color:#fff;box-shadow:0 4px 8px rgba(0,115,170,0.5);}
    .wpec-view-btn.active:hover{background:linear-gradient(135deg, #005a87 0%, #004a6f 100%);box-shadow:0 6px 12px rgba(0,115,170,0.6);}
}

/* Loading States */
.wpec-loading{opacity:0.6;pointer-events:none;position:relative;}
.wpec-loading::after{content:'';position:absolute;top:50%;left:50%;width:20px;height:20px;margin:-10px 0 0 -10px;border:2px solid #0073aa;border-top-color:transparent;border-radius:50%;animation:wpec-spin 0.6s linear infinite;}
@keyframes wpec-spin{to{transform:rotate(360deg);}}

/* Animations */
.wpec-fade-in{animation:wpec-fadeIn 0.3s ease-in;}
@keyframes wpec-fadeIn{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);}}

/* Icons */
.wpec-icon{display:inline-block;margin-right:4px;}
