/* ============================================
   CSS RESET & BASE
   ============================================ */

* {
    box-sizing: border-box;
}

/* Time/Date Input - Container isolieren */
.time-input-container {
    position: relative;
    isolation: isolate;
}

/* Time/Date Input - Klickbereich auf Element begrenzen */
input[type="time"],
input[type="date"] {
    position: relative;
}

/* Desktop: Verhindere dass der native Picker-Button über das Feld hinausragt */
@media (min-width: 768px) {
    input[type="time"]::-webkit-calendar-picker-indicator {
        position: relative;
        width: 20px;
        height: 20px;
        cursor: pointer;
    }
}

/* ============================================
   ALLGEMEINE STYLES
   ============================================ */

.tab-content { 
    display: none; 
}

.tab-content.active { 
    display: block; 
}

/* Mobile Calendar Filter Dropdown */
#mobile-calendar-filter-dropdown {
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

#mobile-calendar-filter-dropdown.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

#mobile-calendar-filter-dropdown:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

/* Checkmark visibility - nur bei aktiven Filtern anzeigen */
.calendar-filter-btn .checkmark {
    opacity: 0;
    transition: opacity 0.2s;
}

.calendar-filter-btn.active .checkmark {
    opacity: 1;
}

/* Inactive state */
.calendar-filter-btn.inactive {
    opacity: 0.5;
}

.mobile-menu { 
    transform: translateX(-100%); 
    transition: transform 0.3s;
    position: fixed;
    top: 0;
    left: 0;
    width: 250px; /* oder die gewünschte Breite */
    height: 100vh;
    background: white;
    z-index: 10001 !important; /* Höchste Priorität */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active { 
    transform: translateX(0);
    z-index: 999999 !important; /* Explizit auch hier setzen */
}

/* Optional: Overlay-Hintergrund beim geöffneten Menü */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10002;
}

.mobile-menu.active ~ .mobile-menu-overlay,
.mobile-menu-overlay.active {
    display: block;
}

/* ============================================
   SORTABLE STYLES (für Aufgaben-Tab)
   ============================================ */

.sortable-ghost {
    opacity: 0.4;
    background: #f3f4f6;
    border: 2px dashed #9ca3af;
}

.sortable-chosen {
    opacity: 0.9;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: scale(1.02);
}

.sortable-drag {
    opacity: 0;
}

/* ============================================
   DROPPABLE STYLES (für Aufgaben-Tab)
   ============================================ */

.droppable-area {
    transition: background-color 0.2s;
    position: relative;
}

.droppable-area.drag-over {
    background-color: rgba(99, 102, 241, 0.1);
}

.droppable-area:empty::after {
    content: 'Aufgaben hier ablegen';
    display: block;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 2rem;
}

/* ============================================
   AKKORDEON STYLES (für Zeiterfassung)
   ============================================ */

