/* public/css/style.css */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #f8fafc;
    --dark: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    align-items: center;
}

.navbar-menu > li > a {
    color: var(--dark);
    text-decoration: none;
    transition: all 0.2s;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    display: block;
}

.navbar-menu > li > a:hover {
    color: var(--primary);
    background: var(--light);
}

.navbar-menu > li > a.nav-active {
    color: var(--primary);
    font-weight: 600;
}

/* Dropdown Container */
.navbar-item-dropdown {
    position: relative;
}

.navbar-item-dropdown.nav-active-parent > a {
    color: var(--primary);
    font-weight: 600;
}

.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.nav-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 4px;
    vertical-align: middle;
    transition: transform 0.2s;
}

.navbar-item-dropdown:hover .nav-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.navbar-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    padding: 0.5rem 0;
    list-style: none;
    z-index: 100;
    padding-top: 0.75rem;
}

.navbar-dropdown::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.75rem;
}

.navbar-item-dropdown:hover .navbar-dropdown {
    display: block;
}

.navbar-dropdown li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.15s;
    font-size: 0.9rem;
}

.navbar-dropdown li a:hover {
    background: var(--light);
    color: var(--primary);
}

.navbar-dropdown li a.nav-active {
    color: var(--primary);
    font-weight: 600;
    background: #eff6ff;
}

