/* ============================================================
   SAFR APP - STYLES.CSS
   كل تنسيقات التطبيق
   ============================================================ */

/* ============================================================
   1. ROOT VARIABLES
   ============================================================ */
:root{
  --primary:#0B3D91;
  --primary-light:#1E5BC6;
  --primary-dark:#071E4A;
  --gold:#D4AF37;
  --gold-light:#F1C94A;
  --bg:#F5F7FB;
  --text:#0F172A;
  --muted:#64748B;
  --card:#FFFFFF;
  --border:#E8EDF5;
  --green:#10B981;
  --red:#EF4444;
  --shadow-sm:0 2px 8px rgba(11,61,145,.06);
  --shadow:0 8px 24px rgba(11,61,145,.08);
  --shadow-lg:0 16px 40px rgba(11,61,145,.12);
}

/* ============================================================
   2. GLOBAL RESET
   ============================================================ */
*{
  box-sizing:border-box;
  margin:0;
  padding:0;
  -webkit-tap-highlight-color:transparent;
}
html,body{
  height:100%;
  overflow-x:hidden;
}
body{
  font-family:'Cairo',sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}

/* ============================================================
   3. SPLASH SCREEN
   ============================================================ */
#splash{
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:linear-gradient(160deg,#071E4A 0%,#0B3D91 40%,#1E5BC6 75%,#3B82F6 100%);
  transition:opacity .8s ease, visibility .8s ease;
}
#splash.hide{
  opacity:0;
  visibility:hidden;
}

.stars{
  position:absolute;
  inset:0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 60% 20%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,.5), transparent),
    radial-gradient(2px 2px at 35% 75%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 75% 85%, rgba(255,255,255,.6), transparent);
  animation:twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle{
  from{opacity:.6}
  to{opacity:1}
}

.splash-content{
  position:relative;
  z-index:10;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:20px;
  text-align:center;
}

.logo-container{
  position:relative;
  margin-bottom:28px;
  animation:zoomIn 1.2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes zoomIn{
  0%{transform:scale(.2) rotate(-180deg);opacity:0}
  100%{transform:scale(1) rotate(0);opacity:1}
}

.logo-ring{
  position:absolute;
  inset:-25px;
  border:2px dashed rgba(212,175,55,.5);
  border-radius:50%;
  animation:rotate 20s linear infinite;
}
.logo-ring.ring2{
  inset:-45px;
  border-style:solid;
  border-color:rgba(212,175,55,.2);
  animation:rotate 30s linear infinite reverse;
}
@keyframes rotate{
  to{transform:rotate(360deg)}
}

.logo-circle{
  width:140px;
  height:140px;
  border-radius:50%;
  background:linear-gradient(135deg,#FFFFFF 0%,#F1F5F9 100%);
  display:grid;
  place-items:center;
  box-shadow:0 0 0 8px rgba(255,255,255,.15),0 0 60px rgba(212,175,55,.6);
}
.logo-circle svg{
  width:80px;
  height:80px;
}

.app-name{
  font-size:52px;
  font-weight:900;
  letter-spacing:6px;
  background:linear-gradient(135deg,#FFFFFF 0%,#F1C94A 50%,#D4AF37 100%);
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
  margin-bottom:6px;
  animation:slideUp 1s ease .3s backwards;
}
@keyframes slideUp{
  from{opacity:0;transform:translateY(30px)}
  to{opacity:1;transform:none}
}

.tagline{
  font-size:15px;
  font-weight:600;
  color:rgba(255,255,255,.9);
  max-width:340px;
  line-height:1.7;
  animation:slideUp 1s ease .5s backwards;
  margin-top:16px;
}
.tagline strong{color:#F1C94A}

.loader-wrap{
  margin-top:50px;
  width:200px;
  animation:slideUp 1s ease .8s backwards;
}
.loader{
  width:100%;
  height:4px;
  background:rgba(255,255,255,.15);
  border-radius:99px;
  overflow:hidden;
}
.loader::after{
  content:'';
  display:block;
  height:100%;
  width:40%;
  background:linear-gradient(90deg,#D4AF37,#F1C94A,#D4AF37);
  border-radius:99px;
  animation:load 1.6s infinite ease-in-out;
}
@keyframes load{
  0%{margin-right:-40%}
  100%{margin-right:100%}
}

/* ============================================================
   4. APP SHELL & PAGES
   ============================================================ */
#app{
  display:none;
  min-height:100vh;
  padding-bottom:calc(80px + env(safe-area-inset-bottom));
  opacity:0;
  transition:opacity .5s ease;
}
#app.show{
  display:block;
  opacity:1;
}

.page{display:none}
.page.active{
  display:block;
  animation:fadePage .3s ease;
}
@keyframes fadePage{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:none}
}

/* ============================================================
   5. HEADERS
   ============================================================ */
.app-header{
  background:linear-gradient(160deg,var(--primary-dark) 0%,var(--primary) 50%,var(--primary-light) 100%);
  color:#fff;
  padding:20px 20px 30px;
  border-radius:0 0 28px 28px;
  position:relative;
  overflow:hidden;
}
.app-header::before{
  content:'';
  position:absolute;
  top:-60px;
  left:-60px;
  width:200px;
  height:200px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(212,175,55,.2) 0%,transparent 70%);
}

.header-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px;
  position:relative;
  z-index:2;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand-logo{
  width:38px;
  height:38px;
  border-radius:12px;
  background:linear-gradient(135deg,var(--gold),var(--gold-light));
  display:grid;
  place-items:center;
  box-shadow:0 6px 16px rgba(212,175,55,.4);
}
.brand-logo svg{
  width:22px;
  height:22px;
  stroke:#fff;
  fill:none;
  stroke-width:2.2;
}
.brand-text{
  font-size:20px;
  font-weight:900;
  letter-spacing:1px;
}

.icon-btn{
  width:40px;
  height:40px;
  border-radius:12px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.15);
  display:grid;
  place-items:center;
  cursor:pointer;
  backdrop-filter:blur(10px);
  position:relative;
}
.icon-btn svg{
  width:20px;
  height:20px;
  stroke:#fff;
  fill:none;
  stroke-width:2;
}
.icon-btn .dot{
  position:absolute;
  top:9px;
  left:9px;
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--gold-light);
  border:1.5px solid var(--primary);
}

