@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Cairo:wght@400;600;700;800&display=swap');

:root {
    /* --- The Obsidian Premium Palette (Dark Default) --- */
    --primary: #6a429b;
    --primary-glow: rgba(106, 66, 155, 0.4);
    --secondary: #a36cfd;
    --accent: #00f2ff;

    /* Dynamic Backgrounds */
    --bg-main: #06040d;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-glass: rgba(15, 12, 28, 0.7);
    --bg-bottom: rgba(20, 15, 35, 0.8);

    /* Borders & Glass */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-bright: rgba(255, 255, 255, 0.15);

    /* Text */
    --text-pure: #ffffff;
    --text-body: #b0aec2;
    --text-muted: #6e6b85;

    /* Effects */
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.5);
    --blur: blur(25px);
    --mesh-opacity: 0.15;

    /* Category Accent Colors */
    --c-medical: #ff4d6d;
    --c-edu: #4361ee;
    --c-food: #fb8500;
    --c-biz: #2ec4b6;
    --c-roads: #ffb703;
}

/* --- Light Mode Overrides --- */
body.light-theme {
    --bg-main: #f0f2f9;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-bottom: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(106, 66, 155, 0.1);
    --glass-border-bright: rgba(106, 66, 155, 0.2);
    --text-pure: #1a1625;
    --text-body: #4a455a;
    --text-muted: #7a758a;
    --shadow-premium: 0 15px 40px rgba(106, 66, 155, 0.08);
    --mesh-opacity: 0.06;
}

/* --- Core Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Cairo', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-pure);
    direction: rtl;
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: 90px;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* --- Cinematic Mesh Background --- */
.mesh-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    background: var(--bg-main);
    overflow: hidden;
}

.mesh-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: var(--mesh-opacity);
    animation: mesh-move 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
    transition: opacity 0.5s ease;
}

.mesh-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    left: -100px;
}

.mesh-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

.mesh-3 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: 30%;
    left: 50%;
    opacity: 0.08;
    animation-duration: 30s;
}

@keyframes mesh-move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}

/* --- Common Containers --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- NEW WORLD CLASS HEADER --- */
.app-header {
    padding: 30px 0;
    position: relative;
    z-index: 100;
}

.nav-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 40px;
}

.logo-wrap {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.auth-btns {
    grid-column: 1;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.logo-box {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-box img {
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.brand-text h1 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text-pure), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.auth-btns {
    display: flex;
    gap: 12px;
}

.btn-glass {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-pure);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border-bright);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary);
    border: none;
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* --- Hero & Search --- */
.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px;
}

.hero-content h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-content p {
    color: var(--text-body);
    font-size: 1.1rem;
    font-weight: 500;
}

.search-container {
    max-width: 700px;
    margin: 40px auto;
    position: relative;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    padding: 8px 10px;
    border-radius: 20px;
    backdrop-filter: var(--blur);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

.search-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    transform: translateY(-2px);
}

.search-input-wrap i {
    padding: 0 15px;
    color: var(--primary);
    font-size: 1.2rem;
}

.search-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-pure);
    font-size: 1rem;
    padding: 12px 0;
    font-weight: 500;
}

/* --- Global Search Results Overlay --- */
.search-container {
    position: relative;
    width: 100%;
}

.search-results-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 12px;
    background: var(--bg-glass);
    backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border-bright);
    border-radius: 24px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    max-height: 480px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    padding: 12px;
    animation: searchReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.search-results-overlay.active {
    display: flex;
}

@keyframes searchReveal {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    border-radius: 18px;
    text-decoration: none;
    transition: var(--transition);
    margin-bottom: 6px;
    border: 1px solid transparent;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border-bright);
    transform: translateX(-5px);
}

.res-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-pure);
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.res-info {
    flex: 1;
}

.res-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-pure);
    margin-bottom: 2px;
}

.res-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.res-arrow {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.4;
    transition: 0.3s;
}

.search-result-item:hover .res-arrow {
    opacity: 1;
    transform: translateX(-5px);
    color: var(--primary);
}

