:root {
    --primary: #0d6efd;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #212529;
}

* {
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background: #f5f7fa;
    padding-top: 100px;
    direction: rtl;
    margin: 0;
    min-height: 100vh;
}

/* Header */
.master-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #212529;
    color: var(--light);
    transition: background .25s;
    will-change: transform;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.master-header.scrolled {
    background: rgba(33,37,41,0.98);
    backdrop-filter: blur(6px);
}

.top-strip {
    background: rgba(0,0,0,0.25);
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.85rem;
}

.top-strip-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-links a {
    color: var(--light);
    text-decoration: none;
    margin-left: 16px;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.top-links a:hover {
    color: var(--warning);
    text-decoration: none;
}

.live-stats {
    display: flex;
    gap: 18px;
}

.stat-item {
    display: flex;
    align-items: center;
    color: var(--light);
    font-size: .85rem;
}

.stat-item i {
    margin-left: 6px;
    color: var(--warning);
}

.main-navbar {
    padding: 10px 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--light);
    text-decoration: none;
    font-size: 1.5rem;
}

.navbar-brand img {
    height: 44px;
    margin-left: 10px;
    border-radius: 6px;
    object-fit: contain;
}

.nav-link {
    color: var(--light) !important;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 20px;
    transition: all 0.3s ease;
    margin: 0 2px;
}

.nav-link:hover {
    color: var(--warning) !important;
    background: rgba(255,255,255,0.03);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--warning) !important;
    background: rgba(255,193,7,0.08);
}

.dropdown-menu {
    background: #26292b;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
    padding: 10px 0;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.dropdown-item {
    color: var(--light);
    padding: 10px 16px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--warning);
    transform: translateX(-5px);
}

.search-container {
    max-width: 380px;
    margin-right: 18px;
}

.search-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 50px;
    color: var(--light);
    padding: 10px 44px 10px 16px;
    width: 100%;
    transition: all 0.3s ease;
}

.search-input:focus {
    background: rgba(255,255,255,0.1);
    border-color: var(--warning);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,193,7,0.1);
}

.search-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.search-btn {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--warning);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #e0a800;
    transform: translateY(-50%) scale(1.05);
}

.navbar-toggler {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 6px 8px;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    border-color: var(--warning);
    background: rgba(255,193,7,0.1);
}

.bottom-nav {
    background: rgba(0,0,0,0.35);
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.03);
}

.quick-access {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.quick-link {
    color: var(--light);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quick-link:hover {
    color: var(--warning);
    text-decoration: none;
    transform: translateY(-2px);
}

.quick-link.active {
    color: var(--warning);
    background: rgba(255,193,7,0.08);
}

.new-badge {
    background: #ff4b2b;
    color: #fff;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: .7rem;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Mobile bottom nav */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -6px 18px rgba(0,0,0,0.06);
    border-top: 1px solid rgba(0,0,0,0.04);
    z-index: 1100;
    padding: 6px 10px;
    backdrop-filter: blur(10px);
}

.mobile-bottom-nav .d-flex {
    gap: 6px;
}

.mobile-bottom-nav .mobile-link {
    flex: 1;
    color: #2b2b2b;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all .18s ease;
    font-weight: 600;
    background: transparent;
}

.mobile-bottom-nav .mobile-link i {
    display: block;
    font-size: 20px;
    color: inherit;
    transition: all 0.3s ease;
}

.mobile-bottom-nav .mobile-link .small {
    font-size: 0.72rem;
    color: inherit;
    transition: all 0.3s ease;
}

.mobile-bottom-nav .mobile-link.active {
    color: var(--warning);
    background: rgba(255,193,7,0.08);
    box-shadow: 0 4px 10px rgba(255,193,7,0.08);
}

.mobile-bottom-nav .mobile-link:active {
    transform: translateY(1px) scale(0.95);
}

.mobile-bottom-nav .mobile-link:not(.active) {
    background: rgba(0,0,0,0.02);
}

.mobile-bottom-nav .mobile-link:not(.active):hover {
    background: rgba(0,0,0,0.05);
    color: #000;
}

/* Offcanvas mobile styles */
.offcanvas {
    background: #212529 !important;
    color: #fff !important;
}

.offcanvas .nav-link {
    color: rgba(255,255,255,0.92) !important;
    border-radius: 8px;
    margin: 2px 0;
}

.offcanvas .nav-link.active {
    color: var(--warning) !important;
    background: rgba(255,193,7,0.08) !important;
}

.offcanvas .dropdown-item {
    color: rgba(255,255,255,0.9) !important;
}

.offcanvas .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.offcanvas .btn-close:hover {
    opacity: 1;
}

.search-input-mobile {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: #fff;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.search-input-mobile:focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--warning);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(255,193,7,0.1);
}

.search-input-mobile::placeholder {
    color: rgba(255,255,255,0.6);
}

/* Simple fade-in animation */
.fade-in {
    animation: fadeIn .6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile adjustments */
@media (max-width: 991.98px) {
    body {
        padding-top: 80px;
        padding-bottom: 80px;
    }
    .top-strip {
        display: none;
    }
    .bottom-nav {
        display: none;
    }
    .search-container {
        margin: 12px 0;
        max-width: 100%;
    }
    .navbar-brand span {
        font-size: 1.3rem;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand span {
        font-size: 1.2rem;
    }
    .navbar-brand img {
        height: 36px;
    }
    .live-stats {
        gap: 10px;
    }
    .stat-item {
        font-size: .8rem;
    }
    .mobile-bottom-nav {
        padding: 4px 8px;
    }
    .mobile-bottom-nav .mobile-link {
        padding: 4px 6px;
    }
    .mobile-bottom-nav .mobile-link i {
        font-size: 18px;
    }
    .mobile-bottom-nav .mobile-link .small {
        font-size: 0.65rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for accessibility */
a:focus, button:focus, input:focus {
    outline: 2px solid var(--warning);
    outline-offset: 2px;
}