/* assets/css/absent_premium.css */

:root {
    --absent-primary: #3b82f6;
    --absent-danger: #ef4444;
    --absent-success: #22c55e;
    --absent-warning: #f59e0b;
    --absent-bg: rgba(255, 255, 255, 0.05);
    --absent-border: rgba(255, 255, 255, 0.1);
    --absent-text-muted: rgba(255, 255, 255, 0.6);
}

/* --- Layout --- */
.absent-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 992px) {
    .absent-layout {
        grid-template-columns: 1fr;
    }
}

/* --- Smart Dropdown --- */
.smart-search-container {
    position: relative;
    width: 100%;
}

.search-input-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--absent-bg);
    border: 1px solid var(--absent-border);
    border-radius: 12px;
    padding: 12px 16px;
    cursor: text;
    transition: all 0.2s;
}

.search-input-box:focus-within {
    border-color: var(--absent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-icon {
    color: var(--absent-text-muted);
    margin-right: 12px;
}

.smart-input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    font-size: 1rem;
    outline: none;
}

.dropdown-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: #1e293b;
    border: 1px solid var(--absent-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    /* Hidden by default */
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-results.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

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

.result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.result-info {
    display: flex;
    flex-direction: column;
}

.result-name {
    font-weight: 500;
    color: white;
}

.result-sub {
    font-size: 0.8rem;
    color: var(--absent-text-muted);
}

/* --- Communication Chips --- */
.comm-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.comm-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: var(--absent-bg);
    border: 1px solid var(--absent-border);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.comm-option i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--absent-text-muted);
}

.comm-option span {
    font-size: 0.75rem;
    color: var(--absent-text-muted);
}

.comm-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.comm-option.selected {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--absent-primary);
}

.comm-option.selected i,
.comm-option.selected span {
    color: var(--absent-primary);
}

/* --- Visual Timeline --- */
.timeline-container {
    position: relative;
    padding: 20px 0;
    margin: 30px 0;
}

.timeline-track {
    position: relative;
    height: 12px;
    background: #334155;
    border-radius: 6px;
    width: 100%;
}

/* Zones */
.zone-danger {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
    border-radius: 6px 0 0 6px;
    width: 0%;
    /* Dynamic */
    transition: width 0.5s ease;
}

.zone-success {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
    border-radius: 0 6px 6px 0;
    left: 0;
    /* Dynamic start */
    transition: left 0.5s ease;
}

/* Markers */
.timeline-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: left 0.5s ease;
    z-index: 10;
}

.marker-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 4px solid #1e293b;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
}

.marker-label {
    font-size: 0.75rem;
    color: var(--absent-text-muted);
    white-space: nowrap;
    background: #1e293b;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--absent-border);
}

.marker-now .marker-dot {
    background: var(--absent-primary);
}

.marker-shift .marker-dot {
    background: white;
}

/* Labels on track */
.track-label {
    position: absolute;
    top: 20px;
    font-size: 0.7rem;
    color: var(--absent-text-muted);
    transform: translateX(-50%);
}

/* --- Drag Drop --- */
.dropzone {
    border: 2px dashed var(--absent-border);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--absent-primary);
    background: rgba(59, 130, 246, 0.05);
}

.drop-icon {
    font-size: 2rem;
    color: var(--absent-text-muted);
    margin-bottom: 10px;
}

.drop-text {
    font-size: 0.9rem;
    color: var(--absent-text-muted);
}

/* --- Context Panel --- */
.emp-profile-header {
    text-align: center;
    padding: 24px;
    border-bottom: 1px solid var(--absent-border);
}

.large-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #3b82f6;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    border: 4px solid #1e293b;
}

