/* پایه */
* {
  box-sizing: border-box;
}
body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  font-family: "Vazirmatn", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #0a1931;
  color: #eaf4f4;
  direction: rtl;
  line-height: 1.6;
  min-height: 100vh;
  height: auto;
  overflow-y: scroll;
}

/* هدر */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 50px;
  background-color: #0a1931;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.8rem;
  font-weight: 900;
  color: #eaf4f4;
}

.nav-links {
  display: flex;
  gap: 25px;
  list-style: none;
  padding: 0;
  margin: 0;
  direction: ltr;
  flex-wrap: wrap;
}

.nav-links li a {
  color: #eaf4f4;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.nav-links li a:hover {
  color: #4a90e2;
}

/* بخش قهرمان */
.container {
  height: auto;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: space-evenly;
  justify-content: space-evenly;
  padding: 60px 20px;
}

.hero-content {
  max-width: 600px;
  text-align: center;
}
.hero-title {
  display: none;
  font-size: 3em;
  margin-bottom: 30px;
  text-shadow: 0 0 5px rgba(74, 144, 226, 0.5), 0 0 10px rgba(74, 144, 226, 0.3);
}
.hero-content h1 {
  font-size: 3em;
  margin-bottom: 30px;
  text-shadow: 0 0 5px rgba(74, 144, 226, 0.5), 0 0 10px rgba(74, 144, 226, 0.3);
}
.content-desktop {
  display: block;
  font-size: 3em;
  margin-bottom: 30px;
  text-shadow: 0 0 5px rgba(74, 144, 226, 0.5), 0 0 10px rgba(74, 144, 226, 0.3);
}
.content-mob {
  display: none;
  font-size: 3em;
  margin-bottom: 30px;
  text-shadow: 0 0 5px rgba(74, 144, 226, 0.5), 0 0 10px rgba(74, 144, 226, 0.3);
}
.cta-button {
  display: inline-block;
  background-color: #4a90e2;
  color: #0a1931;
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  margin-top: 30px;
  box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(74, 144, 226, 0.6);
}

/* گوشی */
.hero-image-3d {
  width: 300px;
  perspective: 1500px;
  margin-top: 40px;
}

.phone-mockup {
  width: 280px;
  height: 580px;
  background-color: #000;
  border-radius: 50px;
  padding: 8px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 10px rgba(74, 144, 226, 0.4);
  border: 3px solid #334960;
  transform: rotateY(-20deg) rotateX(8deg) translateZ(0);
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}

.iphone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 25px;
  background-color: #000;
  border-radius: 0 0 15px 15px;
  z-index: 10;
}

/* چت */
.chat-screen {
  background-color: #1a345b;
  height: 100%;
  border-radius: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.messages-container {
  padding: 10px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow-y: hidden;
}

.message {
  padding: 10px 14px;
  margin-bottom: 8px;
  max-width: 90%;
  font-size: 0.9em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transform: translateZ(5px);
}
.message pre {
  white-space: pre-wrap; /* allow wrapping inside <pre> */
  word-wrap: break-word; /* break long lines */
  overflow-x: auto; /* enable horizontal scroll if needed */
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 6px;
  font-size: 0.85em;
  direction: ltr; /* for code readability */
}

.received {
  background-color: #3c63a6;
  color: #eaf4f4;
  align-self: flex-start;
  border-radius: 20px 20px 20px 5px;
}

.sent {
  background-color: #eaf4f4;
  color: #0a1931;
  align-self: flex-end;
  border-radius: 20px 20px 5px 20px;
}

.chat-input-area {
  display: flex;
  align-items: center; /* vertically center input and button */
  padding: 8px;
  background-color: #152a4a;
  border-radius: 0 0 40px 40px;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
}

.chat-input-area input {
  flex: 1;
  min-width: 0; /* prevents flex overflow on mobile */
  padding: 8px;
  border: none;
  border-radius: 20px;
  background-color: #26436e;
  color: #eaf4f4;
  font-family: "Vazirmatn", sans-serif;
  margin-left: 5px; /* push away from button */
  text-align: right;
}

.chat-input-area button {
  flex-shrink: 0; /* 🔒 prevent button shrinking */
  width: 36px;
  height: 36px;
  background-color: #4a90e2;
  color: white;
  border: none;
  border-radius: 50%;
  font-weight: bold;
  opacity: 0.6;
}

@media (max-width: 1024px) {
  .container {
    flex-direction: column-reverse;
    padding: 40px 20px;
    text-align: center;
  }
  .hero-title {
    display: block;
  }
  .content-desktop {
    display: none;
  }
  .content-mob {
    display: block;
  }
  .hero-image-3d {
    margin: 10px 0 20px 0;
  }

  .hero-content h1 {
    font-size: 2.4em;
  }
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 10px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }

  .hero-content h1 {
    font-size: 2em;
  }

  .cta-button {
    padding: 12px 25px;
  }
}

@media (max-width: 550px) {
  .container {
    padding: 30px 10px;
  }

  .hero-content h1 {
    font-size: 1.6em;
  }

  .hero-content p {
    font-size: 0.95em;
  }

  .phone-mockup {
    width: 240px;
    height: 500px;
    transform: none;
  }

  .hero-image-3d {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
  }
  .received {
    width: 90%;
  }
  .message {
    max-width: 100%;
    word-wrap: break-word;
  }
}
