/* GeoTabel Panel — Custom Styles */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Smooth transitions — targeted only */
a, button, .stat-card, .quick-card, .shift-card, .plan-card, .nav-link-active, .badge, .page-btn, .toggle-switch {
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, opacity 150ms ease, transform 150ms ease;
}
input, textarea, select {
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== NAV ===== */
.panel-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-link-active {
    color: #2563EB !important;
    font-weight: 600 !important;
    background: rgba(37, 99, 235, 0.06) !important;
    position: relative;
}
.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563EB, #3B82F6);
    border-radius: 1px;
}

/* ===== MORE DROPDOWN ===== */
#more-dropdown { position: relative !important; }
#more-dropdown > .more-menu {
    display: none !important;
    position: absolute !important;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    min-width: 200px;
    padding: 6px;
}
#more-dropdown.open > .more-menu { display: block !important; }
#more-dropdown.open .more-arrow { transform: rotate(180deg); }
.more-arrow { transition: transform 150ms ease; }
.more-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    border-radius: 8px;
    text-decoration: none;
}
.more-menu__item:hover { background: #EFF6FF; color: #2563EB; }
.more-menu__item--active { color: #2563EB; font-weight: 600; background: rgba(37,99,235,0.06); }

/* ===== STAT CARDS ===== */
.stat-card {
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(20px, -20px);
}
.stat-card-blue { border-left-color: #2563EB; }
.stat-card-blue::before { background: #2563EB; }
.stat-card-green { border-left-color: #16A34A; }
.stat-card-green::before { background: #16A34A; }
.stat-card-teal { border-left-color: #7C3AED; }
.stat-card-teal::before { background: #7C3AED; }
.stat-card-orange { border-left-color: #F97316; }
.stat-card-orange::before { background: #F97316; }

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    appearance: none;
    -webkit-appearance: none;
    background: #D1D5DB;
    border-radius: 13px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}
.toggle-switch:checked {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
}
.toggle-switch::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 150ms ease;
}
.toggle-switch:checked::before {
    transform: translateX(22px);
}

/* ===== TABLE ===== */
.table-row:hover { background: #F8FAFC; }

/* ===== QUICK CARDS ===== */
.quick-card {
    position: relative;
    overflow: hidden;
}
.quick-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(37, 99, 235, 0.03));
    opacity: 0;
    transition: opacity 200ms;
}
.quick-card:hover::before { opacity: 1; }
.quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1), 0 2px 8px rgba(0,0,0,0.06);
}

/* ===== MOBILE BOTTOM TAB BAR ===== */
.mobile-tab-bar {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(226,232,240,0.8);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)) 8px;
    justify-content: space-around;
}
.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 500;
    color: #94A3B8;
    text-decoration: none;
    border-radius: 8px;
    min-width: 56px;
}
.tab-item svg { color: #94A3B8; }
.tab-active { color: #2563EB !important; font-weight: 600; }
.tab-active svg { color: #2563EB !important; }

/* ===== PLAN CARD ===== */
.plan-featured {
    box-shadow: 0 0 0 2px #2563EB, 0 8px 32px rgba(37,99,235,0.12);
}
.plan-card {
    position: relative;
    overflow: hidden;
}
.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #E2E8F0, #E2E8F0);
}
.plan-card-accent::before {
    background: linear-gradient(90deg, #2563EB, #3B82F6, #60A5FA);
}

/* ===== FOCUS ===== */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ===== PAGE HEADING ===== */
.page-heading {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.02em;
}

/* ===== BADGE ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
}

/* ===== MODAL ===== */
.modal-backdrop {
    backdrop-filter: blur(6px);
}

/* ===== PAGINATION ===== */
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    color: #475569;
    background: white;
}
.page-btn:hover { background: #F1F5F9; border-color: #93C5FD; color: #2563EB; }
.page-btn-active { background: linear-gradient(135deg, #2563EB, #1D4ED8); color: white; border-color: transparent; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }

/* ===== AUTH PAGE ===== */
.auth-bg {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 30%, #E0F2FE 60%, #F0F9FF 100%);
    min-height: 100vh;
    position: relative;
}
.auth-bg::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.auth-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226,232,240,0.6);
    box-shadow: 0 16px 48px rgba(37,99,235,0.08), 0 4px 12px rgba(0,0,0,0.04);
}

/* ===== SHIFT CARD ===== */
.shift-card {
    position: relative;
    overflow: hidden;
}
.shift-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: #E2E8F0;
}
.shift-card-open::before {
    background: linear-gradient(180deg, #22C55E, #16A34A);
}
.shift-card-closed::before {
    background: #CBD5E1;
}
.shift-card:hover {
    border-color: #BFDBFE;
    box-shadow: 0 4px 24px rgba(37,99,235,0.08), 0 1px 4px rgba(0,0,0,0.04);
}

/* ===== INFO CARD (settings, detail) ===== */
.info-card {
    border: 1px solid rgba(226,232,240,0.8);
    background: #fff;
}
.info-card-header {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border-bottom: 1px solid rgba(226,232,240,0.6);
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
}

/* ===== INVITE BANNER ===== */
.invite-banner {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 50%, #E0F2FE 100%);
    border: 1px solid rgba(59,130,246,0.15);
    position: relative;
    overflow: hidden;
}
.invite-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    nav .desktop-nav { display: none; }
    .mobile-tab-bar { display: flex; }
    .mb-tab-safe { padding-bottom: 80px; }
}
@media (min-width: 641px) {
    .mobile-tab-bar { display: none !important; }
}

/* ===== TABLE SCROLL ===== */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* ===== MAP ===== */
[id^="map-"] {
    border-radius: 0.75rem;
    overflow: hidden;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: fadeIn 300ms ease forwards;
}
.animate-slide-up {
    animation: slideUp 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===== PWA INSTALL BANNER ===== */
.pwa-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 300ms ease;
}
.pwa-banner-visible {
    transform: translateY(0);
}
.pwa-banner-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto 16px;
    padding: 14px 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.1);
    border: 1px solid #EEF1F6;
    margin-left: 12px;
    margin-right: 12px;
}
.pwa-banner-icon {
    flex-shrink: 0;
}
.pwa-banner-icon img {
    border-radius: 10px;
}
.pwa-banner-text {
    flex: 1;
    min-width: 0;
}
.pwa-banner-title {
    font-size: 14px;
    font-weight: 600;
    color: #1B2430;
}
.pwa-banner-desc {
    font-size: 12px;
    color: #829AB1;
    margin-top: 2px;
}
.pwa-banner-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.pwa-banner-btn:hover {
    background: linear-gradient(135deg, #1D4ED8, #1E40AF);
}
.pwa-banner-close {
    flex-shrink: 0;
    padding: 6px 10px;
    background: none;
    border: none;
    color: #9FB3C8;
    font-size: 12px;
    cursor: pointer;
}
.pwa-banner-close:hover {
    color: #5E6A78;
}

/* ===== CHECKBOX DROPDOWN (shifts export) ===== */
.cb-dropdown { position: relative; }
.cb-dropdown__btn {
    display: flex; align-items: center; justify-content: space-between; gap: 4px;
    border: 1px solid #E2E8F0; border-radius: 0.75rem; padding: 0.5rem 0.75rem;
    font-size: 0.875rem; background: rgba(248,250,252,0.5); cursor: pointer;
    min-width: 160px; white-space: nowrap; user-select: none;
}
.cb-dropdown__btn:focus, .cb-dropdown__btn:hover { background: #fff; border-color: #93C5FD; }
.cb-dropdown__panel {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 40;
    background: #fff; border: 1px solid #E2E8F0; border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.1); min-width: 220px; max-height: 260px;
    overflow-y: auto; padding: 0.25rem 0;
}
.cb-dropdown.open .cb-dropdown__panel { display: block; }
.cb-dropdown__item {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem;
    font-size: 0.8125rem; cursor: pointer; color: #334155;
}
.cb-dropdown__item:hover { background: #F0F7FF; }
.cb-dropdown__item input { accent-color: #2563EB; width: 15px; height: 15px; cursor: pointer; }
.cb-dropdown__arrow { width: 16px; height: 16px; flex-shrink: 0; color: #94A3B8; transition: transform .2s; }
.cb-dropdown.open .cb-dropdown__arrow { transform: rotate(180deg); }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