.emp-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.emp-role {
    font-size: 0.9rem;
    color: var(--absent-text-muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 20px;
}

.mini-stat {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.stat-val {
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--absent-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gauge-container {
    position: relative;
    width: 100%;
    height: 6px;
    background: #334155;
    border-radius: 3px;
    margin-top: 8px;
}

.gauge-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

/* Color Utils */
.text-green {
    color: var(--absent-success);
}

.text-red {
    color: var(--absent-danger);
}

.bg-green {
    background: var(--absent-success);
}

.bg-red {
    background: var(--absent-danger);
}

.bg-orange {
    background: var(--absent-warning);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Input Icons */
.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--absent-text-muted);
    z-index: 10;
    pointer-events: none;
}

.form-control.flatpickr-input {
    padding-left: 44px;
    /* Space for icon */
    background: var(--absent-bg);
    border: 1px solid var(--absent-border);
    color: white;
    cursor: pointer;
}

/* Flatpickr Overrides for Glassmorphism */
.flatpickr-calendar {
    background: #1e293b !important;
    border: 1px solid var(--absent-border) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.today:hover,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: var(--absent-primary) !important;
    border-color: var(--absent-primary) !important;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Ensure text is visible in dark theme */
.flatpickr-months .flatpickr-month {
    color: white !important;
    fill: white !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
    background-color: #1e293b !important;
}

span.flatpickr-weekday {
    color: var(--absent-text-muted) !important;
}

.flatpickr-day {
    color: #e2e8f0 !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: rgba(255, 255, 255, 0.1) !important;
}

/* Quick Shift Chips */
.quick-shift-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-shift-chips .chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--absent-border);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--absent-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-shift-chips .chip:hover {
    background: rgba(59, 130, 246, 0.2);
    color: white;
    border-color: var(--absent-primary);
}

.quick-shift-chips .chip:active {
    transform: scale(0.95);
}

/* Holiday Indicators for Flatpickr */
.flatpickr-day.sl-holiday {
    border: 1px solid #f59e0b !important;
    /* Amber border */
    position: relative;
    background: rgba(245, 158, 11, 0.1) !important;
}

.flatpickr-day.sl-holiday:hover {
    background: rgba(245, 158, 11, 0.3) !important;
}

.holiday-dot {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: #f59e0b;
    /* Amber dot */
    border-radius: 50%;
}

/* Custom Select Styling */
select.form-control {
    background-color: var(--absent-bg) !important;
    border: 1px solid var(--absent-border) !important;
    color: white !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    padding-right: 48px !important;
    /* Space for arrow */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 16px !important;
    cursor: pointer;
    line-height: normal;
    /* Fix alignment */
}

select.form-control:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--absent-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

select.form-control option {
    background-color: #1e293b;
    color: white;
    padding: 10px;
}

/* Custom Alerts */
.alert {
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 0.9rem !important;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: rgba(34, 197, 94, 0.2) !important;
    color: #86efac !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
}

.dot-container {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
}

.holiday-dot {
    position: static !important;
    /* Reset absolute */
    transform: none !important;
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.dot-merc {
    background-color: #f59e0b;
    /* Orange */
}

.dot-pub {
    background-color: #3b82f6;
    /* Blue */
}

.dot-bank {
    background-color: #10b981;
    /* Green */
}

/* Badges */
.badge {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-warning {
    background: #f59e0b;
    color: black;
}

.badge-primary {
    background: #3b82f6;
    color: white;
}

.badge-success {
    background: #10b981;
    color: white;
}

.badge-primary {
    background: #3b82f6;
    color: white;
}


/* Separate Date and Time in Flatpickr Popup */
.flatpickr-time {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid var(--absent-border) !important;
    padding-top: 10px !important;
    margin-top: 10px !important;
}

.flatpickr-time input {
    color: var(--absent-primary) !important;
    font-weight: bold !important;
    font-size: 1.1rem !important;
}

.flatpickr-time .flatpickr-time-separator {
    color: var(--absent-text-muted) !important;
}

.flatpickr-calendar.hasTime .flatpickr-time {
    height: auto !important;
    line-height: normal !important;
    max-height: none !important;
}

/* Hide Flatpickr's auto-generated text input since we use a custom div */
.input-icon-wrapper input.flatpickr-input[type="text"] {
    display: none !important;
}