/* === CITYCELL MASTER NAVIGATION & LAYOUT === */

/* SPLASH LOADING SCREEN (HEARTBEAT EDITION) */
#loading-screen {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.loader-logo {
    width: 220px;
    /* PC Premium Size */
    max-width: 80vw;
    height: auto;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.12));
    animation: splash-heartbeat 1.4s infinite ease-in-out;
}

.loader-dots {
    display: flex;
    gap: 12px;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: splash-dots 1.4s infinite ease-in-out both;
}

.loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Desktop Adjustment */
@media (max-width: 768px) {
    .loader-logo {
        width: 160px;
        /* Adjust for Mobile */
    }

    .loader-dots span {
        width: 6px;
        height: 6px;
    }
}

@keyframes splash-heartbeat {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes splash-dots {

    0%,
    80%,
    100% {
        transform: scale(0.5);
        opacity: 0.3;
    }

    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}


/* Main Wrapper */
.page-wrapper {
    min-height: 100vh;
    padding-top: 70px;
    /* Space for fixed header */
}

/* Header */
.main-header {
    height: 70px;
    background: var(--bg-header);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    /* Higher than views precisely */
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.nav-container {
    width: 100%;
    max-width: 1300px;
    /* Restored to narrow premium width */
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Compact desktop gap */
}

/* Ensure hidden state is respected even in flex containers */
.nav-links .btn.hidden {
    display: none !important;
}

.app-brand-logo {
    height: 38px;
    width: auto;
}

/* User Badge in Header (ELITE PILL) */
.header-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.header-user-badge:hover {
    background: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.btn-profile-trigger {
    background: var(--primary) !important;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white !important;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout-icon {
    background: #fef2f2 !important;
    color: #ef4444 !important;
    border: 1px solid #fee2e2 !important;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.btn-logout-icon:hover {
    background: #ef4444 !important;
    color: white !important;
    transform: rotate(9deg) scale(1.1);
}

.header-user-badge .user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-user-badge .user-text .name {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.header-user-badge .user-text .muted {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Search Container in Header */
.header-search-wrap {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
    position: relative;
}

/* Dashboard Views */
.view-section {
    display: none;
    padding: 30px 6% 80px 6%;
    /* Restored 6% side margins for centralized look */
    transition: all 0.3s;
    min-height: calc(100vh - 70px);
    width: 100%;
    max-width: 1300px;
    /* Constrained for premium focus */
    margin: 0 auto;
}

.view-section.active {
    display: block;
}

/* Auth View exception */
#view-login.view-section {
    padding: 0;
    min-height: 100vh;
}

/* Mobile Bottom Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(65px + var(--safe-bottom, 0px));
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1.5px solid #e2e8f0;
    z-index: 5000;
    padding-bottom: var(--safe-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

/* Both class names supported (HTML uses nav-item, CSS originally had mobile-nav-item) */
.mobile-nav-item,
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    gap: 3px;
    font-size: 0.6rem;
    font-weight: 800;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 4px;
    transition: color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mobile-nav-item i,
.nav-item i {
    font-size: 1.3rem;
}

.mobile-nav-item.active,
.nav-item.active {
    color: var(--primary);
}

.mobile-nav-item:hover,
.nav-item:hover {
    color: var(--primary);
}

@media (max-width: 1024px) {
    .view-section {
        padding: 20px;
        padding-bottom: 100px;
    }

    .mobile-nav {
        display: flex;
    }
}

/* === MOBILE HEADER: Show only icons on small screens === */
@media (max-width: 768px) {

    /* Hide text labels from nav buttons — keep only icons */
    .nav-label {
        display: none;
    }

    /* Tighten icon-only buttons */
    .nav-links .btn-ghost,
    .nav-links .btn {
        min-width: unset;
        padding: 8px 10px;
    }

    /* Logo stays but a bit smaller */
    .app-brand-logo {
        height: 30px;
    }

    .hide-on-mobile {
        display: none !important;
    }
}

/* Table Wrappers & Responsive Cards */
.table-wrap {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap th {
    background: #f8fafc;
    padding: 16px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
    text-align: left;
    border-bottom: 2px solid #f1f5f9;
}

.table-wrap td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: background-color var(--transition-fast);
}

.table-wrap tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

.table-wrap tbody tr:hover td {
    background-color: #f8fafc;
}

@media (max-width: 768px) {
    .table-wrap thead {
        display: none;
    }

    .table-wrap tr {
        display: block;
        padding: 15px;
        border-bottom: 8px solid #f1f5f9;
    }

    .table-wrap td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px dashed #f1f5f9;
        text-align: right;
    }

    .table-wrap td:last-child {
        border-bottom: none;
    }

    .table-wrap td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.7rem;
        color: var(--text-light);
        text-transform: uppercase;
        flex: 1;
        text-align: left;
    }
}

/* Forms Common */
.p-form-group {
    margin-bottom: 20px;
}

.p-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 8px;
}

.p-form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f8fafc;
    transition: all var(--transition-smooth);
}

.p-form-input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

/* === ELITE TAB SYSTEM — WHITE PILL WRAPPER === */
.grid-staggered-tabs {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 20px;
    column-gap: 10px;
    padding: 24px 30px;
    background: #f8fafc;
    border-radius: 30px;
    margin: 20px auto 40px auto;
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
    width: 100%;
}

.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    white-space: nowrap;
    font-size: 0.82rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    position: relative;
}

.tab-btn i {
    font-size: 1.15rem;
    opacity: 0.8;
}

.tab-btn:hover {
    background: #f8fafc;
    color: #334155;
}

.tab-btn.active {
    background: #eff6ff;
    color: #2563eb;
    border: 2px solid #2563eb;
    box-shadow: none;
    transform: none;
}

.tab-btn.active i {
    color: #2563eb;
    opacity: 1;
}

/* Badge in Tabs */
.badge-notify {
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 50px;
    margin-left: 4px;
}

/* ELITE NOTIFICATION BADGE (Global) */
.badge-elite {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    /* Standard Danger Red */
    color: white;
    font-size: 0.65rem;
    font-weight: 950;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
    z-index: 10;
    animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.header-icon-btn {
    position: relative;
    display: inline-flex;
}

/* === ELITE TABLE STYLES === */
.elite-table-wrap {
    background: #ffffff;
    border-radius: 24px;
    padding: 10px 20px 20px 20px;
}

.elite-table {
    border-collapse: collapse;
}

.elite-table th {
    background: transparent !important;
    border: none !important;
    color: #475569 !important;
    font-weight: 800 !important;
    font-size: 0.8rem;
    padding: 24px 20px 16px 20px !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.elite-table td {
    border: none !important;
}

/* === ELITE MODAL HEADER === */
.elite-modal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #334155;
}

.elite-modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.elite-modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.elite-modal-close-btn:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}