.greeting{
  position:relative;
  z-index:2;
}
.greeting h1{
  font-size:24px;
  font-weight:800;
  margin-bottom:4px;
}
.greeting p{
  font-size:13px;
  opacity:.8;
  font-weight:500;
}
.greeting .highlight{
  color:var(--gold-light);
  font-weight:800;
}

/* ============================================================
   6. SEARCH BOX
   ============================================================ */
.search-container{
  margin:16px 20px 0;
  position:relative;
  z-index:5;
}
.search-box{
  background:#fff;
  border-radius:18px;
  padding:16px 18px;
  display:flex;
  align-items:center;
  gap:12px;
  box-shadow:var(--shadow-lg);
  border:1px solid var(--border);
  cursor:pointer;
}
.search-box svg{
  width:22px;
  height:22px;
  stroke:var(--primary);
  flex-shrink:0;
  fill:none;
  stroke-width:2.2;
}
.search-box input{
  border:none;
  outline:none;
  flex:1;
  font-family:inherit;
  font-size:15px;
  font-weight:600;
  background:transparent;
  color:var(--text);
  cursor:pointer;
}
.search-box input::placeholder{
  color:var(--muted);
  font-weight:500;
}

/* ============================================================
   7. SECTIONS
   ============================================================ */
.section{padding:26px 20px 0}
.section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
}
.section-head h3{
  font-size:18px;
  font-weight:800;
  display:flex;
  align-items:center;
  gap:8px;
}
.section-head h3 .emoji{font-size:20px}
.section-head a{
  color:var(--primary);
  font-size:13px;
  text-decoration:none;
  font-weight:700;
  padding:6px 12px;
  border-radius:99px;
  background:rgba(11,61,145,.06);
  cursor:pointer;
}

/* ============================================================
   8. SERVICES GRID
   ============================================================ */