/* Hilfe-Button */
.nav-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--light);
    color: var(--secondary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.nav-help-btn:hover,
.nav-help-btn.nav-active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background: var(--light);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.table td {
    padding: 1rem;
    border-top: 1px solid var(--light);
}

.table tbody tr:hover {
    background: var(--light);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.stat-label {
    color: var(--secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-positive {
    color: var(--success);
}

.stat-negative {
    color: var(--danger);
}

/* Calendar */
.calendar {
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    padding: 0.5rem;
    border: 1px solid var(--light);
    border-radius: 4px;
    text-align: center;
}

.calendar-day.today {
    background: var(--primary);
    color: white;
}

.calendar-day.vacation {
    background: #dbeafe;
}

.calendar-day.sick {
    background: #fee2e2;
}

.calendar-day.holiday {
    background: #fef3c7;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Image Lightbox */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.image-lightbox.active {
    display: flex;
}

.image-lightbox img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.image-lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--dark);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.image-lightbox-close:active {
    background: var(--light);
}

.image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .navbar-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
        order: 3;
    }

    .navbar-menu > li > a {
        padding: 0.5rem 0.75rem;
    }

    .navbar-dropdown {
        position: static;
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        padding-left: 1rem;
        background: var(--light);
    }

    .navbar-item-dropdown:hover .navbar-dropdown {
        display: block;
    }

    .navbar-user {
        order: 2;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

		/* ========================================
   STEMPEL-WIDGET & TIMER
   ======================================== */

/* Stempel-Widget Status */
.time-clock-status {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background: #f1f5f9;
    color: #64748b;
}

/* Timer Display */
.work-timer {
    font-size: 3rem;
    font-weight: bold;
    color: #10b981;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
    text-align: center;
}

/* Stempel-Widget Card Border */
.card.time-clock-active {
    border: 3px solid #10b981;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.card.time-clock-inactive {
    border: 3px solid #94a3b8;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    max-width: 500px;
    width: 90%;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--dark);
}

/* Stempel-Buttons */
.btn-clock {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    font-weight: bold;
}

.btn-clock-start {
    background: #10b981;
    color: white;
    width: 100%;
}

.btn-clock-start:hover {
    background: #059669;
}

.btn-clock-pause {
    background: #f59e0b;
    color: white;
}

.btn-clock-pause:hover {
    background: #d97706;
}

.btn-clock-stop {
    background: #ef4444;
    color: white;
}

.btn-clock-stop:hover {
    background: #dc2626;
}

/* Status Indicator (Grüner Punkt) */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.active {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-indicator.inactive {
    background: #94a3b8;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Zeit-Info Badges */
.time-info {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #64748b;
    margin: 0.5rem 0;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .work-timer {
        font-size: 2rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 5% 1rem;
    }
    
    .btn-clock {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .time-clock-status {
        font-size: 1rem;
    }
}

/* Stempel-Widget Animation beim Einchecken */
@keyframes checkInSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.card.time-clock-active {
    animation: checkInSuccess 0.5s ease;
}

/* Pause-Modus Styling */
.pause-mode {
    background: #fef3c7;
    border-color: #f59e0b;
}

.pause-mode .work-timer {
    color: #d97706;
}

/* Button Groups für Stempel-Aktionen */
.clock-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .clock-actions {
        flex-direction: column;
    }
    
    .clock-actions .btn {
        width: 100%;
    }
}
/* ========================================
   NOTIFICATION POPUP & ARBEITSZEIT-PLANUNG
   ======================================== */
.notification-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 10000;
}
.notification-popup {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: white; border-radius: 12px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%; max-width: 450px; z-index: 10001; overflow: hidden;
}
.notification-popup-header {
    background: var(--primary); color: white; padding: 1rem 1.5rem;
    font-size: 1.1rem; font-weight: 600;
}
.notification-popup-body { padding: 1.5rem; }
.notification-detail { margin-bottom: 0.5rem; font-size: 0.95rem; }
.notification-popup-actions {
    padding: 1rem 1.5rem; border-top: 1px solid var(--light);
    display: flex; gap: 0.5rem; justify-content: flex-end;
}
.notification-badge-container { position: fixed; top: 0.75rem; right: 1rem; z-index: 9999; }
.notification-badge {
    background: var(--danger); color: white; border-radius: 50%;
    width: 24px; height: 24px; display: inline-flex; align-items: center;
    justify-content: center; font-size: 0.75rem; font-weight: 700;
    animation: notif-pulse 2s infinite;
}
@keyframes notif-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.week-plan-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; margin-bottom: 2rem; }
.week-plan-day { background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); min-height: 160px; overflow: hidden; }
.week-plan-day.weekend { background: #f1f5f9; opacity: 0.7; }
.week-plan-day.today { border: 2px solid var(--primary); }
.week-plan-day.past { opacity: 0.6; }
.week-plan-day-header { background: var(--light); padding: 0.5rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; border-bottom: 1px solid #e2e8f0; }
.week-plan-day.today .week-plan-day-header { background: var(--primary); color: white; }
.week-plan-day-body { padding: 0.5rem; }
.week-plan-entry { background: #dbeafe; border-radius: 6px; padding: 0.5rem; font-size: 0.8rem; }
.week-plan-time { font-weight: 600; color: var(--primary-dark); margin-bottom: 0.25rem; }
.week-plan-break { color: var(--secondary); font-size: 0.75rem; }
.week-plan-notes { color: var(--secondary); font-size: 0.75rem; font-style: italic; margin-top: 0.25rem; }
.week-plan-empty { text-align: center; padding: 1rem 0.25rem; }
.week-plan-add { display: block; margin: 0.5rem auto 0; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 1.2rem; line-height: 1; }
.week-plan-request { margin-top: 0.5rem; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.7rem; }
.week-plan-request.pending { background: #fef3c7; border: 1px solid #f59e0b; }
.week-plan-request.declined { background: #fee2e2; border: 1px solid #ef4444; }
.week-plan-request.clarify { background: #dbeafe; border: 1px solid #3b82f6; }

@media (max-width: 768px) {
    .week-plan-grid { grid-template-columns: 1fr; }
    .week-plan-day { min-height: auto; }
}

/* Backup */
.backup-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.backup-info-item { background: var(--light); border-radius: 8px; padding: 1rem; }
.backup-info-label { display: block; font-size: 0.85rem; color: var(--secondary); margin-bottom: 0.25rem; }
.backup-info-value { display: block; font-size: 1.1rem; font-weight: 600; }
.backup-preview { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 1rem; }

/* Customer-Project Grouping */
.customer-projects {
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.card-header[onclick] {
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.2s;
}

.card-header[onclick]:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* ========================================
   VACATION DISPLAY
   ======================================== */

/* Vacation Display in Week Plan */
.week-plan-vacation {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.week-plan-vacation strong {
    color: #92400e;
}

/* Vacation Stats */
.vacation-progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.vacation-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f59e0b);
    transition: width 0.3s ease;
}

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */

/* Dashboard Widgets: Desktop nebeneinander, Mobile untereinander */
.dashboard-widgets {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
}

/* Mobile Navigation - Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    color: var(--primary);
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 1024px) {
    /* Navbar Layout auf Mobile */
    .navbar-content {
        position: relative;
    }

    /* Hamburger Button sichtbar machen */
    .mobile-menu-toggle {
        display: block;
        order: 2; /* Nach dem Logo */
        z-index: 1001;
    }

    /* Logo */
    .navbar-brand {
        order: 1;
    }

    /* User Section */
    .navbar-user {
        order: 3;
        margin-left: auto;
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .navbar-user span {
        display: none; /* Username auf Mobile verstecken */
    }

    /* Menu versteckt, dann Fullscreen Overlay */
    .navbar-menu {
        display: none;
        position: fixed;
        top: 70px; /* Unter der Navbar */
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        flex-direction: column;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 1rem;
        gap: 0;
        z-index: 1000;
        overflow-y: auto;
        order: 4;
    }

    .navbar-menu.mobile-active {
        display: flex !important;
    }

    .navbar-menu > li {
        width: 100%;
        border-bottom: 1px solid #e2e8f0;
    }

    .navbar-menu > li:last-child {
        border-bottom: none;
    }

    .navbar-menu > li > a {
        padding: 1rem;
        width: 100%;
        font-size: 1.1rem;
    }

    /* Dropdown in Mobile */
    .navbar-dropdown {
        position: static;
        box-shadow: none;
        background: #f8fafc;
        margin-top: 0.5rem;
        display: none;
    }

    .navbar-item-dropdown:hover .navbar-dropdown {
        display: none; /* Deaktiviere Hover auf Mobile */
    }

    .navbar-item-dropdown.mobile-dropdown-open .navbar-dropdown {
        display: block;
    }

    .navbar-dropdown li a {
        padding-left: 2rem !important;
    }

    /* Container Padding auf Mobile */
    .container {
        padding: 0 10px;
    }

    /* Kleinere Schriftgrößen auf Mobile */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    /* Stats Grid - 2 Spalten auf Mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Tabellen horizontal scrollbar */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Buttons volle Breite auf Mobile */
    .btn-mobile-full {
        width: 100%;
    }

    /* Form Rows auf Mobile untereinander */
    .form-row {
        flex-direction: column;
    }
}
