/* AeroShift Custom CSS Styles */

/* Responsive Mobile Viewport & Edge-to-Edge Fluidity */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
    margin: 0;
    padding: 0;
}

body {
    width: 100%;
    max-width: 100%;
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

#mainPageWrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

/* Smooth horizontal scroll without overriding container max-width */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* Zero-FOUC & Pure Lock Screen Protection */
html.lock-active, html.lock-active body {
    overflow: hidden !important;
    height: 100vh !important;
    width: 100vw !important;
    position: fixed !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
    background-color: #000000 !important;
}
html.lock-active #mainPageWrapper {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
#siteLockScreen {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #000000 !important;
    z-index: 999999 !important;
    overflow: hidden !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
}

/* Netlify Badge & Feedback Drawer Hide */
[data-netlify-drawer],
[data-netlify-deploy-preview],
iframe[src*="netlify"],
div[class*="netlify"],
.netlify-badge {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Tab Navigation Active State */
.tab-btn {
    transition: all 0.2s ease-in-out;
    color: #94a3b8;
}
.tab-btn:hover {
    color: #f1f5f9;
    background-color: rgba(51, 65, 85, 0.5);
}
.tab-btn.active {
    color: #ffffff;
    background-color: #0284c7;
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
}

/* Custom Scrollbars */
.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.scrollbar-thin::-webkit-scrollbar-track {
    background: #0f172a;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 9999px;
}
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Shift Badges */
.badge-morning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.badge-evening {
    background-color: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}
.badge-night {
    background-color: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.4);
}
.badge-off {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.badge-rotation-off {
    background-color: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.5);
    font-weight: 700;
}
.badge-leave {
    background-color: rgba(244, 63, 94, 0.2);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.5);
}

/* Role Visibility Mode (RBAC) */
body.role-user .admin-only,
body.role-viewer .admin-only,
body.role-viewer .planner-only,
body.role-viewer .editor-only {
    display: none !important;
}

body.role-planner .admin-only {
    display: none !important;
}

/* Viewer Mode: Full-width table expansion when edit form is hidden */
body.role-viewer #trainSubViewPlans > div:not(.editor-only),
body.role-viewer #content-leaves .lg\:col-span-2 {
    grid-column: span 3 / span 3 !important;
}

/* Multi-Day Planning Deck & Quick Navigation */
.deck-card {
    transition: all 0.2s ease-in-out;
}
.deck-card:hover {
    transform: translateY(-2px);
    border-color: #38bdf8;
}
.deck-card.active-day {
    border-color: #38bdf8 !important;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(15, 23, 42, 0.95)) !important;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.25), 0 4px 6px -4px rgba(14, 165, 233, 0.25) !important;
}

.ribbon-day-chip {
    transition: all 0.15s ease-in-out;
}
.ribbon-day-chip:hover {
    border-color: #38bdf8;
    background-color: rgba(30, 41, 59, 0.9);
}
.ribbon-day-chip.active-ribbon {
    border-color: #0284c7 !important;
    background-color: rgba(2, 132, 199, 0.2) !important;
}

/* Printable Shift Handover & Roster Sheet */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    header, nav, .admin-only, button, select, input {
        display: none !important;
    }
    #content-duties, #content-roster {
        display: block !important;
    }
    table {
        color: #000000 !important;
        border: 1px solid #000000 !important;
    }
    th, td {
        border: 1px solid #cbd5e1 !important;
        color: #000000 !important;
    }
}

/* ================= Ergonomic Mobile Bottom Nav ================= */
#mobileBottomNav {
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}
.bottom-nav-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.bottom-nav-btn:active .bottom-icon-wrap {
    transform: scale(0.92);
}
.bottom-nav-btn.active .bottom-icon-wrap {
    animation: bottomPillPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes bottomPillPop {
    0% { transform: scale(0.85); }
    50% { transform: scale(1.18); }
    100% { transform: scale(1.10); }
}

/* iOS Safari / WebKit input[type="date"] taşma ve iç içe girme düzeltmesi */
#modalTechBirthDate,
#modalTechEmploymentStartDate {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden;
}
#modalTechBirthDate::-webkit-date-and-time-value,
#modalTechEmploymentStartDate::-webkit-date-and-time-value {
    text-align: center;
    margin: 0 auto;
    min-width: 0;
}