.services-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}
.service-card{
  background:#fff;
  border-radius:18px;
  padding:16px;
  box-shadow:var(--shadow-sm);
  cursor:pointer;
  transition:.25s;
  border:1px solid var(--border);
  display:flex;
  flex-direction:column;
  gap:12px;
}
.service-card:active{transform:scale(.97)}
.service-card .ico{
  width:48px;
  height:48px;
  border-radius:14px;
  display:grid;
  place-items:center;
  box-shadow:0 6px 16px rgba(11,61,145,.15);
}
.service-card .ico svg{
  width:24px;
  height:24px;
  stroke:#fff;
  fill:none;
  stroke-width:2.2;
}
.c-blue{background:linear-gradient(135deg,#0B3D91,#1E5BC6)}
.c-gold{background:linear-gradient(135deg,#D4AF37,#F1C94A)}
.c-green{background:linear-gradient(135deg,#059669,#10B981)}
.c-red{background:linear-gradient(135deg,#DC2626,#EF4444)}
.c-purple{background:linear-gradient(135deg,#7C3AED,#A78BFA)}
.c-teal{background:linear-gradient(135deg,#0891B2,#22D3EE)}
.service-card h4{
  font-size:14px;
  font-weight:800;
  line-height:1.3;
}
.service-card p{
  font-size:11.5px;
  color:var(--muted);
  line-height:1.5;
  font-weight:500;
}

/* ============================================================
   9. EXPLORE HERO
   ============================================================ */
.explore-hero{
  background:linear-gradient(160deg,var(--primary-dark) 0%,var(--primary) 50%,var(--primary-light) 100%);
  color:#fff;
  padding:20px 20px 24px;
  border-radius:0 0 28px 28px;
  position:relative;
  overflow:hidden;
}
.explore-hero .header-top{
  margin-bottom:18px;
  position:relative;
  z-index:2;
}
.explore-hero h2{
  font-size:26px;
  font-weight:900;
  margin-bottom:6px;
  position:relative;
  z-index:2;
}
.explore-hero p{
  font-size:13px;
  opacity:.85;
  margin-bottom:18px;
  position:relative;
  z-index:2;
  font-weight:500;
}
.explore-search{
  background:rgba(255,255,255,.15);
  border:1px solid rgba(255,255,255,.2);
  border-radius:14px;
  padding:13px 16px;
  display:flex;
  align-items:center;
  gap:10px;
  backdrop-filter:blur(10px);
  position:relative;
  z-index:2;
}
.explore-search svg{
  width:20px;
  height:20px;
  stroke:#fff;
  fill:none;
  stroke-width:2.2;
  flex-shrink:0;
}
.explore-search input{
  border:none;
  outline:none;
  flex:1;
  font-family:inherit;
  font-size:14px;
  font-weight:600;
  background:transparent;
  color:#fff;
}
.explore-search input::placeholder{
  color:rgba(255,255,255,.6);
  font-weight:500;
}

/* ============================================================
   10. MAP
   ============================================================ */
.map-wrapper{
  margin:16px 20px 0;
  background:#fff;
  border-radius:22px;
  box-shadow:var(--shadow);
  border:1px solid var(--border);
  overflow:hidden;
  position:relative;
}
.map-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#fff,#FAFCFF);
}
.map-header h4{
  font-size:14px;
  font-weight:800;
  color:var(--text);
  display:flex;
  align-items:center;
  gap:6px;
}
.map-header h4 .live{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#10B981;
  box-shadow:0 0 0 3px rgba(16,185,129,.2);
  animation:livePulse 1.5s infinite;
}
@keyframes livePulse{
  0%,100%{box-shadow:0 0 0 3px rgba(16,185,129,.2)}
  50%{box-shadow:0 0 0 6px rgba(16,185,129,.1)}
}
.map-header .hint{
  font-size:11px;
  color:var(--muted);
  font-weight:600;
}

#realMap{
  width:100%;
  height:360px;
  z-index:1;
  background:#DCEEFB;
}

/* Custom marker */
.custom-marker{
  position:relative;
  width:36px;
  height:44px;
  cursor:pointer;
  transition:transform .15s ease;
}
.custom-marker:hover{
  transform:scale(1.15);
  z-index:9999 !important;
}
.custom-marker .marker-flag{
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:36px;
  height:36px;
  border-radius:50%;
  overflow:hidden;
  border:3px solid #fff;
  background:#fff;
  box-shadow:0 4px 12px rgba(0,0,0,.3), 0 0 0 1px rgba(0,0,0,.05);
  z-index:2;
}
.custom-marker .marker-flag img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.custom-marker .marker-pointer{
  position:absolute;
  bottom:0;
  left:50%;
  transform:translateX(-50%);
  width:0;
  height:0;
  border-left:7px solid transparent;
  border-right:7px solid transparent;
  border-top:10px solid #fff;
  filter:drop-shadow(0 3px 3px rgba(0,0,0,.25));
  z-index:1;
}
.custom-marker.favorite .marker-flag{
  border-color:var(--gold);
  box-shadow:0 4px 12px rgba(212,175,55,.5), 0 0 0 3px rgba(212,175,55,.3);
}
.custom-marker .marker-label{
  position:absolute;
  top:-28px;
  left:50%;
  transform:translateX(-50%);
  background:var(--primary);
  color:#fff;
  font-size:10px;
  font-weight:800;
  padding:4px 9px;
  border-radius:99px;
  white-space:nowrap;
  opacity:0;
  transition:.2s;
  pointer-events:none;
  font-family:'Cairo',sans-serif;
  box-shadow:0 4px 10px rgba(0,0,0,.2);
  z-index:5;
}
.custom-marker .marker-label::after{
  content:'';
  position:absolute;
  bottom:-4px;
  left:50%;
  transform:translateX(-50%);
  width:0;
  height:0;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:4px solid var(--primary);
}
.custom-marker:hover .marker-label{opacity:1}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper{
  border-radius:14px !important;
  box-shadow:0 10px 30px rgba(11,61,145,.25) !important;
  font-family:'Cairo',sans-serif !important;
  direction:rtl;
}
.leaflet-popup-content{
  margin:12px 14px !important;
  font-family:'Cairo',sans-serif !important;
  direction:rtl;
  text-align:right;
}
.leaflet-popup-tip{
  box-shadow:0 10px 30px rgba(11,61,145,.25) !important;
}
.popup-content h4{
  font-size:14px;
  font-weight:900;
  margin-bottom:6px;
  color:var(--primary);
  display:flex;
  align-items:center;
  gap:6px;
}
.popup-content .popup-flag{
  width:24px;
  height:16px;
  border-radius:3px;
  overflow:hidden;
  display:inline-block;
  vertical-align:middle;
  border:1px solid var(--border);
}
.popup-content .popup-flag img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.popup-content p{
  font-size:11px;
  color:var(--muted);
  font-weight:600;
  margin-bottom:8px;
}
.popup-content button{
  background:linear-gradient(135deg,var(--primary),var(--primary-light));
  color:#fff;
  border:none;
  padding:6px 14px;
  border-radius:8px;
  font-family:inherit;
  font-weight:800;
  font-size:11px;
  cursor:pointer;
}

/* Custom zoom controls */
.leaflet-control-zoom{
  border:none !important;
  box-shadow:0 4px 12px rgba(11,61,145,.15) !important;
  border-radius:10px !important;
  overflow:hidden;
}
.leaflet-control-zoom a{
  background:#fff !important;
  color:var(--primary) !important;
  width:34px !important;
  height:34px !important;
  line-height:34px !important;
  font-size:18px !important;
  font-weight:700 !important;
  border:none !important;
  border-bottom:1px solid var(--border) !important;
}
.leaflet-control-zoom a:last-child{border-bottom:none !important}
.leaflet-control-zoom a:hover{background:#F8FAFC !important}

/* ============================================================
   11. CONTINENT TABS
   ============================================================ */
.continent-tabs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:16px 20px 8px;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.continent-tabs::-webkit-scrollbar{display:none}

.cont-tab{
  flex:0 0 auto;
  padding:10px 18px;
  border-radius:99px;
  background:#fff;
  border:1.5px solid var(--border);
  font-family:inherit;
  font-size:13px;
  font-weight:700;
  color:var(--muted);
  cursor:pointer;
  transition:.2s;
  white-space:nowrap;
  display:flex;
  align-items:center;
  gap:6px;
}
.cont-tab.active{
  background:linear-gradient(135deg,var(--primary),var(--primary-light));
  color:#fff;
  border-color:transparent;
  box-shadow:0 6px 16px rgba(11,61,145,.25);
}
.cont-tab:active{transform:scale(.95)}
.cont-tab .count{
  background:rgba(0,0,0,.1);
  padding:1px 6px;
  border-radius:99px;
  font-size:10px;
  font-weight:800;
}
.cont-tab.active .count{background:rgba(255,255,255,.25)}

/* ============================================================
   12. CONTINENT SECTIONS
   ============================================================ */
.continent-section{padding:8px 20px 20px}

.continent-title{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:14px;
  padding:0 4px;
}
.continent-title .icon{
  width:36px;
  height:36px;
  border-radius:12px;
  background:linear-gradient(135deg,var(--primary),var(--primary-light));
  display:grid;
  place-items:center;
  color:#fff;
  font-size:18px;
}
.continent-title h3{
  font-size:17px;
  font-weight:900;
  color:var(--text);
}
.continent-title .num{
  font-size:12px;
  color:var(--muted);
  font-weight:600;
  background:#F1F5F9;
  padding:3px 10px;
  border-radius:99px;
}

/* ============================================================
   13. COUNTRIES GRID
   ============================================================ */
.countries-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}

.country-card{
  background:#fff;
  border-radius:18px;
  padding:14px 12px;
  cursor:pointer;
  transition:.25s;
  box-shadow:var(--shadow-sm);
  border:1px solid var(--border);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  position:relative;
  overflow:hidden;
}
.country-card:active{transform:scale(.97)}
.country-card::before{
  content:'';
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:3px;
  background:linear-gradient(90deg,var(--primary),var(--gold));
  opacity:0;
  transition:.25s;
}
.country-card:hover::before{opacity:1}

.country-card .flag-wrap{
  width:64px;
  height:48px;
  border-radius:8px;
  background:#FFFFFF;
  overflow:hidden;
  box-shadow:0 6px 16px rgba(11,61,145,.15), 0 0 0 1px #E8EDF5;
  flex-shrink:0;
}
.country-card .flag-wrap img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.country-card h4{
  font-size:14px;
  font-weight:800;
  color:var(--text);
  text-align:center;
  line-height:1.3;
}

.country-card .capital{
  font-size:11px;
  color:var(--muted);
  font-weight:600;
  text-align:center;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px;
}
.country-card .capital svg{
  width:11px;
  height:11px;
  stroke:var(--muted);
  fill:none;
  stroke-width:2;
}

.country-card .popular-badge{
  position:absolute;
  top:8px;
  right:8px;
  background:linear-gradient(135deg,var(--gold),var(--gold-light));
  color:#3B2F00;
  font-size:9px;
  font-weight:800;
  padding:3px 8px;
  border-radius:99px;
  box-shadow:0 3px 8px rgba(212,175,55,.4);
}

.country-card .fav-btn{
  position:absolute;
  top:8px;
  left:8px;
  width:28px;
  height:28px;
  border-radius:50%;
  background:rgba(255,255,255,.9);
  border:1px solid var(--border);
  display:grid;
  place-items:center;
  cursor:pointer;
  transition:.2s;
  z-index:3;
}
.country-card .fav-btn:active{transform:scale(.85)}
.country-card .fav-btn svg{
  width:14px;
  height:14px;
  stroke:var(--muted);
  fill:none;
  stroke-width:2.2;
  transition:.2s;
}
.country-card .fav-btn.active svg{
  fill:var(--gold);
  stroke:var(--gold);
}

/* ============================================================
   14. EMPTY STATE
   ============================================================ */
.empty-state{
  text-align:center;
  padding:60px 20px;
  color:var(--muted);
  grid-column:1/-1;
}
.empty-state svg{
  width:64px;
  height:64px;
  stroke:var(--muted);
  fill:none;
  stroke-width:1.5;
  margin-bottom:16px;
  opacity:.4;
}
.empty-state p{
  font-size:15px;
  font-weight:700;
}

/* ============================================================
   15. COMMUNITY PAGE
   ============================================================ */
.community-hero{
  background:linear-gradient(160deg,var(--primary-dark) 0%,var(--primary) 50%,var(--primary-light) 100%);
  color:#fff;
  padding:20px 20px 24px;
  border-radius:0 0 28px 28px;
  position:relative;
  overflow:hidden;
}
.community-hero h2{
  font-size:26px;
  font-weight:900;
  margin-bottom:6px;
  position:relative;
  z-index:2;
}
.community-hero p{
  font-size:13px;
  opacity:.85;
  margin-bottom:18px;
  position:relative;
  z-index:2;
  font-weight:500;
}
.community-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  position:relative;
  z-index:2;
}
.stat-card{
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.15);
  border-radius:14px;
  padding:12px 8px;
  text-align:center;
  backdrop-filter:blur(10px);
}
.stat-card .num{
  font-size:20px;
  font-weight:900;
  color:var(--gold-light);
  display:block;
  margin-bottom:2px;
}
.stat-card .lbl{
  font-size:10px;
  font-weight:600;
  color:rgba(255,255,255,.85);
}

.post-card{
  background:#fff;
  border-radius:18px;
  padding:16px;
  margin-bottom:12px;
  box-shadow:var(--shadow-sm);
  border:1px solid var(--border);
}
.post-head{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
}
.post-avatar{
  width:42px;
  height:42px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--primary),var(--primary-light));
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:800;
  font-size:16px;
  flex-shrink:0;
}
.post-user{flex:1}
.post-user h5{
  font-size:14px;
  font-weight:800;
  display:flex;
  align-items:center;
  gap:5px;
}
.post-user h5 .verified{
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--primary);
  display:grid;
  place-items:center;
}
.post-user h5 .verified svg{
  width:9px;
  height:9px;
  stroke:#fff;
  fill:none;
  stroke-width:3;
}
.post-user .meta{
  font-size:11px;
  color:var(--muted);
  font-weight:600;
  display:flex;
  align-items:center;
  gap:4px;
}
.post-user .meta .country-flag{
  width:14px;
  height:14px;
  border-radius:50%;
  overflow:hidden;
}
.post-user .meta .country-flag img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.post-content{
  font-size:14px;
  line-height:1.7;
  color:var(--text);
  margin-bottom:12px;
  font-weight:500;
}
.post-content .hashtag{
  color:var(--primary);
  font-weight:700;
}

.post-image{
  width:100%;
  height:180px;
  border-radius:14px;
  background:linear-gradient(135deg,#E8F1FB,#D6E4F5);
  margin-bottom:12px;
  display:grid;
  place-items:center;
  font-size:56px;
  overflow:hidden;
}

.post-actions{
  display:flex;
  gap:16px;
  padding-top:12px;
  border-top:1px solid var(--border);
}
.post-action{
  display:flex;
  align-items:center;
  gap:5px;
  background:none;
  border:none;
  font-family:inherit;
  font-size:12px;
  font-weight:700;
  color:var(--muted);
  cursor:pointer;
  transition:.2s;
  padding:4px 0;
}
.post-action:active{transform:scale(.95)}
.post-action svg{
  width:16px;
  height:16px;
  stroke:currentColor;
  fill:none;
  stroke-width:2.2;
}
.post-action.liked{color:var(--red)}
.post-action.liked svg{fill:var(--red);stroke:var(--red)}

/* ============================================================
   16. PROFILE PAGE
   ============================================================ */
.profile-hero{
  background:linear-gradient(160deg,var(--primary-dark) 0%,var(--primary) 50%,var(--primary-light) 100%);
  color:#fff;
  padding:20px 20px 70px;
  border-radius:0 0 28px 28px;
  position:relative;
  overflow:hidden;
  text-align:center;
}
.profile-hero::before{
  content:'';
  position:absolute;
  top:-60px;
  right:-60px;
  width:200px;
  height:200px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(212,175,55,.25) 0%,transparent 70%);
}
.profile-avatar{
  width:90px;
  height:90px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--gold),var(--gold-light));
  display:grid;
  place-items:center;
  margin:0 auto 14px;
  font-size:36px;
  font-weight:900;
  color:#fff;
  border:4px solid rgba(255,255,255,.2);
  box-shadow:0 10px 30px rgba(0,0,0,.3);
  position:relative;
  z-index:2;
}
.profile-hero h2{
  font-size:22px;
  font-weight:900;
  margin-bottom:4px;
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}
.profile-hero .badge-v{
  width:20px;
  height:20px;
  border-radius:50%;
  background:var(--gold);
  display:grid;
  place-items:center;
}
.profile-hero .badge-v svg{
  width:12px;
  height:12px;
  stroke:#fff;
  fill:none;
  stroke-width:3;
}
.profile-hero .email{
  font-size:13px;
  opacity:.85;
  position:relative;
  z-index:2;
  direction:ltr;
}
.profile-hero .member{
  font-size:11px;
  opacity:.7;
  position:relative;
  z-index:2;
  margin-top:6px;
  background:rgba(255,255,255,.12);
  display:inline-block;
  padding:4px 12px;
  border-radius:99px;
  border:1px solid rgba(255,255,255,.15);
}

.profile-stats{
  margin:-50px 20px 0;
  background:#fff;
  border-radius:20px;
  padding:18px;
  box-shadow:var(--shadow-lg);
  border:1px solid var(--border);
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  position:relative;
  z-index:5;
}
.profile-stat{
  text-align:center;
  padding:8px;
  border-left:1px solid var(--border);
}
.profile-stat:last-child{border-left:none}
.profile-stat .num{
  font-size:20px;
  font-weight:900;
  color:var(--primary);
  display:block;
  margin-bottom:2px;
}
.profile-stat .lbl{
  font-size:11px;
  color:var(--muted);
  font-weight:700;
}

.menu-list{
  background:#fff;
  border-radius:18px;
  overflow:hidden;
  box-shadow:var(--shadow-sm);
  border:1px solid var(--border);
  margin-top:8px;
}
.menu-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  cursor:pointer;
  transition:.2s;
  border-bottom:1px solid var(--border);
  background:none;
  border-left:none;
  border-right:none;
  border-top:none;
  font-family:inherit;
  width:100%;
  text-align:right;
}
.menu-item:last-child{border-bottom:none}
.menu-item:active{background:#F8FAFC}
.menu-item .menu-icon{
  width:38px;
  height:38px;
  border-radius:12px;
  display:grid;
  place-items:center;
  flex-shrink:0;
}
.menu-item .menu-icon svg{
  width:20px;
  height:20px;
  stroke:#fff;
  fill:none;
  stroke-width:2.2;
}
.menu-item .menu-text{flex:1}
.menu-item .menu-text h5{
  font-size:14px;
  font-weight:800;
  color:var(--text);
  margin-bottom:2px;
}
.menu-item .menu-text p{
  font-size:11px;
  color:var(--muted);
  font-weight:600;
}
.menu-item .arrow{
  width:16px;
  height:16px;
  stroke:var(--muted);
  fill:none;
  stroke-width:2.5;
  transform:rotate(180deg);
}

/* ============================================================
   17. COUNTRY DETAIL PAGE
   ============================================================ */
.detail-hero{
  position:relative;
  background:linear-gradient(160deg,var(--primary-dark) 0%,var(--primary) 60%,var(--primary-light) 100%);
  color:#fff;
  padding:20px 20px 80px;
  border-radius:0 0 28px 28px;
  overflow:hidden;
}
.detail-hero::before{
  content:'';
  position:absolute;
  top:-60px;
  left:-60px;
  width:220px;
  height:220px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(212,175,55,.25) 0%,transparent 70%);
}
.detail-hero .back-btn{
  width:38px;
  height:38px;
  border-radius:12px;
  background:rgba(255,255,255,.15);
  border:1px solid rgba(255,255,255,.2);
  display:grid;
  place-items:center;
  cursor:pointer;
  margin-bottom:20px;
  position:relative;
  z-index:2;
}
.detail-hero .back-btn svg{
  width:20px;
  height:20px;
  stroke:#fff;
  fill:none;
  stroke-width:2.5;
}
.detail-flag-wrap{
  width:100px;
  height:100px;
  border-radius:50%;
  overflow:hidden;
  border:4px solid #fff;
  box-shadow:0 10px 30px rgba(0,0,0,.3);
  margin:0 auto 14px;
  position:relative;
  z-index:2;
  background:#fff;
}
.detail-flag-wrap img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.detail-hero h1{
  font-size:28px;
  font-weight:900;
  text-align:center;
  margin-bottom:6px;
  position:relative;
  z-index:2;
}
.detail-hero .cont-label{
  text-align:center;
  font-size:13px;
  opacity:.85;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  position:relative;
  z-index:2;
}
.detail-hero .cont-label svg{
  width:14px;
  height:14px;
  stroke:#fff;
  fill:none;
  stroke-width:2;
}

/* --- تبويبات صفحة التفاصيل (Detail Tabs) --- */
.detail-tabs{
  display:flex;
  gap:6px;
  justify-content:center;      /* الأزرار في وسط الشريط بدل اليمين */
  justify-content:safe center; /* لو الأزرار كتير وطلعت بره الشريط، ترجع للبداية بدون قص */
  overflow-x:auto;
  padding:12px 20px;
  margin:0 20px 16px;          /* مسافة من الجانبين + تحت الشريط */
  background:#fff;
  border-radius:16px;
  box-shadow:0 4px 16px rgba(11,61,145,.08);
  position:relative;
  z-index:5;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.detail-tabs::-webkit-scrollbar{display:none}

.dtab{
  flex:0 0 auto;
  padding:10px 16px;
  border-radius:99px;
  background:#F1F5F9;
  border:1.5px solid transparent;
  font-family:inherit;
  font-size:13px;
  font-weight:700;
  color:var(--muted);
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:6px;
  transition:all .2s;
}
.dtab svg{
  width:16px;
  height:16px;
  stroke:currentColor;
  fill:none;
  stroke-width:2.2;
}
.dtab.active{
  background:linear-gradient(135deg,var(--primary),var(--primary-light));
  color:#fff;
  box-shadow:0 4px 12px rgba(11,61,145,.25);
}
.dtab.disabled{
  opacity:.5;
  cursor:not-allowed;
}

.tab-content{
  display:none;
  padding:16px 20px 20px;
}
.tab-content.active{display:block}

.empty-tab{
  text-align:center;
  padding:60px 20px;
  color:var(--muted);
}
.empty-tab .empty-icon{
  font-size:64px;
  margin-bottom:16px;
}
.empty-tab h4{
  font-size:16px;
  font-weight:800;
  color:var(--text);
  margin-bottom:8px;
}
.empty-tab p{font-size:13px}

/* --- تبويب السياحة: المدن والمعالم --- */
.city-card{
  background:#fff;
  border-radius:20px;
  margin-bottom:18px;
  overflow:hidden;
  box-shadow:var(--shadow);
  border:1px solid var(--border);
}
.city-card:last-child{margin-bottom:0}

.city-image{
  width:100%;
  aspect-ratio:16/9;
  overflow:hidden;
  background:#E8EDF5;
}
.city-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.city-head{padding:16px 18px 8px}
.city-name{
  font-size:18px;
  font-weight:800;
  color:var(--primary);
  margin-bottom:4px;
}
.city-desc{
  font-size:13px;
  color:var(--muted);
  line-height:1.6;
}

.landmark-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:4px 12px 14px;
}

.landmark-item{
  display:flex;
  gap:12px;
  padding:10px;
  border-radius:14px;
  background:#F8FAFC;
  border:1px solid var(--border);
}

.landmark-thumb{
  width:80px;
  height:80px;
  flex:0 0 80px;
  border-radius:12px;
  object-fit:cover;
  background:#E8EDF5;
}

.landmark-body{
  flex:1 1 auto;
  min-width:0;
}
.landmark-name{
  font-size:14px;
  font-weight:800;
  color:var(--text);
  margin-bottom:4px;
}

.landmark-address{
  display:flex;
  align-items:flex-start;
  gap:5px;
  font-size:11px;
  color:var(--muted);
  line-height:1.5;
  margin-bottom:6px;
}
.landmark-address svg{
  width:13px;
  height:13px;
  flex:0 0 13px;
  margin-top:1px;
  stroke:var(--muted);
  fill:none;
  stroke-width:2;
}
.landmark-address span{min-width:0}

.landmark-desc{
  font-size:12px;
  color:var(--text);
  line-height:1.6;
  margin-bottom:8px;
}

.landmark-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.lm-chip{
  font-size:11px;
  font-weight:700;
  padding:4px 9px;
  border-radius:99px;
  background:#EAF1FF;
  color:var(--primary);
  white-space:nowrap;
}


.detail-body{
  /* بقى داخل .tab-content (اللي بيوفر الحشو)، والتبويبات هي اللي بتتداخل مع الـ hero */
  margin:0;
  position:relative;
  z-index:5;
}
.detail-card{
  background:#fff;
  border-radius:20px;
  padding:20px;
  margin-bottom:14px;
  box-shadow:var(--shadow);
  border:1px solid var(--border);
}
.detail-card h5{
  font-size:14px;
  font-weight:800;
  margin-bottom:14px;
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--primary);
}
.detail-card h5 svg{
  width:18px;
  height:18px;
  stroke:var(--primary);
  fill:none;
  stroke-width:2.2;
}

.detail-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
}
.detail-info{
  background:#F8FAFC;
  border-radius:12px;
  padding:12px;
  border:1px solid var(--border);
}
.detail-info .lbl{
  font-size:11px;
  color:var(--muted);
  font-weight:600;
  margin-bottom:4px;
}
.detail-info .val{
  font-size:13px;
  font-weight:800;
  color:var(--text);
}