/* Category Colors for Search Results */
.cat-medical .res-icon {
    background: linear-gradient(135deg, #ff4d6d, #c9184a);
}

.cat-food .res-icon {
    background: linear-gradient(135deg, #fb8500, #ffb703);
}

.cat-biz .res-icon {
    background: linear-gradient(135deg, #2ec4b6, #00f2ff);
}

.cat-roads .res-icon {
    background: linear-gradient(135deg, #ffb703, #fb8500);
}

.cat-transport .res-icon {
    background: linear-gradient(135deg, #48cae4, #0077b6);
}

.search-no-results {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.search-no-results i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.2;
}

.search-no-results p {
    font-weight: 800;
    color: var(--text-pure);
}

.search-more-hint {
    text-align: center;
    padding: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    border-top: 1px solid var(--glass-border);
    margin-top: 8px;
}

/* Light Theme Support */
body.light-theme .search-results-overlay {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(106, 66, 155, 0.1);
    box-shadow: 0 40px 100px rgba(106, 66, 155, 0.1);
}

body.active .search-results-overlay {
    backdrop-filter: blur(10px);
}

.categories-label {
    margin-bottom: 25px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-pure);
    display: flex;
    align-items: center;
    gap: 10px;
}

.categories-label::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 60px;
}

@media (max-width: 900px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px 10px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.cat-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-pure);
    transition: var(--transition);
}

.cat-name {
    color: var(--text-pure);
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0.9;
}

.cat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border-bright);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.cat-card:hover .cat-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Category Accent Styles */
.cat-medical .cat-icon {
    background: linear-gradient(135deg, #ff4d6d, #c9184a);
    box-shadow: 0 8px 15px rgba(255, 77, 109, 0.3);
}

.cat-edu .cat-icon {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    box-shadow: 0 8px 15px rgba(67, 97, 238, 0.3);
}

.cat-food .cat-icon {
    background: linear-gradient(135deg, #fb8500, #ffb703);
    box-shadow: 0 8px 15px rgba(251, 133, 0, 0.3);
}

.cat-biz .cat-icon {
    background: linear-gradient(135deg, #2ec4b6, #00f2ff);
    box-shadow: 0 8px 15px rgba(46, 196, 182, 0.3);
}

.cat-roads .cat-icon {
    background: linear-gradient(135deg, #ffb703, #fb8500);
    box-shadow: 0 8px 15px rgba(255, 183, 3, 0.3);
}

.cat-tourism .cat-icon {
    background: linear-gradient(135deg, #06d6a0, #00f5d4);
    box-shadow: 0 8px 15px rgba(6, 214, 160, 0.3);
}

.cat-real .cat-icon {
    background: linear-gradient(135deg, #ee9b00, #bb3e03);
    box-shadow: 0 8px 15px rgba(238, 155, 0, 0.3);
}

.cat-weather .cat-icon {
    background: linear-gradient(135deg, #48cae4, #0077b6);
    box-shadow: 0 8px 15px rgba(72, 202, 228, 0.3);
}

/* --- Section Horizontal Scroll --- */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-head h3 {
    font-size: 1.3rem;
    font-weight: 800;
}

.view-all {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: 0.3s;
}

.view-all:hover {
    color: var(--text-pure);
}

/* Background Dimming when search is active */
body.search-active .container>*:not(.app-header) {
    filter: blur(10px) brightness(0.5);
    pointer-events: none;
}

body.search-active .hero-content {
    opacity: 0.3;
    pointer-events: none;
}

.horizontal-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: none;
}

.horizontal-grid::-webkit-scrollbar {
    display: none;
}

.service-item {
    min-width: 140px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 15px;
    text-align: center;
    transition: var(--transition);
}

.service-item img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    margin-bottom: 10px;
}

.service-item span {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
}

/* --- BOTTOM NAV GLASS --- */
.bottom-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 500px;
    height: 70px;
    background: var(--bg-bottom);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border-bright);
    border-radius: 24px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 700;
    font-size: 0.75rem;
}

.nav-link i {
    font-size: 1.3rem;
}

.nav-link.active {
    color: #fff;
}

.nav-link.active i {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary));
}

.center-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    margin-top: -35px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 10px 25px var(--primary-glow);
    border: 3px solid #06040d;
}

/* --- ANIMATIONS --- */
.animate-in {
    animation: fadeUp 0.8s forwards cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RESPONSIVE --- */
@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .hero-content h2 {
        font-size: 4rem;
    }
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* --- GLOBAL PREMIUM COMPONENTS --- */
.premium-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.premium-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-premium);
}

.card-main {
    display: flex;
    gap: 15px;
    align-items: center;
}

.card-img {
    width: 65px;
    height: 65px;
    background: var(--bg-card);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.card-details {
    flex: 1;
}

.card-details h4 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-pure);
}

.card-details span {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.info-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.info-meta div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-action {
    flex: 1;
    padding: 14px;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-call {
    background: rgba(106, 66, 155, 0.1);
    color: var(--primary);
    border-color: rgba(106, 66, 155, 0.2);
}

.btn-call:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

.btn-nav {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px var(--primary-glow);
    filter: brightness(1.1);
}