:root {
    --primary: #1c355e;
    --accent: #ffd700;
    --bg: #f4f7fa;
    --text: #2d3748;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    margin: 0 auto;
    max-width: 480px;
    color: var(--text);
    position: relative;
    padding-bottom: 75px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    min-height: 100vh;
}

html {
    scroll-behavior: smooth;
    background: #e2e8f0;
}

.app-bar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.install-nav-btn {
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.2);
    transition: 0.3s;
}

.install-nav-btn:active {
    transform: scale(0.9);
}

.hidden-install {
    display: none !important;
}

.app-bar {
    background: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo-h {
    height: 35px;
    border-radius: 50%;
    border: 1px solid var(--accent);
}

.hero-section {
    position: relative;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--primary);
}

.hero-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    filter: brightness(0.7);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo-circle {
    width: 65px;
    height: 65px;
    background: #fff;
    border-radius: 50%;
    padding: 3px;
    margin-bottom: 8px;
    border: 2px solid var(--accent);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hero-title {
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.h-stat-pill {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    padding: 5px 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    min-width: 90px;
}

.h-stat-pill b {
    font-size: 18px;
    color: var(--accent);
    line-height: 1.1;
}

.h-stat-pill span {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.9;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.a-item {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.a-icon {
    width: 50px;
    height: 50px;
    background: #fafafa;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #edf2f7;
    transition: 0.2s;
}

.a-item:active .a-icon {
    transform: scale(0.95);
}

.a-item span {
    font-size: 10px;
    font-weight: 900;
    color: var(--primary);
}

.sec-header {
    padding: 15px 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sec-header h2 {
    font-size: 14px;
    font-weight: 900;
    color: var(--primary);
    border-right: 4px solid var(--accent);
    padding-right: 8px;
    margin: 0;
}

.proj-slider {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 20px 15px;
    scrollbar-width: none;
    snap-type: x mandatory;
}

.proj-slider::-webkit-scrollbar {
    display: none;
}

.p-card {
    min-width: 220px;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    snap-align: center;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.p-imgs {
    display: flex;
    height: 110px;
    position: relative;
    background: #eee;
}

.p-imgs img {
    width: 50%;
    height: 100%;
    object-fit: cover;
}

.p-imgs::after {
    content: 'قبل / بعد';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(28, 53, 94, 0.8);
    color: #fff;
    font-size: 8px;
    padding: 3px 12px;
    border-radius: 12px;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.p-info {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 900;
    color: var(--primary);
    background: #fafafa;
    border-top: 1px solid #eee;
}

.marquee {
    background: #fff;
    padding: 12px 0;
    overflow: hidden;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.m-track {
    display: flex;
    width: max-content;
    gap: 15px;
    animation: scroll 30s linear infinite;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

.sup-pill {
    background: #f8fafc;
    padding: 6px 15px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    color: var(--text);
    transition: 0.3s;
}

.sup-pill img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: contain;
}

.main-footer {
    background: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    border-radius: 25px 25px 0 0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.02);
}

.f-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.f-brand img {
    height: 40px;
    border-radius: 8px;
}

.f-text {
    font-size: 9px;
    font-weight: 800;
    color: #718096;
    line-height: 1.5;
}

.f-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 900;
}

.f-socials {
    display: flex;
    gap: 10px;
}

.f-socials a {
    width: 35px;
    height: 35px;
    background: #f4f6f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
    text-decoration: none;
    border: 1px solid #edf2f7;
    transition: 0.3s;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    height: 75px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.n-link {
    text-decoration: none;
    color: #a0aec0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
}

.n-link.active {
    color: var(--primary);
}

.n-link i {
    font-size: 22px;
    margin-bottom: 4px;
}

.c-btn i {
    font-size: 50px;
    color: var(--primary);
    background: var(--accent);
    border-radius: 50%;
    padding: 2px;
    border: 4px solid #fff;
    margin-top: -35px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

/* إصلاح أيقونات FontAwesome على iOS Safari وجميع المتصفحات */
.fa, .fas, .fa-solid {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
}
.fab, .fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
}
.far, .fa-regular {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
}

/* النافذة - مخفية بشكل كامل عند البداية */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 15px;
}

.modal.show-modal {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 25px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    color: var(--primary);
    font-weight: 900;
    font-size: 16px;
    margin: 0;
}

.top-actions {
    display: flex;
    gap: 10px;
}

.icon-btn-submit,
.icon-btn-close {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

.icon-btn-submit {
    background: var(--primary);
    color: #fff;
}

.icon-btn-close {
    background: #fee2e2;
    color: #e53e3e;
}

.f-group {
    margin-bottom: 10px;
}

.f-group label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.f-control {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    background: #f8fafc;
}

.f-row {
    display: flex;
    gap: 10px;
}

.f-col {
    flex: 1;
}

/* إجبار الخريطة على أبعاد ثابتة لا تتأثر بحجم الشاشة */
#map {
    width: 100% !important;
    height: 250px !important;
    min-height: 250px !important;
    border-radius: 10px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    z-index: 1;
    display: block !important;
    position: relative;
    background-color: #e5e5e5;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 900;
    margin-top: 10px;
    cursor: pointer;
}

.btn-cancel {
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    color: #e53e3e;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.alert {
    padding: 10px;
    border-radius: 10px;
    font-size: 12px;
    margin: 15px 20px 0;
    text-align: center;
    font-weight: 800;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* نافذة تثبيت الـ iOS */
#ios-install-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 3000;
    align-items: flex-end;
    justify-content: center;
}
#ios-install-modal.active { display: flex; }
.ios-modal-content {
    background: #fff;
    width: 100%;
    max-width: 480px;
    padding: 25px 20px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    position: relative;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.ios-close { position: absolute; top: 15px; left: 15px; font-size: 20px; color: #888; cursor: pointer; }

/* تحذير GPS */
#gps-warning {
    display: none;
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
    border: 1px solid #ffcdd2;
}