.detail-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.detail-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 0;
  border-bottom:1px solid var(--border);
  font-size:13px;
}
.detail-row:last-child{border-bottom:none}
.detail-row .lbl{
  color:var(--muted);
  font-weight:600;
}
.detail-row .val{
  font-weight:800;
  color:var(--text);
  text-align:left;
  direction:ltr;
}

.visa-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.visa-tag{
  padding:8px 16px;
  border-radius:99px;
  font-size:12px;
  font-weight:700;
  background:linear-gradient(135deg,rgba(11,61,145,.08),rgba(30,91,198,.08));
  color:var(--primary);
  border:1.5px solid rgba(11,61,145,.15);
}

.detail-actions{
  display:flex;
  gap:10px;
  margin-top:8px;
}
.detail-actions button{
  flex:1;
  padding:15px;
  border-radius:14px;
  border:none;
  font-family:inherit;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
  transition:.2s;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}
.detail-actions button svg{
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
  stroke-width:2.2;
}
.btn-primary{
  background:linear-gradient(135deg,var(--primary),var(--primary-light));
  color:#fff;
  box-shadow:0 8px 20px rgba(11,61,145,.3);
}
.btn-primary:active{transform:scale(.97)}
.btn-gold{
  background:linear-gradient(135deg,var(--gold),var(--gold-light));
  color:#3B2F00;
  box-shadow:0 8px 20px rgba(212,175,55,.3);
}
.btn-gold:active{transform:scale(.97)}

