/* HR Management System - Custom Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* General */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
}

/* Cards */
.card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
}

/* Login Page */
#login-page .card {
    border-radius: 16px;
}

#login-page .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--secondary-color);
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
}

/* Stats Cards */
.stat-card {
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* Page transitions */
.page-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading */
#loading-screen {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand span {
        display: none;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Clock buttons */
.clock-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.clock-btn i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Notifications dropdown */
#notifications-dropdown {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background-color: #f0f7ff;
}

/* Sidebar (for future use) */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 250px;
    height: calc(100vh - 56px);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    z-index: 1000;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-rejected {
    background-color: #f8d7da;
    color: #842029;
}

/* Form improvements */
.form-label {
    font-weight: 500;
    color: #495057;
}

.form-control, .form-select {
    border-radius: 8px;
    padding: 0.625rem 1rem;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .modal {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Storico Timbrature - Badge Viaggio */
.bg-purple {
    background-color: #9b59b6 !important;
}

.bg-purple-light {
    background-color: #d7bde2 !important;
    color: #5b2c6f !important;
}

/* Tabelle con colonne ordinabili */
th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    background-color: #e9ecef;
}

th.sortable i {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    opacity: 0.6;
}

th.sortable:hover i {
    opacity: 1;
}

/* ========================================
   PLANNING TIMELINE STYLES
   ======================================== */

.planning-timeline-container {
    max-height: calc(100vh - 350px);
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.planning-timeline {
    font-size: 0.75rem;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
}

.planning-timeline thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
}

.planning-timeline thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 0.25rem;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

.planning-timeline thead th.month-header {
    background: #e9ecef;
    font-weight: 700;
    border-left: 2px solid #adb5bd;
}

.planning-timeline thead th.employee-header {
    position: sticky;
    left: 0;
    z-index: 11;
    background: #f8f9fa;
    min-width: 180px;
    text-align: left;
    padding-left: 0.5rem;
}

.planning-timeline thead th.day-header {
    min-width: 28px;
    max-width: 28px;
    font-size: 0.65rem;
}

.planning-timeline thead th.day-header.weekend {
    background: #ffeeba;
}

.planning-timeline thead th.day-header.today {
    background: #cce5ff;
    font-weight: 700;
}

.planning-timeline tbody td {
    padding: 0;
    height: 32px;
    vertical-align: middle;
    border: 1px solid #e9ecef;
}

.planning-timeline tbody td.employee-cell {
    position: sticky;
    left: 0;
    z-index: 5;
    background: white;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    white-space: nowrap;
    border-right: 2px solid #dee2e6;
}

.planning-timeline tbody td.employee-cell .employee-name {
    font-weight: 600;
    color: #212529;
}

.planning-timeline tbody td.employee-cell .employee-role {
    font-size: 0.65rem;
    color: #6c757d;
}

.planning-timeline tbody td.day-cell {
    min-width: 28px;
    max-width: 28px;
    position: relative;
    cursor: default;
}

.planning-timeline tbody td.day-cell.weekend {
    background: #fffbe6;
}

.planning-timeline tbody tr:hover td.employee-cell {
    background: #f0f7ff;
}

/* Absence cells */
.planning-absence {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    cursor: help;
}

.planning-absence.full-day {
    /* Occupa tutta la cella */
}

.planning-absence.half-day-am {
    height: 50%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.planning-absence.half-day-pm {
    height: 50%;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.planning-absence.partial {
    font-size: 0.6rem;
}

/* Status colors */
.planning-absence.status-pending {
    opacity: 0.7;
}

.planning-absence.status-approved {
    opacity: 1;
}

.planning-absence.status-rejected {
    opacity: 0.5;
    text-decoration: line-through;
}

/* Tooltip */
.planning-tooltip {
    position: absolute;
    background: #212529;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    z-index: 100;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.planning-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #212529;
}

/* Month separators */
.planning-timeline tbody td.month-start {
    border-left: 2px solid #adb5bd;
}

/* Responsive */
@media (max-width: 768px) {
    .planning-timeline-container {
        max-height: calc(100vh - 400px);
    }
    
    .planning-timeline thead th.employee-header,
    .planning-timeline tbody td.employee-cell {
        min-width: 120px;
    }
}

