/* ==========================================
   LÜCKENANSICHT PANEL - Styles
   Version 2.0 mit Aufklapp-Modal & Scroll
   ========================================== */

.lueckenansicht-panel {
    position: fixed;
    top: 60px;
    right: 0;
    bottom: 0;
    width: 40px;
    background: white;
    border-left: 1px solid #e2e8f0;
    box-shadow: -4px 0 15px rgba(0,0,0,0.05);
    z-index: 100;
    transition: width 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.lueckenansicht-panel.expanded {
    width: var(--panel-width, 320px);
    box-shadow: -4px 0 25px rgba(0,0,0,0.15);
}

.lueckenansicht-panel.pinned.expanded {
    width: var(--panel-width, 320px);
}

.lueckenansicht-panel.resizing {
    transition: none;
    user-select: none;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 10px;
    cursor: ew-resize;
    background: linear-gradient(90deg, #e2e8f0 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.resize-handle:hover {
    opacity: 1;
    background: linear-gradient(90deg, #3b82f6 0%, transparent 100%);
}

.resize-grip {
    color: #64748b;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: -2px;
}

/* Mini-Ansicht */
.panel-mini {
    width: 40px;
    min-width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 5px;
    gap: 8px;
    cursor: pointer;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 3px solid #3b82f6;
}

.lueckenansicht-panel.expanded .panel-mini {
    display: none;
}

.panel-mini .mini-icon {
    font-size: 20px;
}

.panel-mini .mini-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 11px;
    font-weight: 600;
    color: #3b82f6;
    letter-spacing: 1px;
}

.panel-mini:hover {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
}

/* Panel Content */
.panel-content {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.lueckenansicht-panel.expanded .panel-content {
    display: flex;
}

/* Header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    flex-shrink: 0;
}

.panel-title {
    font-weight: 600;
    font-size: 13px;
}

.panel-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 12px;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.3);
}

.btn-icon .pinned {
    filter: drop-shadow(0 0 3px gold);
}

.btn-icon .spin {
    animation: spin 1s linear infinite;
}

.btn-icon .pulse-glow {
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.btn-icon.has-changes {
    background: rgba(251, 191, 36, 0.4);
    animation: attention-pulse 2s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 2px #fbbf24);
    }
    50% { 
        transform: scale(1.3);
        filter: drop-shadow(0 0 8px #f59e0b) drop-shadow(0 0 15px #fbbf24);
    }
}

@keyframes attention-pulse {
    0%, 100% { 
        background: rgba(251, 191, 36, 0.3);
    }
    50% { 
        background: rgba(251, 191, 36, 0.6);
    }
}

/* Zeitraum Controls */
.zeitraum-controls {
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.zeitraum-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-nav {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
}

.btn-nav:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

.btn-nav.btn-heute {
    color: #3b82f6;
}

.zeitraum-label {
    flex: 1;
    text-align: center;
    font-weight: 500;
    font-size: 12px;
    color: #1f2937;
}

.zeitraum-select select {
    font-size: 11px;
    padding: 3px 6px;
}

/* Spalten Filter */
.spalten-filter {
    padding: 6px 12px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.spalten-filter select {
    font-size: 11px;
    width: 100%;
}

/* Legende */
.legende {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.legende-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #64748b;
}

.legende .dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legende .dot.frei { background: #22c55e; }
.legende .dot.teilweise { background: #f59e0b; }
.legende .dot.belegt { background: #ef4444; }

.legende-hinweis {
    font-size: 9px;
    color: #94a3b8;
    width: 100%;
    text-align: center;
}

/* Loading */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 10px;
    color: #64748b;
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Heatmap Container mit Scroll */
.heatmap-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.heatmap-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    padding: 8px;
}

/* Scrollbar Styling */
.heatmap-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.heatmap-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.heatmap-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.heatmap-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.spalte-row {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    min-width: fit-content;
}

.spalte-label {
    width: 65px;
    min-width: 65px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 6px;
    flex-shrink: 0;
}

.spalte-farbe {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.spalte-name {
    font-size: 10px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tage-grid {
    display: flex;
    gap: 1px;
    flex-shrink: 0;
}

.tag-cell {
    width: 18px;
    min-width: 18px;
    height: 18px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.tag-cell .tag-datum {
    font-size: 7px;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}

/* Status-Farben */
.tag-cell.frei { background: #22c55e; }
.tag-cell.wenig { background: #86efac; }
.tag-cell.teilweise { background: #fbbf24; }
.tag-cell.teilweise-voll { background: #f97316; }
.tag-cell.belegt { background: #ef4444; }
.tag-cell.geschlossen { background: #e2e8f0; cursor: default; }
.tag-cell.feiertag { background: #c7d2fe; cursor: default; }

.tag-cell:not(.geschlossen):not(.feiertag):not(.belegt):hover {
    transform: scale(1.4);
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.tag-cell.heute {
    outline: 2px solid #1e40af;
    outline-offset: -1px;
}

.tag-cell.wochenende {
    opacity: 0.4;
}

/* Wochen Header */
.wochen-header {
    display: flex;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
    min-width: fit-content;
}

.wochen-header .spalte-label {
    visibility: hidden;
}

.tag-header {
    width: 18px;
    min-width: 18px;
    height: 14px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.tag-header.wochenstart {
    border-left: 1px solid #cbd5e1;
}

.kw-label {
    font-size: 8px;
    color: #64748b;
    white-space: nowrap;
    padding-left: 2px;
}

/* Info Bereich */
.info-bereich {
    padding: 6px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    flex-shrink: 0;
}

.info-bereich small {
    color: #64748b;
    font-size: 10px;
}

/* ==========================================
   TAG-DETAIL MODAL (Aufklapp-Ansicht)
   Schließt nur mit X-Button!
   ========================================== */

.tag-detail-modal {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1000;
    min-width: 280px;
    max-width: 350px;
    max-height: 450px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.tag-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.tag-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-detail-spalte {
    font-size: 10px;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-close-mini {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-mini:hover {
    background: rgba(255,255,255,0.3);
}

.tag-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.tag-detail-footer {
    padding: 6px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.tag-detail-footer small {
    color: #64748b;
    font-size: 10px;
}

.slot-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 3px;
    border: 1px solid transparent;
}

.slot-row:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.slot-row.frei {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.slot-row.frei:hover {
    background: #dcfce7;
    border-color: #86efac;
}

.slot-row.belegt {
    background: #fefce8;
    border-color: #fef08a;
}

.slot-row.belegt:hover {
    background: #fef9c3;
    border-color: #fde047;
}

.slot-zeit {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    width: 42px;
    flex-shrink: 0;
}

.slot-dauer {
    font-size: 9px;
    color: #64748b;
    width: 28px;
    flex-shrink: 0;
}

.slot-bar {
    width: 6px;
    height: 24px;
    border-radius: 3px;
    flex-shrink: 0;
}

.slot-info {
    flex: 1;
    font-size: 11px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-row.frei .slot-info {
    color: #16a34a;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .lueckenansicht-panel {
        top: auto;
        bottom: 70px;
        right: 10px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        border: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    
    .lueckenansicht-panel .panel-mini {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: none;
        padding: 0;
        justify-content: center;
    }
    
    .lueckenansicht-panel .panel-mini .mini-text {
        display: none;
    }
    
    .lueckenansicht-panel.expanded {
        width: 100%;
        height: 60%;
        bottom: 0;
        right: 0;
        border-radius: 20px 20px 0 0;
    }
    
    .tag-detail-modal {
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        bottom: 10px !important;
        max-width: none;
    }
}

/* Dialog Loading */
.dialog-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    gap: 10px;
    color: #64748b;
}

.dialog-loading .loading-spinner {
    font-size: 24px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