/* ============================================================
   18. BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  background:rgba(255,255,255,.98);
  backdrop-filter:blur(20px);
  border-top:1px solid var(--border);
  display:flex;
  justify-content:space-around;
  padding:8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index:100;
  box-shadow:0 -4px 20px rgba(11,61,145,.06);
}
.nav-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  cursor:pointer;
  padding:6px 16px;
  border-radius:14px;
  transition:.2s;
  background:none;
  border:none;
  font-family:inherit;
  position:relative;
}
.nav-btn svg{
  width:22px;
  height:22px;
  stroke:currentColor;
  fill:none;
  stroke-width:2.2;
  transition:.2s;
}
.nav-btn.active{color:var(--primary)}
.nav-btn.active svg{stroke:var(--primary)}
.nav-btn.active::after{
  content:'';
  position:absolute;
  top:-9px;
  left:50%;
  transform:translateX(-50%);
  width:24px;
  height:3px;
  border-radius:99px;
  background:linear-gradient(90deg,var(--gold),var(--gold-light));
}

/* ============================================================
   19. TOAST
   ============================================================ */
.toast{
  position:fixed;
  bottom:100px;
  left:50%;
  transform:translateX(-50%) translateY(100px);
  background:var(--primary);
  color:#fff;
  padding:12px 24px;
  border-radius:99px;
  font-size:13px;
  font-weight:700;
  box-shadow:0 10px 30px rgba(11,61,145,.3);
  z-index:9999;
  opacity:0;
  transition:.3s;
  pointer-events:none;
  white-space:nowrap;
}
.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

