/* ========================================
   Zeiterfassung (Time Tracking) CSS
   ======================================== */

/* ========================================
   Root Styles & Layout
   ======================================== */

.zeiterfassung-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.zeiterfassung-container h1 {
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 600;
}

/* ========================================
   Active Timer Display
   ======================================== */

.running-timer-section {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.running-timer-section p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

/* ========================================
   Form Controls - Start/Stop
   ======================================== */

.time-form {
    margin: 30px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background-color: #f44336;
    color: white;
}

.btn-secondary:hover {
    background-color: #da190b;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.btn-cancel {
    background-color: #757575;
    color: white;
}

.btn-cancel:hover {
    background-color: #616161;
    box-shadow: 0 2px 8px rgba(117, 117, 117, 0.3);
}

/* ========================================
   Overlay Dialog - Pause/Stop Confirmation
   ======================================== */

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.overlay-dialog {
    position: relative;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.overlay-dialog h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #333;
}

/* ========================================
   Form Elements (in Dialogs)
   ======================================== */

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-group input[type="date"]:focus,
.form-group input[type="time"]:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.2);
}

.overlay-dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.overlay-dialog-buttons .btn {
    flex: 1;
    max-width: 200px;
}

/* ========================================
   Monthly Entries Section
   ======================================== */

.monthly-entries-section {
    text-align: left;
    margin-top: 40px;
}

.month-section {
    margin-bottom: 20px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.month-header {
    cursor: pointer;
    background-color: #2c2c2c;
    color: white;
    padding: 15px;
    border-radius: 5px 5px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.3s ease;
}

.month-header:hover {
    background-color: #404040;
}

.month-header-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.month-header-total {
    font-size: 0.95rem;
    font-weight: 500;
}

.month-toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.month-toggle-icon.expanded {
    transform: rotate(180deg);
}

.month-details {
    display: none;
    padding: 15px;
    border: 1px solid #ddd;
    border-top: none;
    background-color: #fafafa;
    border-radius: 0 0 5px 5px;
}

.month-details.visible {
    display: block;
}

/* ========================================
   Tables & Entries
   ======================================== */

.entries-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    font-size: 0.95rem;
}

.entries-table thead {
    background-color: #2c2c2c;
    color: white;
}

.entries-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #ddd;
}

.entries-table td {
    padding: 12px;
    border: 1px solid #ddd;
}

.entries-table tbody tr {
    transition: background-color 0.2s ease;
}

.entries-table tbody tr:hover {
    background-color: #f5f5f5;
}

.entries-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.entries-table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

/* ========================================
   Utility Classes
   ======================================== */

.spacing-vertical-small {
    margin-bottom: 8px;
}

.spacing-vertical-medium {
    margin-bottom: 15px;
}

.spacing-vertical-large {
    margin-bottom: 30px;
}

.spacing-horizontal-small {
    margin-right: 8px;
}

.spacing-horizontal-medium {
    margin-right: 15px;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-weight-bold {
    font-weight: 600;
}

.font-size-large {
    font-size: 1.1rem;
}

.font-size-small {
    font-size: 0.9rem;
}

.color-success {
    color: #4CAF50;
}

.color-danger {
    color: #f44336;
}

.color-warning {
    color: #ff9800;
}

.color-info {
    color: #2196F3;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .zeiterfassung-container {
        padding: 15px;
    }

    .zeiterfassung-container h1 {
        font-size: 2rem;
        margin-bottom: 20px;
    }

    .time-form {
        margin: 20px 0;
        gap: 8px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .overlay-dialog {
        width: 95%;
        padding: 20px;
    }

    .overlay-dialog h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .month-header {
        padding: 12px;
    }

    .month-header-title {
        font-size: 1rem;
    }

    .month-details {
        padding: 10px;
    }

    .entries-table {
        font-size: 0.85rem;
    }

    .entries-table th,
    .entries-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .zeiterfassung-container {
        padding: 10px;
    }

    .zeiterfassung-container h1 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .time-form {
        flex-direction: column;
        margin: 15px 0;
    }

    .btn {
        width: 100%;
    }

    .overlay-dialog {
        width: 98%;
        padding: 15px;
    }

    .overlay-dialog-buttons {
        flex-direction: column;
    }

    .overlay-dialog-buttons .btn {
        max-width: 100%;
    }

    .form-group input[type="date"],
    .form-group input[type="time"],
    .form-group input[type="text"] {
        font-size: 16px;
    }

    .month-header {
        padding: 10px;
    }

    .month-details {
        padding: 8px;
    }

    .entries-table {
        font-size: 0.8rem;
    }

    .entries-table th,
    .entries-table td {
        padding: 6px;
    }

    .month-header-title {
        font-size: 0.95rem;
    }

    .month-header-total {
        font-size: 0.85rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .time-form,
    .btn-secondary {
        display: none;
    }

    .overlay {
        display: none !important;
    }

    .zeiterfassung-container {
        max-width: 100%;
    }

    .month-details {
        display: block !important;
        page-break-inside: avoid;
    }

    .entries-table {
        page-break-inside: avoid;
    }
}

/* ========================================
   Animation & Transitions
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