.accordion-container {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.accordion-header {
    background: #f3f4f6;
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #e5e7eb;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content.expanded {
    max-height: 5000px;
    transition: max-height 0.5s ease-in;
}

/* ============================================
   KALENDER-SPEZIFISCHE STYLES
   ============================================ */

.calendar-container {
    position: relative;
}

.calendar-cell {
    position: relative;
    height: 64px !important;
    min-height: 64px !important;
}

.appointment-container {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

.calendar-appointment {
    position: absolute !important;
    transition: all 0.2s;
    cursor: pointer;
}

/* Kalender-Typ Borders */
.calendar-border-hauswartung {
    border: 3px solid #FCD34D !important;
    box-shadow: 0 0 0 1px #FCD34D;
}

.calendar-border-unterhalt {
    border: 3px solid #3B82F6 !important;
    box-shadow: 0 0 0 1px #3B82F6;
}

/* Filter Buttons */
.calendar-filter-btn {
    transition: all 0.2s;
}

.calendar-filter-btn.active {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.calendar-filter-btn.inactive {
    opacity: 0.5;
    filter: grayscale(50%);
}

/* ============================================
   COLOR PICKER STYLES
   ============================================ */

.color-picker,
.edit-color-picker {
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.color-picker:hover,
.edit-color-picker:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.color-picker.selected,
.edit-color-picker.selected {
    border-width: 3px !important;
    border-color: #1f2937 !important;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #1f2937;
}

/* ============================================
   TIME PICKER STYLES
   ============================================ */

.time-input-trigger {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 1.125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}

.time-input-trigger:hover {
    border-color: #6366f1;
    background-color: #f9fafb;
}

/* ============================================
   NOTIFICATION STYLES
   ============================================ */

.notification {
    pointer-events: auto;
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease-out;
}

.notification.hiding {
    opacity: 0;
    transform: translateX(100%);
}

/* ============================================
   MOBILE STYLES
   ============================================ */

/* Mobile Tab Content - 28px Abstand vom oberen Rand für alle Haupttabs */
@media (max-width: 640px) {
    #dashboard > .max-w-7xl,
    #mitarbeiter > .max-w-7xl,
    #zeiterfassung > .max-w-7xl,
    #objekte > .max-w-7xl,
    #kunden > .max-w-7xl,
    #aufgaben > .max-w-7xl {
        padding-top: 1px !important;
    }
}

.day-view-container {
    display: none;
}

/* All-day events section für Tag und Wochenansicht */
.all-day-events-section {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    padding: 8px;
    min-height: 40px;
}

/* Mobile All-Day Section */
.mobile-all-day-section {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    padding: 12px;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-all-day-section .text-xs {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.all-day-events-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    padding: 4px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.all-day-event {
    margin: 4px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.all-day-event:hover {
    filter: brightness(0.95);
    transform: translateX(2px);
}

.all-day-event:active {
    transform: scale(0.98);
}

@media (max-width: 640px) {
    .all-day-event {
        font-size: 12px;
        padding: 5px 8px;
    }
}

@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .mobile-nav { display: block; }
    .week-view-container { display: none !important; }
    .day-view-container { 
        display: block !important;
        min-height: 500px !important;
    }
    
    /* Mobile Day View */
    .mobile-day-header {
        background: white;
        padding: 1rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .mobile-hour-row {
        display: flex;
        border-bottom: 1px solid #e5e7eb;
        min-height: 80px;
    }
    
    .mobile-hour-label {
        width: 50px;
        padding: 0.5rem;
        background: #f9fafb;
        border-right: 1px solid #e5e7eb;
        font-size: 0.75rem;
        font-weight: 500;
        color: #4b5563;
    }
    
    .mobile-hour-content {
        flex: 1;
        position: relative !important;
        min-height: 80px !important;
    }
    
    /* Mobile Appointments - WICHTIGE FIXES */
    .mobile-hour-content .appointment-container {
        position: absolute !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
    }
    
    .mobile-hour-content .calendar-appointment {
        position: absolute !important;
        border-radius: 6px !important;
        padding: 4px 6px !important;
        margin: 0 4px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        min-height: 25px;
        font-size: 11px;
        line-height: 1.2;
        cursor: pointer;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .calendar-appointment .appointment-content {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .calendar-appointment .truncate {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Mobile Monatsansicht Popup */
    .month-popup-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
    }
    
    .month-popup-day {
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
        touch-action: manipulation;
    }
    
    .month-popup-day:active {
        transform: scale(0.95);
        transition: transform 0.1s;
    }
}

/* Desktop Only Styles */
@media (min-width: 769px) {
    .desktop-nav { display: block; }
    .mobile-nav { display: none; }
    .week-view-container { display: block !important; }
    .day-view-container { display: none !important; }
    
    .calendar-appointment:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from { 
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    to { 
        opacity: 0;
        transform: translateY(-50%) scale(0.9);
    }
}

/* Verhindere ungewolltes Selektieren beim Swipen */
.mobile-day-wrapper {
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-y;
}

/* Smooth transition für Tageswechsel */
.mobile-calendar-grid {
    transition: opacity 0.2s ease;
}

/* ============================================
   KALENDER CONTAINER FIXES
   ============================================ */

#kalender .max-w-7xl {
    min-height: 600px !important;
}

#kalender .bg-white.shadow.rounded-lg {
    min-height: 600px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
/* Calendar Ghost & Drag Styles */
.calendar-ghost {
    transition: none !important;
    pointer-events: none !important;
    opacity: 0.6;
    z-index: 1000;
}
/* In styles.css ergänzen */
.calendar-dnd-ghost {
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.resize-handle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.calendar-appointment.dragging {
    opacity: 0.3;
}
.calendar-appointment.dragging {
    opacity: 0.3;
}

.calendar-appointment.dragging-prepare {
    cursor: move;
}

.calendar-appointment.resizing {
    opacity: 0.7;
}

.calendar-appointment.keyboard-moving,
.calendar-appointment.keyboard-resizing {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
    animation: pulse 1s infinite;
}

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

/* Resize Handles */
.resize-handle {
    opacity: 0;
    transition: opacity 0.2s;
}

.time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 30;
    transition: top 0.3s ease;
}

.time-indicator-line {
    height: 2px;
    background-color: #EF4444;
    position: relative;
    width: 100%;
}

.time-indicator-dot {
    position: absolute;
    left: -4px;
    top: -5px;
    width: 12px;
    height: 12px;
    background-color: #EF4444;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Für Mobile */
.mobile-time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 30;
}

.mobile-time-indicator-line {
    height: 2px;
    background-color: #EF4444;
    margin-left: 60px; /* Offset für Zeit-Label */
}

.calendar-appointment:hover .resize-handle {
    opacity: 1;
}

.resize-handle:hover {
    background-color: rgba(99, 102, 241, 0.3);
}

/* Calendar Tooltip */
.calendar-tooltip {
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Accessibility */
.calendar-appointment:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Now Indicator Animation */
.now-line {
    animation: pulse-line 2s ease-in-out infinite;
}

@keyframes pulse-line {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .calendar-appointment {
        min-height: 30px;
        font-size: 0.75rem;
    }
    /* Mobile: auch fetter und etwas größer */
@media (max-width: 640px) {
    .calendar-appointment .font-semibold {
        font-weight: 700 !important;
        font-size: 14px !important;
    }
}
    .mobile-hour-row {
        border-bottom: 1px solid #e5e7eb;
    }
    
    .mobile-hour-label {
        width: 60px;
        padding: 0.5rem;
        background: #f9fafb;
        border-right: 1px solid #e5e7eb;
        font-size: 0.75rem;
        color: #6b7280;
    }
}

/* Monatsansicht Styles */
.month-view-container {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    background-color: #e5e7eb;
    border: 1px solid #d1d5db;
}

.month-header-cell {
    background-color: #f9fafb;
    padding: 12px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    border-bottom: 1px solid #d1d5db;
}

.month-day-cell {
    background-color: white;
    min-height: 100px;
    padding: 2px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.15s;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    overflow: hidden;
}

@media (max-width: 640px) {
    .month-day-cell {
        min-height: 80px;
    }
}

.month-day-cell:active {
    background-color: #f9fafb;
}

.month-day-cell.other-month {
    background-color: #f9fafb;
}

.month-day-cell.other-month .month-day-number {
    color: #d1d5db;
}

.month-day-cell.today {
    background-color: #eff6ff;
}

.month-day-cell.today .month-day-number {
    background-color: #3b82f6;
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.month-day-cell.selected {
    background-color: #dbeafe;
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

.month-day-number {
    font-size: 12px;
    font-weight: 500;
    padding: 4px;
    color: #374151;
    text-align: center;
}

/* Google Calendar Style Event Pills */
.month-event-item {
    display: flex;
    align-items: center;
    padding: 2px 4px;
    margin: 1px 2px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .month-event-item {
        font-size: 10px;
        padding: 1px 3px;
    }
}

.month-event-item:hover {
    filter: brightness(0.95);
    transform: translateX(1px);
}

.month-event-item:active {
    transform: scale(0.98);
}

.month-event-item .event-time {
    margin-right: 3px;
    opacity: 0.9;
    font-weight: 600;
}

.month-event-item .event-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ganztägige Events */
.month-event-item.all-day {
    font-weight: 600;
    padding: 3px 6px;
}

.month-events-container {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 2px;
}

.month-more-events {
    font-size: 10px;
    color: #6b7280;
    padding: 2px 6px;
    margin: 1px 2px;
    cursor: pointer;
    font-weight: 500;
}

.month-more-events:hover {
    background-color: #f3f4f6;
    border-radius: 3px;
}

/* All-day events banner am oberen Rand */
.month-all-day-section {
    border-bottom: 1px solid #e5e7eb;
    padding: 2px;
    background-color: #f9fafb;
    min-height: 20px;
}

.month-appointment-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin: 1px;
}

.month-appointment-count {
    font-size: 10px;
    color: #6b7280;
    margin-top: 2px;
}

/* Swipe Animation */
.month-transition {
    transition: transform 0.3s ease-out;
}
/* View Switcher Styles */
[data-calendar-view] {
    min-width: 60px;
    font-weight: 500;
}

[data-calendar-view].active {
    background-color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

@media (max-width: 640px) {
    /* Mobile: View Switcher sichtbar */
    .sm\:hidden [data-calendar-view] {
        display: inline-block;
    }
}

/* Fixed Header Styles */
.mobile-day-header {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Stelle sicher, dass der Header über anderen Elementen ist */
.mobile-day-header.fixed {
    top: 0;
    left: 0;
    right: 0;
}



/* Für besseren Schatten-Effekt beim Scrollen */
.day-view-container {
    position: relative;
}

/* Swipe Animations für Tagesansicht */
.day-view-container {
    position: relative;
    overflow: hidden;
}

.day-content-wrapper {
    position: relative;
    width: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.day-content-wrapper.swiping {
    transition: none;
}

.day-swipe-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #6b7280;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 5;
}

.day-swipe-hint.left {
    left: 16px;
}

.day-swipe-hint.right {
    right: 16px;
}

.day-swipe-hint.visible {
    opacity: 1;
}

/* Slide Animations */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutToLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

.slide-in-from-right {
    animation: slideInFromRight 0.3s ease-out;
}

.slide-in-from-left {
    animation: slideInFromLeft 0.3s ease-out;
}

/* ============================================
   TAB CONTENT VISIBILITY FIX
   ============================================ */

.tab-content {
    display: none;
    min-height: 600px;
}

.tab-content.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#kalender.active {
    display: block !important;
}


/* Mobile Autocomplete Anpassungen */
@media (max-width: 768px) {
    /* Basis-Styles für Autocomplete Dropdown */
    #location-autocomplete,
    #edit-location-autocomplete {
        position: absolute !important;
        z-index: 9999 !important;
        width: calc(100% - 2rem) !important;
        margin: 0 1rem !important;
        max-height: 200px !important;
        overflow-y: auto !important;
    }
    
    /* Wenn aktiv/sichtbar */
    #location-autocomplete.active,
    #edit-location-autocomplete:not(.hidden) {
        display: block !important;
    }
    
    /* Touch-optimierte Vorschläge */
    .location-suggestion {
        padding: 0.875rem 1rem !important;
        min-height: 48px;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .location-suggestion:last-child {
        border-bottom: none;
    }
    
    /* Größere Schrift für bessere Lesbarkeit */
    .location-suggestion-primary {
        font-size: 0.9375rem !important;
        line-height: 1.25rem !important;
    }
    
    .location-suggestion-secondary {
        font-size: 0.8125rem !important;
        line-height: 1rem !important;
        margin-top: 0.25rem;
    }
}

/* Verhindere iOS Zoom bei Input Focus */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
    }
}
/* Moderne Task-Karten Styles */
.droppable-area {
    min-height: 200px;
    transition: background-color 0.2s ease;
    border-radius: 0.75rem;
    padding: 0.5rem;
}

.droppable-area.drag-over {
    background-color: rgba(99, 102, 241, 0.05);
}

/* Sortable Ghost & Drag Styles */
.sortable-ghost {
    opacity: 0.3;
    transform: scale(0.98);
}

.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.sortable-drag {
    opacity: 0.9 !important;
    transform: rotate(2deg);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

/* Smooth transitions */
.bg-white {
    transition: all 0.2s ease;
}

/* Hover-Effekt für Task-Karten */
.hover\:shadow-md:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Status-spezifische Board-Hintergründe */
#todo-tasks, #object-todo-tasks {
    background: linear-gradient(to bottom, rgba(243, 244, 246, 0.5), transparent);
}

#inprogress-tasks, #object-inprogress-tasks {
    background: linear-gradient(to bottom, rgba(254, 249, 195, 0.2), transparent);
}

#review-tasks, #object-review-tasks {
    background: linear-gradient(to bottom, rgba(219, 234, 254, 0.2), transparent);
}

#done-tasks, #object-done-tasks {
    background: linear-gradient(to bottom, rgba(220, 252, 231, 0.2), transparent);
}

/* Mobile Modal Anpassungen */
@media (max-width: 640px) {
    /* Modals auf Vollbildschirm auf Handys */
    #appointment-modal .bg-white,
    #appointment-edit-modal .bg-white,
    #appointment-view-modal .bg-white {
        border-radius: 0;
        min-height: 100vh;
        margin: 0;
        max-height: none !important;
    }
    
    /* Scrollbarer Inhalt */
    #appointment-modal form,
    #appointment-edit-modal form,
    #appointment-view-modal .p-6 {
        overflow-y: auto;
        max-height: calc(100vh - 140px); /* Header und Footer Platz lassen */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling auf iOS */
    }
    
    /* Footer am unteren Rand fixieren */
    #appointment-modal .border-t,
    #appointment-edit-modal .border-t {
        position: sticky;
        bottom: 0;
        background: white;
        z-index: 10;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* Header oben fixieren */
    #appointment-modal .border-b,
    #appointment-edit-modal .border-b,
    #appointment-view-modal .border-b {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}

/* Mobile Modal Vollbild */
@media (max-width: 640px) {
    /* Entferne padding vom Container */
    #appointment-modal > div:first-child {
        padding: 0 !important;
    }
    
    /* Modal nimmt gesamten Bildschirm ein */
    #appointment-modal .bg-white {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    /* iOS Style Header */
    #appointment-modal .border-b:first-child {
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    /* Buttons im iOS Style */
    button.text-blue-600 {
        color: #007AFF !important;
        font-size: 17px;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Smooth Scrolling */
    #appointment-modal form {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Safe Area für neuere iPhones */
    #appointment-modal .bg-white {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}



/* Address Search Overlay - Höchste z-index Priorität */
#address-search-overlay {
    z-index: 10000 !important;
}

/* Stelle sicher, dass die Modals einen niedrigeren z-index haben */
#appointment-modal,
#appointment-edit-modal,
#appointment-view-modal {
    z-index: 9990;
}

/* Verhindere horizontales Verschieben in Modals */
.fixed.inset-0,
#appointment-modal,
#appointment-edit-modal,
#appointment-view-modal,
#task-modal,
#time-modal {
    touch-action: pan-y pinch-zoom; /* Nur vertikales Scrollen erlauben */
    overscroll-behavior-x: contain; /* Verhindere horizontales Overscroll */
}

/* Modal-Inhalte */
.fixed.inset-0 .bg-white,
.modal-content,
[id$="-modal"] .bg-white {
    overflow-x: hidden !important;
    overflow-y: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
}

/* Modal Forms */
[id$="-modal"] form,
.fixed.inset-0 form {
    overflow-x: hidden !important;
    overscroll-behavior-x: contain;
    touch-action: pan-y pinch-zoom;
}

/* ============================================
   NATIVE TIME INPUT STYLES
   ============================================ */

/* Time Input über Button legen */
.relative {
    position: relative;
}

.time-input-trigger {
    position: relative;
    z-index: 1;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    font-weight: 500;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.time-input-trigger:hover {
    border-color: #6366f1;
    background-color: #f9fafb;
}

/* Time Input unsichtbar über Button */
input[type="time"] {
    font-size: 16px; /* Verhindert Zoom auf iOS */
}

/* Desktop: Verhindere dass Zeit-Picker kleben bleibt */
@media (min-width: 640px) {
    input[type="time"] {
        pointer-events: auto !important;
        z-index: auto !important;
    }
    
    /* Stelle sicher dass nach dem Schließen des Pickers andere Elemente anklickbar sind */
    input[type="time"]:not(:focus) {
        pointer-events: auto;
    }
}

/* iOS Safari Optimierung */
input[type="time"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    color: transparent;
    background: transparent;
    cursor: pointer;
}

/* Entferne Standard-Styling */
input[type="time"],
input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="time"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit {
    padding: 0;
}

/* Hover-Effekt für Kalender-Icon */
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Pause Quick-Buttons */
.pause-quick-btn {
    transition: all 0.2s ease;
}

.pause-quick-btn:active {
    transform: scale(0.95);
}

/* Verhindere Zoom auf iOS bei Input Focus */
@supports (-webkit-touch-callout: none) {
    input[type="time"],
    input[type="date"],
    input[type="number"] {
        font-size: 16px !important;
    }
}

    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
        20%, 40%, 60%, 80% { transform: translateX(10px); }
    }
    .animate-shake {
        animation: shake 0.5s;
    }

/* ============================================
   DESKTOP MODAL FIX - Scrollbare Modals
   NUR FÜR DESKTOP (ab 640px) - MOBILE BLEIBT UNVERÄNDERT!
   ============================================ */

@media (min-width: 640px) {
    /* ===== ALLE MODALS - DESKTOP ONLY ===== */
    
    /* Modal Äußerer Container - Begrenzte Höhe */
    [id$="-modal"] .bg-white:not(.mobile-only),
    #appointment-modal .sm\:max-w-md,
    #appointment-edit-modal .sm\:max-w-md,
    #appointment-view-modal .sm\:max-w-md,
    #task-modal .sm\:max-w-md,
    #task-edit-modal .sm\:max-w-md,
    #task-view-modal .sm\:max-w-md,
    #employee-modal .sm\:max-w-2xl,
    #object-modal .sm\:max-w-4xl,
    #customer-modal .sm\:max-w-4xl {
        max-height: 90vh !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important; /* Verhindere doppelte Scrollbars */
    }
    
    /* ===== MODAL HEADER - Fest oben ===== */
    [id$="-modal"] .border-b:not(.sm\:hidden),
    [id$="-modal"] .hidden.sm\:block.border-b,
    [id$="-modal"] .sm\:flex.border-b {
        flex-shrink: 0 !important;
        position: sticky !important;
        top: 0 !important;
        background: white !important;
        z-index: 10 !important;
        /* ENTFERNT: box-shadow - keine graue Linie mehr */
    }
    
    /* ===== MODAL CONTENT - Scrollbar hier! ===== */
    [id$="-modal"] form:not(.flex-shrink-0),
    [id$="-modal"] .overflow-y-auto,
    [id$="-modal"] .flex-1 {
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        scroll-behavior: smooth !important;
        /* Verhindere horizontales Scrollen */
        max-width: 100% !important;
    }
    
    /* ===== MODAL FOOTER - Fest unten, immer sichtbar ===== */
    [id$="-modal"] .border-t:not(.sm\:hidden),
    [id$="-modal"] .hidden.sm\:flex.border-t,
    [id$="-modal"] .sm\:flex.border-t {
        flex-shrink: 0 !important;
        position: sticky !important;
        bottom: 0 !important;
        background: white !important;
        z-index: 10 !important;
        /* ENTFERNT: box-shadow - keine graue Linie mehr */
    }
    
    /* ===== CUSTOM SCROLLBAR für besseres Aussehen ===== */
    [id$="-modal"] form::-webkit-scrollbar,
    [id$="-modal"] .overflow-y-auto::-webkit-scrollbar {
        width: 8px;
    }
    
    [id$="-modal"] form::-webkit-scrollbar-track,
    [id$="-modal"] .overflow-y-auto::-webkit-scrollbar-track {
        background: #f3f4f6;
        border-radius: 4px;
    }
    
    [id$="-modal"] form::-webkit-scrollbar-thumb,
    [id$="-modal"] .overflow-y-auto::-webkit-scrollbar-thumb {
        background: #9ca3af;
        border-radius: 4px;
    }
    
    [id$="-modal"] form::-webkit-scrollbar-thumb:hover,
    [id$="-modal"] .overflow-y-auto::-webkit-scrollbar-thumb:hover {
        background: #6b7280;
    }
    
    /* ===== SPEZIELLE FIXES FÜR GROSSE MODALS ===== */
    
    /* Employee Modal - größer */
    #employee-modal .sm\:max-w-2xl {
        max-width: 42rem !important;
    }
    
    /* Object & Customer Modals - noch größer */
    #object-modal .sm\:max-w-4xl,
    #customer-modal .sm\:max-w-4xl {
        max-width: 56rem !important;
    }
    
    /* ===== PADDING-FIX ===== */
    /* Verhindere dass Inhalt am Rand klebt */
    [id$="-modal"] form > div:first-child,
    [id$="-modal"] .overflow-y-auto > div:first-child {
        padding-bottom: 2rem !important; /* Extra Platz am Ende */
    }
}


  /* Object Details Modal - Desktop Button Fixes */
        @media (min-width: 640px) {
            /* Buttons im Object Details Content - gleiche Größe wie Task Modal Buttons */
            #object-details-content button:not(.color-picker):not(.object-view-tab),
            #object-details-content .btn {
                padding: 0.375rem 0.75rem !important;
                font-size: 0.875rem !important;
                line-height: 1.25rem !important;
            }
            
            /* Icons in Object Buttons kleiner machen */
            #object-details-content button:not(.object-view-tab) svg {
                width: 1rem !important;
                height: 1rem !important;
            }
        }
        
        /* Desktop Dropdown Sichtbarkeit erzwingen - FIXED POSITION! */
        #move-task-dropdown-desktop:not(.hidden) {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            pointer-events: auto !important;
            position: fixed !important;
            top: 50% !important;
            left: 50% !important;
            transform: translate(-50%, -50%) !important;
            width: 250px !important;
            min-width: 250px !important;
            max-width: 250px !important;
            background: white !important;
            border: 2px solid #d1d5db !important;
            border-radius: 0.5rem !important;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
            z-index: 99999 !important;
        }
        
        #move-task-dropdown-desktop.hidden {
            display: none !important;
        }
        
        /* Dropdown Buttons - sichtbar machen */
        #move-task-dropdown-desktop button {
            display: flex !important;
            width: 100% !important;
            background: white !important;
            border: none !important;
            padding: 0.5rem 0.75rem !important;
            cursor: pointer !important;
        }
        
        #move-task-dropdown-desktop button:hover {
            background-color: #f3f4f6 !important;
        }