/* ============================================================
   20. RESPONSIVE
   ============================================================ */
@media(max-width:380px){
  .app-name{
    font-size:42px;
    letter-spacing:4px;
  }
  .logo-circle{
    width:110px;
    height:110px;
  }
  .logo-circle svg{
    width:60px;
    height:60px;
  }
  .countries-grid{gap:10px}
  .greeting h1{font-size:20px}
  .nav-btn{padding:6px 10px}
  .nav-btn span{font-size:10px}
  #realMap{height:300px}
}

@media(min-width:640px){
  .services-grid{grid-template-columns:repeat(3,1fr)}
  .countries-grid{grid-template-columns:repeat(3,1fr)}

  .section,
  .search-container,
  .continent-tabs,
  .continent-section{
    max-width:900px;
    margin-left:auto;
    margin-right:auto;
  }
  .map-wrapper{
    max-width:900px;
    margin-left:auto;
    margin-right:auto;
  }
  .explore-hero{padding:30px 40px 30px}
  .explore-hero > *{
    max-width:900px;
    margin-left:auto;
    margin-right:auto;
  }
  #realMap{height:450px}

  .community-hero,
  .profile-hero,
  .detail-hero{
    padding:30px 40px;
  }
  .community-hero > *,
  .profile-hero > *,
  .detail-hero > *{
    max-width:900px;
    margin-left:auto;
    margin-right:auto;
  }
  .detail-body{
    max-width:900px;
    margin-left:auto;
    margin-right:auto;
  }
  #tab-tourism{
    max-width:900px;
    margin-left:auto;
    margin-right:auto;
  }
  .profile-stats{
    max-width:900px;
    margin-left:auto;
    margin-right:auto;
  }
  .section{padding:26px 40px 0}
}

