/* Zenith Command Center - Futuristic Navigation System */

:root {
    --zenith-glass: rgba(255, 255, 255, 0.7);
    --zenith-border: rgba(255, 255, 255, 0.4);
    --zenith-accent: #0ea5e9; /* Sky 500 */
    --zenith-glow: rgba(14, 165, 233, 0.3);
}

/* Base Layout Stabilizers */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    touch-action: manipulation;
}

/* The Main Dock */
.zenith-dock {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: var(--zenith-glass);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1.5px solid var(--zenith-border);
    border-radius: 4rem;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 20px 40px -10px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    width: fit-content;
    max-width: 95vw;
}

.zenith-dock:hover {
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 30px 60px -20px rgba(0, 0, 0, 0.3);
    transform: translateX(-50%) translateY(-5px);
}

/* Nav Buttons */
.zenith-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 2rem;
    color: #64748b; /* Slate 500 */
    transition: all 0.3s ease;
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.zenith-btn i {
    width: 1.4rem;
    height: 1.4rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.zenith-btn span {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.3rem;
    opacity: 0.7;
}

.zenith-btn.active {
    color: var(--zenith-accent);
    background: rgba(14, 165, 233, 0.08);
}

.zenith-btn.active i {
    transform: scale(1.2);
}

.zenith-btn:active {
    transform: scale(0.9);
}

/* The Nexus Center Button */
.zenith-nexus {
    width: 4.5rem;
    height: 4.5rem;
    background: linear-gradient(135deg, #0ea5e9, #2dd4bf);
    border-radius: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 25px var(--zenith-glow);
    animation: nexus-pulse 3s infinite;
    z-index: 10;
    margin: 0 0.2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.zenith-nexus:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px var(--zenith-glow);
}

.zenith-nexus.open,
.zenith-nexus.active {
    transform: rotate(45deg) scale(0.9);
    background: #1e293b; /* Slate 800 */
    box-shadow: none;
}

@keyframes nexus-pulse {
    0% { box-shadow: 0 0 0 0 var(--zenith-glow); }
    70% { box-shadow: 0 0 0 20px rgba(14, 165, 233, 0); }
    100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

/* The Full Hub Overlay */
.zenith-hub-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4); /* Slate 900/40 */
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 3rem;
    padding-bottom: 8rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    transform: translateY(20px);
}

.zenith-hub-overlay.visible,
.zenith-hub-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 1100;
}

.zenith-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.zenith-hub-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: white;
    transition: all 0.3s ease;
    text-decoration: none;
}

.zenith-hub-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.zenith-hub-item i {
    width: 1.8rem;
    height: 1.8rem;
    color: var(--zenith-accent);
}

.zenith-hub-item span {
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

/* Advanced Hub Content */
.zenith-hub-content {
    width: 90%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3rem;
    padding: 2rem 1.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-shrink: 0;
    margin: auto 0;
}

@media (min-width: 640px) {
    .zenith-hub-content {
        padding: 2.5rem;
    }
}

.zenith-hub-header {
    margin-bottom: 2.5rem;
    text-align: left;
}

.zenith-hub-item.group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2.2rem;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.zenith-hub-item.group:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-8px) scale(1.02);
}