/* ============================================
   MOBILE BLEIBT KOMPLETT UNVERÄNDERT!
   Alle bestehenden Mobile-Styles bleiben aktiv
   ============================================ */

   /* ===========================================
   ALL-DAY APPOINTMENTS STYLING
   Für ganztägige Termine in der Wochenansicht
   =========================================== */

/* All-Day Row Container */
.all-day-row {
    min-height: 40px;
    max-height: 120px; /* Begrenzt die Höhe bei vielen Terminen */
    overflow-y: auto; /* Scrollbar bei vielen Terminen */
    background: #fafafa;
}

/* All-Day Cell - Einzelne Tageszelle */
.all-day-cell {
    position: relative;
    padding: 0.25rem;
    min-height: 40px;
}

.all-day-cell:hover {
    background: #f5f5f5;
}

/* All-Day Appointment - Der Termin selbst */
.all-day-appointment {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

/* Styles für mehrtägige Termine */
.all-day-appointment[data-multiday-start="true"] {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: -1px;
    padding-right: 0.5rem;
}

.all-day-appointment[data-multiday-middle="true"] {
    border-radius: 0;
    margin-left: -1px;
    margin-right: -1px;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.all-day-appointment[data-multiday-end="true"] {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
    padding-left: 0.5rem;
}

.all-day-appointment:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}

/* Selected State */
.all-day-appointment.ring-2 {
    box-shadow: 0 0 0 2px #6366f1;
}

/* Tooltip für lange Titel */
.all-day-appointment[title] {
    cursor: help;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .all-day-row {
        font-size: 0.7rem;
    }
    
    .all-day-appointment {
        font-size: 0.65rem;
        padding: 0.125rem 0.25rem;
    }
}

/* Drag & Drop States (optional) */
.all-day-appointment.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.all-day-cell.drop-target {
    background: #e0e7ff;
    border: 2px dashed #6366f1;
}

/* Objekt-Auswahl Modal Styles */
#object-selection-modal .modal-content {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#object-selection-modal .object-selection-item {
    transition: all 0.2s ease;
}