@media(min-width:1024px){
  body{background:#EEF2F7}

  .app-header{padding:30px 40px 40px}
  .app-header > *{
    max-width:1000px;
    margin-left:auto;
    margin-right:auto;
  }

  .services-grid{
    grid-template-columns:repeat(4,1fr);
    max-width:1000px;
  }
  .section{max-width:1000px}
  .countries-grid{
    grid-template-columns:repeat(4,1fr);
    max-width:1000px;
  }

  .service-card:hover{
    transform:translateY(-4px);
    box-shadow:var(--shadow);
  }
  .country-card:hover{
    transform:translateY(-4px);
    box-shadow:var(--shadow);
  }
  #realMap{height:520px}
}

/* ============================================================
   EXCHANGE RATES UI (تكامل rates.js)
   ============================================================ */

/* نص "آخر تحديث للأسعار" في الصفحة الرئيسية */
.rates-status{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  padding:9px 14px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow-sm);
  font-size:11px;
  font-weight:700;
  color:var(--muted);
}
.rates-status b{
  color:var(--text);
  font-weight:800;
}
.rates-status .rs-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--green);
  flex-shrink:0;
}
.rates-status .rs-dot.loading{
  background:var(--gold);
  animation:rsPulse 1.1s ease-in-out infinite;
}
@keyframes rsPulse{
  0%,100%{opacity:1}
  50%{opacity:.3}
}
/* اسم مصدر الأسعار (البنك المركزي المصري / سوق الصرف) */
.rates-status .rs-source{
  color:var(--muted);
  font-weight:600;
  opacity:.85;
}

