/* ==================================================
   Color System (Correct Light / Dark Harmonized)
================================================== */

/* ========== Light Mode ========== */
:root{
  --bg-main:#f7f2f5;
  --bg-surface:#ffffff;
  --bg-accent:#f2c6d2;

  --primary:#b36b8b;
  --primary-soft:#f2c6d2;

  --text-main:#5a4b52;
  --text-muted:#8a7c83;

  --border-soft:rgba(0,0,0,.08);
  --shadow-soft:0 15px 40px rgba(0,0,0,.08);
  --shadow-strong:0 25px 50px rgba(179,107,139,.35);

  --overlay-light:rgba(255,255,255,.88);
}

/* ========== Dark Mode (Soft Rose Dark) ========== */
body.dark{
  --bg-main:#1f1b1d;
  --bg-surface:#2b2428;
  --bg-accent:#33252c;

  --primary:#e3a6bf;
  --primary-soft:#3a2a32;

  --text-main:#f2e8ed;
  --text-muted:#c9bcc2;

  --border-soft:rgba(255,255,255,.08);
  --shadow-soft:0 18px 45px rgba(0,0,0,.6);
  --shadow-strong:0 30px 70px rgba(0,0,0,.85);

  --overlay-light:rgba(0,0,0,.55);
}

/* ==================================================
   Global
================================================== */
*{
  box-sizing:border-box;
  transition:background .3s,color .3s,box-shadow .3s,transform .3s;
}

body{
  margin:0;
  font-family:"Tahoma",sans-serif;
  background:var(--bg-main);
  color:var(--text-main);
}

/* ==================================================
   Loader
================================================== */
#loader{
  position:fixed;
  inset:0;
  background:var(--bg-main);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:2000;
}

.spinner{
  width:50px;
  height:50px;
  border:5px solid var(--primary-soft);
  border-top:5px solid var(--primary);
  border-radius:50%;
  animation:spin 1s linear infinite;
}

@keyframes spin{
  to{transform:rotate(360deg)}
}

/* ==================================================
   Navbar
================================================== */
.navbar{
  position:fixed;
  top:0;
  width:100%;
  background:color-mix(in srgb, var(--bg-accent) 92%, transparent);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border-soft);
  z-index:1000;
}

.nav-container{
  max-width:1200px;
  margin:auto;
  padding:10px 25px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

/* Brand */
.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.brand-logo{
  width:38px;
  height:38px;
  object-fit:contain;
}

.brand-text-wrap{
  display:flex;
  flex-direction:column;
  line-height:1.2;
}

.brand-title{
  font-weight:600;
  font-size:15px;
}

.brand-subtitle{
  font-size:12px;
  color:var(--text-muted);
}

/* Nav Links */
.nav-links{
  display:flex;
}

.nav-links a{
  margin:0 10px;
  text-decoration:none;
  color:var(--text-main);
  font-weight:500;
  position:relative;
}

.nav-links a::after{
  content:"";
  position:absolute;
  bottom:-6px;
  right:0;
  width:0;
  height:2px;
  background:var(--primary);
}

.nav-links a:hover::after,
.nav-links a.active::after{
  width:100%;
}

/* Theme Button */
.theme-btn{
  background:none;
  border:none;
  font-size:20px;
  cursor:pointer;
  color:var(--text-main);
}

/* ================= Brand ================= */
.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand-logo-wrap{
  width:46px;
  height:46px;
  border-radius:14px;

  display:flex;
  align-items:center;
  justify-content:center;

  background:color-mix(in srgb, var(--bg-surface) 85%, transparent);
  box-shadow:var(--shadow-soft);
}
.brand-logo{
  width:30px;
  height:30px;
  object-fit:contain;
  filter:drop-shadow(0 6px 14px rgba(0,0,0,.25));
}
.brand-text-wrap{
  display:flex;
  flex-direction:column;
  line-height:1.2;
}

.brand-title{
  font-size:15px;
  font-weight:600;
  color:var(--text-main);
  letter-spacing:.2px;
}

.brand-subtitle{
  font-size:11.5px;
  color:var(--text-muted);
  letter-spacing:.3px;
}
body.dark .brand-logo-wrap{
  background:color-mix(in srgb, var(--bg-surface) 65%, transparent);
  border:1px solid rgba(255, 255, 255, 0.853);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.15),
    var(--shadow-soft);
}

/* ================= Hamburger Button (NEW DESIGN) ================= */
.hamburger{
  display:none;
  width:44px;
  height:44px;
  border:none;
  border-radius:14px;

  background:color-mix(in srgb, var(--bg-surface) 80%, transparent);
  backdrop-filter:blur(10px);

  box-shadow:var(--shadow-soft);
  cursor:pointer;

  display:flex;
  align-items:center;
  justify-content:center;

  transition:
    background .3s ease,
    box-shadow .3s ease,
    transform .2s ease;
}

.hamburger:hover{
  box-shadow:var(--shadow-strong);
  transform:translateY(-1px);
}

.hamburger span{
  position:absolute;
  width:20px;
  height:2px;
  background:var(--text-main);
  border-radius:2px;
  transition:transform .3s ease, opacity .3s ease;
}

.hamburger span:nth-child(1){
  transform:translateY(-6px);
}

.hamburger span:nth-child(2){
  opacity:1;
}

.hamburger span:nth-child(3){
  transform:translateY(6px);
}

/* Active (X icon) */
.hamburger.active span:nth-child(1){
  transform:rotate(45deg);
}

.hamburger.active span:nth-child(2){
  opacity:0;
}

.hamburger.active span:nth-child(3){
  transform:rotate(-45deg);
}