#object-selection-modal .object-selection-item:hover {
    transform: translateX(2px);
}

@media (max-width: 640px) {
    #object-selection-modal .modal-content {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* iOS Style Time Picker */
#mobile-time-picker-modal {
    animation: fadeIn 0.3s ease;
}

#mobile-time-picker-content {
    animation: slideUp 0.3s ease;
    max-height: 60vh;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Wheel items */
.wheel-item {
    transition: all 0.2s ease;
    scroll-snap-align: center;
    height: 40px;
    line-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hour-wheel,
#minute-wheel,
#pause-hour-wheel,
#pause-minute-wheel {
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

/* Ensure proper centering on mobile */
#pause-hour-wheel .wheel-item,
#pause-minute-wheel .wheel-item {
    text-align: center;
    width: 100%;
}

/* Ensure touch scrolling works smoothly on iOS */
#hour-wheel::-webkit-scrollbar,
#minute-wheel::-webkit-scrollbar {
    display: none;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .time-input-trigger {
        font-size: 16px;
        padding: 0.75rem 1rem;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    #mobile-time-picker-content {
        max-height: 70vh;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Prevent iOS zoom on input focus */
    input[type="number"],
    input[type="date"],
    button {
        font-size: 16px !important;
    }
}

/* ====================================
   MOBILE TABS MENÜ (BURGER NAVIGATION)
   ==================================== */