.zenith-hub-icon-wrapper {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.zenith-hub-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

/* Nexus Morphing Button */
.zenith-nexus-btn {
    width: 4.5rem;
    height: 4.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.nexus-ring {
    position: absolute;
    inset: -4px;
    border: 2px solid rgba(14, 165, 233, 0.3);
    border-radius: 50%;
    animation: nexus-spin 10s linear infinite;
}

.nexus-core {
    width: 3.8rem;
    height: 3.8rem;
    background: linear-gradient(135deg, #0ea5e9, #2dd4bf);
    border-radius: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.zenith-nexus-btn.open .nexus-ring {
    opacity: 0;
}

.zenith-nexus-btn.open .nexus-core {
    transform: scale(0.9) rotate(90deg);
    background: #1e293b;
    box-shadow: none;
}

/* Admin Dock Nav Items (zenith-nav-item variant) */
.zenith-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 2rem;
    color: #64748b;
    transition: all 0.3s ease;
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.zenith-nav-item i {
    width: 1.4rem;
    height: 1.4rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.zenith-nav-item.active {
    color: var(--zenith-accent);
    background: rgba(14, 165, 233, 0.08);
}

.zenith-nav-item.active i {
    transform: scale(1.2);
}

.zenith-nav-item:active {
    transform: scale(0.9);
}

.zenith-nav-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.3rem;
    opacity: 0.7;
}

/* Admin Nexus Icon Toggle */
.nexus-icon-container {
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
}

.nexus-icon-grid,
.nexus-icon-close {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: white;
    transition: all 0.3s ease;
}

.nexus-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.zenith-nexus.active .nexus-icon-grid {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.zenith-nexus.active .nexus-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

@keyframes nexus-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Global Safe Area to prevent dock obstruction */
.zenith-safe-area {
    padding-bottom: 12rem !important;
}

@media (min-width: 1024px) {
    .zenith-safe-area {
        padding-bottom: 2rem !important;
    }
}

/* Responsive Safe Areas (Modern Devices) */
@supports (padding: env(safe-area-inset-bottom)) {
    .zenith-dock-wrapper {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ==========================================
   ROSTER MODAL STAFF CHECKLIST STYLES
   ========================================== */

/* Shift Type Button States */
.shift-type-btn {
    position: relative;
    transition: all 0.2s ease;
}

.shift-type-btn.border-blue-500 {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

/* Staff Checklist Container */
#roster-staff-container,
#roster-off-staff-container {
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Staff List */
#roster-staff-container::-webkit-scrollbar,
#roster-off-staff-container::-webkit-scrollbar {
    width: 6px;
}

#roster-staff-container::-webkit-scrollbar-track,
#roster-off-staff-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#roster-staff-container::-webkit-scrollbar-thumb,
#roster-off-staff-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#roster-staff-container::-webkit-scrollbar-thumb:hover,
#roster-off-staff-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Staff Checkbox Item */
#roster-staff-container .flex,
#roster-off-staff-container .flex {
    transition: background-color 0.15s ease;
}

#roster-staff-container input[type="checkbox"]:disabled + label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Selected Staff Tags */
#selected-staff-tags span {
    animation: tag-pop-in 0.2s ease;
}

@keyframes tag-pop-in {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Staff Checkbox Animation */
#roster-staff-container input[type="checkbox"] {
    transition: all 0.15s ease;
}

#roster-staff-container input[type="checkbox"]:checked {
    transform: scale(1.1);
}

/* Status Badge Styles */
.status-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* Section Headers in Staff List */
#roster-staff-container > div:first-child,
#roster-off-staff-container > div:first-child {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* ==========================================
   CUSTOM SHIFT MODE STYLES
   ========================================== */

/* Mode Toggle Button */
#btn-mode-preset,
#btn-mode-custom {
    position: relative;
    overflow: hidden;
}

#btn-mode-preset.bg-white,
#btn-mode-custom.bg-white {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Custom Shift Section */
#custom-shift-section {
    animation: slide-down 0.2s ease;
}

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

/* Custom Time Preset Buttons */
#custom-shift-section button[onclick^="setCustomTime"] {
    transition: all 0.15s ease;
}

#custom-shift-section button[onclick^="setCustomTime"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.15);
}

#custom-shift-section button[onclick^="setCustomTime"]:active {
    transform: translateY(0);
}