/* كتلة العاصمة + السعر داخل كارت الدولة
   (السعر بقى جوّا الكارت مباشرة بعد اسم العاصمة) */
.country-card .card-meta{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  width:100%;
}

/* سطر المكافئ بالدولار داخل كروت الدول */
.country-card .usd-price{
  font-size:10px;
  font-weight:800;
  color:var(--green);
  background:rgba(16,185,129,.1);
  border-radius:99px;
  padding:3px 9px;
  direction:ltr;
  white-space:nowrap;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* المكافئ بالدولار داخل صفوف صفحة التفاصيل */
.usd-eq{
  display:inline-block;
  font-size:11px;
  font-weight:800;
  color:var(--green);
  margin-inline-start:4px;
  white-space:nowrap;
}

/* ============================================================
   21. OFFLINE / PWA
   مؤشر الأوفلاين + شريط التنبيه + وضع التطبيق المثبّت
   ============================================================ */

/* ---- أيقونة صغيرة في الهيدر (تظهر بس وقت الأوفلاين) ---- */
.offline-chip{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:5px 10px;
  border-radius:99px;
  background:rgba(255,201,60,.18);
  border:1px solid rgba(255,201,60,.55);
  color:#FFD75E;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
  animation:obBlink 1.6s ease-in-out infinite;
}
.offline-chip[hidden]{display:none}

/* ---- الشريط الأصفر تحت الهيدر ---- */
.offline-bar{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:14px 20px 0;
  padding:9px 14px;
  border-radius:14px;
  background:linear-gradient(135deg,#FFC93C,#F7B500);
  color:#3B2F00;
  font-size:12.5px;
  font-weight:800;
  text-align:center;
  box-shadow:0 8px 20px rgba(247,181,0,.28);
  animation:obGlow 2.4s ease-in-out infinite;
}
.offline-bar[hidden]{display:none}

.offline-bar .ob-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  background:#3B2F00;
  flex:0 0 auto;
  animation:obBlink 1.2s ease-in-out infinite;
}

@keyframes obBlink{
  0%,100%{opacity:.35}
  50%    {opacity:1}
}

@keyframes obGlow{
  0%,100%{box-shadow:0 8px 20px rgba(247,181,0,.22)}
  50%    {box-shadow:0 8px 26px rgba(247,181,0,.48)}
}

/* ---- التطبيق مثبّت (standalone): احترام النوتش من فوق ---- */
@media (display-mode:standalone) and (max-width:639px){
  .app-header,
  .explore-hero,
  .community-hero{
    padding-top:calc(20px + env(safe-area-inset-top, 0px));
  }
}

/* ---- شاشات كبيرة: الشريط يتمركز مع باقي المحتوى ---- */
@media(min-width:1024px){
  .offline-bar{
    max-width:960px;
    margin-left:auto;
    margin-right:auto;
  }
}