/* Slide-in Animation für Mobile Tabs Menü */
#mobile-tabs-menu {
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
}

/* Mobile Tab Button - Icon und Text horizontal ausrichten */
.mobile-tab-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}

.mobile-tab-btn svg {
    flex-shrink: 0;
}

/* Aktiver Tab im Mobile Menü */
.mobile-tab-btn.active {
    background-color: #EEF2FF;
    color: #4F46E5;
    font-weight: 600;
}

/* Smooth Transitions */
#mobile-tabs-menu,
#mobile-tabs-overlay {
    transition: all 0.3s ease-in-out;
}

/* Hover Effekt für Mobile Tab Buttons */
.mobile-tab-btn:active {
    background-color: #E0E7FF;
    transform: scale(0.98);
}

/* Desktop: X-Button Hover Effekt */
@media (min-width: 640px) {
    #close-object-view:hover {
        transform: scale(1.1);
    }
    
    #close-object-view {
        transition: all 0.2s ease;
    }
}

/* ============================================
   NAVIGATION DROPDOWN STYLES
   ============================================ */

/* Desktop Navigation Dropdowns */
.nav-dropdown {
    position: relative;
}

.dropdown-menu,
.user-dropdown-menu {
    position: absolute;
    z-index: 1000;
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    margin-top: -1px; /* Seamless connection to button */
}

