/* ========== ATTENDANCE SYSTEM CSS ========== */

/* CSS cho cột điểm danh */
.attendance-day-cell {
    background: white;
    min-height: 80px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #ecf0f1;
}

.attendance-day-cell:hover {
    background: rgba(52, 152, 219, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.attendance-day-cell.other-month {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: default;
}

.attendance-day-cell.other-month:hover {
    background: #f8f9fa;
    transform: none;
    box-shadow: none;
}

.attendance-day-cell.weekend {
    background: rgba(231, 76, 60, 0.05);
}

.attendance-day-cell.today {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid #3498db;
}

.attendance-day-cell.disabled {
    background: #f8f9fa !important;
    color: #adb5bd !important;
    cursor: default !important;
    opacity: 0.6;
}

.attendance-day-cell.disabled:hover {
    background: #f8f9fa !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Trạng thái điểm danh - màu nền cho từng ca */
.attendance-shift-info.status-working {
    background: rgba(255, 235, 59, 0.4) !important;
    border: 1px solid rgba(255, 235, 59, 0.6);
}

.attendance-shift-info.status-late {
    background: rgba(244, 67, 54, 0.4) !important;
    border: 1px solid rgba(244, 67, 54, 0.6);
}

.attendance-shift-info.status-completed {
    background: rgba(76, 175, 80, 0.4) !important;
    border: 1px solid rgba(76, 175, 80, 0.6);
}

.attendance-day-number {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #2c3e50;
    text-align: center;
}

.attendance-shifts-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.attendance-shift-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 9px;
    background: #f8f9fa;
}

.attendance-shift-name {
    font-weight: 600;
    color: #34495e;
    min-width: 12px;
}

.attendance-shift-status-display {
    display: flex;
    gap: 2px;
}

.attendance-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid #bdc3c7;
}

.attendance-status-dot.checked-in,
.attendance-status-dot.checked-out {
    background: #27ae60;
    border-color: #27ae60;
}

.attendance-status-dot.pending {
    background: #ecf0f1;
}

/* CSS cho modal điểm danh */
.attendance-modal-shift-card {
    text-align: center;
    padding: 10px;
    background: #FFFFFF;
    border: 1px solid #ecf0f1;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.attendance-modal-shift-card:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.attendance-modal-shift-card.active {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.attendance-modal-shift-card.completed {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.attendance-modal-shift-card.late {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* CSS cho admin shift editor */
.admin-shift-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 50px;
    background: rgba(102, 126, 234, 0.1);
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attendance-modal-shift-card:hover .admin-shift-overlay {
    opacity: 1;
}

.admin-edit-hint {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    transform: translateY(5px);
    transition: all 0.3s ease;
}

.attendance-modal-shift-card:hover .admin-edit-hint {
    transform: translateY(0);
}

/* Tooltip styles */
.avatar-tooltip {
    position: relative;
    display: inline-block;
}

.avatar-tooltip .tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.avatar-tooltip:hover .tooltip-content,
.avatar-tooltip.show-tooltip .tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.attendance-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .attendance-day-cell {
        min-height: 70px;
        padding: 2px;
    }

    .attendance-day-number {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .attendance-shift-info {
        font-size: 8px;
        padding: 1px 2px;
    }

    .attendance-shift-name {
        min-width: 8px;
    }

    .attendance-status-dot {
        width: 5px;
        height: 5px;
    }

    .attendance-points-display {
        font-size: 8px;
        margin-top: 2px;
    }
    
    .employee-selector {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .attendance-modal-actions {
        flex-direction: column;
    }
    
    .attendance-modal-btn {
        width: 100%;
    }

    .avatar-tooltip .tooltip-content {
        font-size: 11px;
        padding: 8px 10px;
        bottom: 110%;
    }
}

/* Schedule calendar styles */
.schedule-calender .tab-content .activity-update > li > div {
    border-width: 4px !important;
    border-radius: 6px 0px 0px 6px !important;
    justify-content: space-between !important;
    gap: 6px !important;
    flex-direction: row !important;
}

.schedule-calender .schedule-wrapper {
    justify-content: center !important; 
}

@media (max-width: 1490px) and (min-width: 1400px) {
    .schedule-calender .card-header-right-icon {
        display: block !important;
    }
}

/* CSS cho nút vào ca */
.attendance-btn-checkin {
    background: #27ae60;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.attendance-btn-checkin:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

.attendance-btn-checkin:active {
    transform: translateY(0);
    box-shadow: none;
}

.attendance-btn-checkin i {
    font-size: 16px;
}

.attendance-btn-checkin.disabled {
    background: #bdc3c7 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    pointer-events: none;
}