/* ===== Dark Mode Support ===== */
body.dark .hamburger{
  background:color-mix(in srgb, var(--bg-surface) 70%, transparent);
}

body.dark .hamburger span{
  background:var(--text-main);
}

/* ==================================================
   Hero
================================================== */
.hero{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:url("../images/main.png") center top / cover no-repeat;
}

.hero-overlay{
  width:100%;
  min-height:100vh;
  background:linear-gradient(
    var(--overlay-light),
    color-mix(in srgb, var(--overlay-light) 65%, transparent)
  );
  display:flex;
  align-items:center;
  justify-content:center;
  padding:60px 20px;
}

.hero-content{
  width:100%;
  max-width:720px;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:18px;
}

.hero-content h1{
  font-size:clamp(26px, 4vw, 38px);
  margin:0;
}

.hero-content p{
  font-size:clamp(15px, 2.2vw, 18px);
  line-height:1.9;
  max-width:600px;
  margin:0;
  color:var(--text-muted);
}

/* ==================================================
   Buttons
================================================== */
.hero-actions{
  display:flex;
  gap:15px;
  justify-content:center;
  flex-wrap:wrap;
}

.btn{
  background:var(--primary);
  color:#fff;
  padding:14px 34px;
  border-radius:30px;
  text-decoration:none;
  font-weight:500;
  box-shadow:0 10px 25px rgba(179,107,139,.35);
}

.btn:hover{
  transform:translateY(-2px);
}

.btn-outline{
  background:transparent;
  border:2px solid var(--primary);
  color:var(--primary);
}

/* ==================================================
   Sections
================================================== */
.features-section{
  padding:100px 30px;
}

.section-title{
  text-align:center;
  font-size:28px;
  margin-bottom:50px;
}

/* ==================================================
   Cards
================================================== */
.features-grid{
  max-width:1100px;
  margin:auto;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:30px;
}

.feature-card{
  background:var(--bg-surface);
  border-radius:25px;
  padding:28px 22px;
  text-align:center;
  box-shadow:var(--shadow-soft);
}

.feature-card:hover{
  transform:translateY(-10px);
  box-shadow:var(--shadow-strong);
}

.feature-card h3{
  margin:12px 0 8px;
  font-size:18px;
}

.feature-image{
  position:relative;
  width:100%;
  height:180px;
  overflow:hidden;
  border-radius:18px;
  margin-bottom:18px;
}

.feature-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .6s ease;
}

.feature-card:hover .feature-image img{
  transform:scale(1.08);
}

body.dark .feature-image::after{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.18);
}

/* ==================================================
   Footer
================================================== */
.footer{
  background:var(--bg-accent);
  text-align:center;
  padding:18px;
}

/* ==================================================
   Animations
================================================== */
.reveal{
  opacity:0;
  transform:translateY(40px);
}

.reveal.show{
  opacity:1;
  transform:translateY(0);
}

/* ===== Theme Icons ===== */
.theme-btn{
  position:relative;
  width:40px;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.theme-btn span{
  position:absolute;
  width:22px;
  height:22px;
  background-size:contain;
  background-repeat:no-repeat;
  opacity:0;
  transform:scale(.8);
  transition:opacity .3s, transform .3s;
}

/* Moon Icon */
.icon-moon{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235a4b52'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z'/%3E%3C/svg%3E");
}

/* Sun Icon */
.icon-sun{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f1e8ed'%3E%3Ccircle cx='12' cy='12' r='5' stroke-width='2'/%3E%3Cpath stroke-width='2' d='M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42'/%3E%3C/svg%3E");
}

/* Show correct icon */
body.dark .icon-sun{opacity:1;transform:scale(1);}
body:not(.dark) .icon-moon{opacity:1;transform:scale(1);}

/* ==================================================
   Mobile Navigation (PHONE ONLY)
================================================== */
@media (max-width:768px){

  /* Show hamburger ONLY on phone */
  .hamburger{
    display:flex;
  }

  /* Hide nav by default on phone */
  .nav-links{
    position:absolute;
    top:72px;
    right:12px;
    width:calc(100% - 24px);
    max-width:420px;

    display:flex;
    flex-direction:column;
    align-items:stretch;

    background:var(--bg-surface);
    border-radius:20px;
    box-shadow:var(--shadow-strong);

    overflow:hidden;
    max-height:0;
    opacity:0;
    visibility:hidden;

    transition:
      max-height .4s ease,
      opacity .3s ease,
      visibility .3s ease;

    z-index:1500;
  }

  /* Show ONLY when open */
  .nav-links.open{
    max-height:420px;
    opacity:1;
    visibility:visible;
  }

  /* Links style */
  .nav-links a{
    padding:14px 20px;
    margin:0;
    text-align:right;
    border-bottom:1px solid var(--border-soft);
  }

  .nav-links a:last-child{
    border-bottom:none;
  }

  /* Dark mode support */
  body.dark .nav-links{
    background:rgba(43,36,40,.95);
    backdrop-filter:blur(14px);
  }
}

.brand-logo-wrap{
    width:52px;
    height:52px;
    border-radius:30px;
  }

  .brand-logo{
    width:66px;
    height:66px;
  }

  .brand-title{
    font-size:14px;
  }

  .brand-subtitle{
    font-size:11px;
  }

/* ==================================================
   Desktop (IMPORTANT RESET)
================================================== */
@media (min-width:769px){

  .hamburger{
    display:none;   /* ⬅️ لا يظهر إلا في الهاتف */
  }

  .nav-links{
    position:static;
    max-height:none;
    opacity:1;
    visibility:visible;
    background:transparent;
    box-shadow:none;
    flex-direction:row;
    width:auto;
  }
}
