/* ========================================
   Global Reset & Base Styles
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body, #app {
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    color: var(--text);
    background: linear-gradient(180deg, var(--bg), var(--bg-alt));
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    overscroll-behavior: none;
}

button, input, select, textarea {
    font-family: inherit;
}

a { text-decoration: none; color: inherit; }

img { max-width: 100%; height: auto; }

/* ========================================
   Scrollbar Styling
   ======================================== */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c3cfdc; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #a9b9c9; }
::-webkit-scrollbar-track { background: transparent; }

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

.page-title {
    color: var(--navy-dark);
    margin: 0 0 var(--space-lg);
    font-size: var(--font-size-2xl);
    font-weight: 800;
    position: relative;
    padding-right: 14px;
}

.page-title::before {
    content: "";
    position: absolute;
    right: 0;
    top: 6px;
    bottom: 6px;
    width: 5px;
    border-radius: 4px;
    background: var(--gradient-gold);
}

.text-muted { color: var(--muted); font-size: var(--font-size-sm); }
.text-center { text-align: center; }

/* ========================================
   Layout: Mobile Shell
   ======================================== */
.mobile-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* Top Bar */
.mobile-topbar {
    background: var(--gradient-navy);
    color: #fff;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(16, 42, 67, 0.25);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-logo {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 10px;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    overflow: hidden;
}

.topbar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.topbar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.topbar-text b { font-size: 0.98rem; letter-spacing: 0.2px; }
.topbar-text small { font-size: 0.66rem; opacity: 0.85; font-weight: 400; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-chip {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    border-radius: var(--radius-full);
    padding: 6px 12px;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background var(--transition-base), transform var(--transition-fast);
}

.topbar-chip:hover { background: rgba(255,255,255,0.25); }
.topbar-chip:active { transform: scale(0.95); }

/* Main Content Area */
.mobile-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 20px;
    -webkit-overflow-scrolling: touch;
}

.mobile-content > div {
    max-width: 1020px;
    margin: 0 auto;
}

/* Bottom Navigation - Professional Vector Tabs */
.mobile-bottomnav {
    display: flex;
    background: #ffffff;
    box-shadow: 0 -4px 24px rgba(16, 42, 67, 0.08);
    flex-shrink: 0;
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    gap: 4px;
    align-items: center;
    border-top: 1px solid var(--border);
    user-select: none;
}

.mobile-bottomnav button {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 1px solid transparent;
    font-family: inherit;
    padding: 6px 2px 7px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    border-radius: 10px;
    margin: 0;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.2px;
}

.nav-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.9;
    fill: none;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.2s ease;
    flex-shrink: 0;
}

.mobile-bottomnav button:hover {
    color: #1a3a5c;
    background: rgba(26, 58, 92, 0.05);
}

.mobile-bottomnav button:hover .nav-svg {
    transform: translateY(-1px);
}

.mobile-bottomnav button:active { 
    transform: scale(0.93); 
}

.mobile-bottomnav button.active {
    background: #eef4fb;
    color: #1a3a5c !important;
    border-color: #dbe7f5;
    font-weight: 700;
}

.mobile-bottomnav button.active .nav-svg {
    transform: scale(1.1);
    stroke-width: 2.2;
}

.mobile-bottomnav button > span {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.15;
}

/* ========================================
   Global Loading Bar
   ======================================== */
.global-loading {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: rgba(26, 90, 156, 0.15);
    z-index: var(--z-loading);
    overflow: hidden;
    pointer-events: none;
}

.global-loading-bar {
    position: absolute;
    top: 0;
    height: 100%;
    width: 35%;
    border-radius: 3px;
    background: var(--gradient-gold);
    animation: loading-slide 1s ease-in-out infinite;
}

@keyframes loading-slide {
    0% { right: 100%; }
    50% { right: -35%; }
    100% { right: 100%; }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 700px) {
    .mobile-content { padding: 14px 14px 10px !important; }
    .page-title { font-size: var(--font-size-xl); margin: 4px 0 10px; }
}

@media (max-width: 480px) {
    .mobile-bottomnav { padding: 6px 4px; gap: 4px; }
    .mobile-bottomnav button { padding: 8px 2px; font-size: 0.75rem; }
}

@media (max-width: 380px) {
    .mobile-bottomnav button { font-size: 0.7rem; padding: 7px 1px; }
}