/* Time Input Focus States for Custom Mode */
#custom-shift-start:focus,
#custom-shift-end:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Responsive Modal */
@media (max-width: 640px) {
    #modal-add-roster .sm\:max-w-2xl {
        max-width: 100%;
        margin: 0;
    }
    
    .shift-type-btn {
        padding: 0.75rem;
    }
    
    .shift-type-btn > div > div:last-child {
        font-size: 9px;
    }
    
    /* Stack mode toggle buttons on mobile */
    #btn-mode-preset span,
    #btn-mode-custom span {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    #btn-mode-preset,
    #btn-mode-custom {
        padding: 0.5rem 0.25rem;
    }
}

/* ==========================================
   ROSTER GRID MARGINS
   ========================================== */

/* Main Roster Grid Container Margins */
#slots-view-parent {
    margin-left: 4cm;
    margin-right: 4cm;
    margin-top: 0.5cm;
}

/* For print media - maintain margins when printing */
@media print {
    #slots-view-parent {
        margin-left: 4cm !important;
        margin-right: 4cm !important;
        margin-top: 0.5cm !important;
    }
    
    /* Force all colors to black and white - using very high specificity */
    #roster-grid-container * {
        background-color: white !important;
        background: white !important;
        color: black !important;
        -webkit-print-color-adjust: economy !important;
        print-color-adjust: economy !important;
    }
    
    /* Black and white styles for roster shift blocks */
    #roster-grid-container .absolute.inset-y-1\.5,
    #roster-grid-container [class*="rounded-xl"],
    #roster-grid-container .group\/slot,
    #roster-grid-container [style*="background-color"] {
        background-color: white !important;
        background: white !important;
        background-image: none !important;
        color: black !important;
        border: 1px solid black !important;
        box-shadow: none !important;
    }
    
    /* Ensure text is black */
    #roster-grid-container .text-\[9px\],
    #roster-grid-container .text-\[10px\],
    #roster-grid-container .text-\[8px\],
    #roster-grid-container .font-bold,
    #roster-grid-container .font-black,
    #roster-grid-container span,
    #roster-grid-container div {
        color: black !important;
    }
    
    /* Page break controls - prevent shift blocks from breaking */
    #roster-grid-container .absolute.inset-y-1\.5,
    #roster-grid-container .grid > div,
    #roster-grid-container [class*="rounded-xl"] {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    /* Prevent rows from breaking across pages */
    #roster-grid-container .grid {
        page-break-inside: auto !important;
    }
    
    #roster-grid-container .grid > * {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    /* Background elements in grayscale */
    #roster-grid-container .bg-slate-100,
    #roster-grid-container .bg-slate-200,
    #roster-grid-container .bg-slate-50,
    #roster-grid-container .bg-slate-800,
    #roster-grid-container .bg-slate-900,
    #roster-grid-container [class*="bg-"] {
        background-color: #f0f0f0 !important;
        background: #f0f0f0 !important;
        background-image: none !important;
    }
    
    /* Badges and labels */
    #roster-grid-container .rounded-full,
    #roster-grid-container .bg-black\/5,
    #roster-grid-container .bg-white\/30 {
        background-color: transparent !important;
        background: transparent !important;
        border: 1px solid #666 !important;
    }
    
    /* Remove color indicators */
    #roster-grid-container .w-1\.5,
    #roster-grid-container .h-1\.5,
    #roster-grid-container .rounded-full {
        background-color: #666 !important;
        background: #666 !important;
    }
    
    /* Multi-staff badge */
    #roster-grid-container .bg-red-500,
    #roster-grid-container [class*="bg-red"] {
        background-color: black !important;
        background: black !important;
        color: white !important;
    }
    
    /* Hide background colors on all elements with inline styles */
    [style*="background"] {
        background-color: white !important;
        background: white !important;
        background-image: none !important;
    }
    
    [style*="color"] {
        color: black !important;
    }
}

/* Responsive: Remove large margins on smaller screens */
@media (max-width: 1024px) {
    #slots-view-parent {
        margin-left: 1rem;
        margin-right: 1rem;
        margin-top: 1rem;
    }
}

@media (max-width: 640px) {
    #slots-view-parent {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        margin-top: 0.5rem;
    }
}