/* Add a small padding-top to dropdown to extend hover area */
.dropdown-menu::before,
.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background: transparent;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.user-dropdown-toggle:hover {
    background-color: #f9fafb;
}

/* Mobile Navigation Styles */
@media (max-width: 640px) {
    /* Hamburger button floats over content - no padding needed */
    
    /* Hide hamburger when menu is open */
    #mobile-menu-btn.menu-open {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    /* Mobile menu backdrop */
    #mobile-menu-backdrop {
        backdrop-filter: blur(2px);
    }
}

/* Akkordeon-Styling für Stundenübersicht */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Chevron-Rotation nur für spezifische Klassen (nicht Warn-Icons) */
details[open] > summary .day-chevron,
details[open] > summary .control-chevron { transform: rotate(90deg); }
details > summary .day-chevron,
details > summary .control-chevron { transition: transform 0.2s ease; }

/* Kontrollzeiten & Tages-Details Hover-Effekt */
details > summary:hover { background: #e5e7eb !important; }

/* Kontrollzeiten-Summary: dezenterer Hover */
details.control-details > summary:hover { background: #f3f4f6 !important; }

/* Gelbe Warnungen: Hover in Gelb */
details.bg-yellow-50 > summary:hover { background: #fde68a !important; }

/* Monats-Content Scroll - NUR auf Desktop begrenzt */
@media (min-width: 640px) {
    .month-content-scroll {
        max-height: 50vh;
        overflow-y: auto;
    }
}

/* ============================================
   TAGES-SUMMARY STYLES
   ============================================ */

/* Basis-Style für Tages-Summary */
.day-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(to right, #f9fafb, #f3f4f6);
    cursor: pointer;
    list-style: none;
    user-select: none;
    white-space: nowrap;
}

.day-summary-warning {
    background: linear-gradient(to right, #fef3c7, #fde68a);
}

.day-summary-left {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

/* Chevron */
.day-summary .day-chevron {
    width: 12px;
    height: 12px;
    color: #9ca3af;
    flex-shrink: 0;
}

.day-summary .day-chevron.warning {
    color: #d97706;
}

/* Warning Icon */
.day-summary .warning-icon {
    width: 14px;
    height: 14px;
    color: #d97706;
    flex-shrink: 0;
}

/* Tag-Name (Mo, Di, Mi...) - Normal */
.day-summary .day-name {
    font-weight: 400;
    color: #374151;
    font-size: 13px;
}

.day-summary .day-name.warning {
    color: #92400e;
}

/* Datum - Fett */
.day-summary .day-date {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.day-summary .day-date.warning {
    color: #92400e;
}

/* Badge (Anzahl Einträge) */
.day-summary .day-badge {
    font-size: 10px;
    color: #9ca3af;
    background: #e5e7eb;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.day-summary .day-badge.warning {
    color: #92400e;
    background: #fde68a;
    font-weight: 500;
}

/* Stunden */
.day-summary .day-hours {
    font-weight: 700;
    color: #4f46e5;
    font-size: 14px;
    flex-shrink: 0;
    margin-left: 8px;
}

.day-summary .day-hours.warning {
    color: #92400e;
    font-weight: 600;
}

/* ============================================
   DESKTOP STYLES (mehr Platz)
   ============================================ */
@media (min-width: 640px) {
    .day-summary {
        padding: 12px 16px;
    }
    
    .day-summary-left {
        gap: 10px;
    }
    
    .day-summary .day-chevron {
        width: 14px;
        height: 14px;
    }
    
    .day-summary .warning-icon {
        width: 16px;
        height: 16px;
    }
    
    .day-summary .day-name {
        font-size: 14px;
    }
    
    .day-summary .day-date {
        font-size: 14px;
    }
    
    .day-summary .day-badge {
        font-size: 11px;
        padding: 2px 8px;
    }
    
    .day-summary .day-hours {
        font-size: 15px;
        margin-left: 12px;
    }
}