/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #ff6b6b;
  --primary-dark: #ff5252;
  --primary-light: #ff8a80;
  --primary-lighter: #ffb3b3;
  --secondary-color: #4caf50;
  --text-primary: #212121;
  --text-secondary: #757575;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-accent: #f5f5f5;
  --border-color: #e0e0e0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}

/* Farsi font */
[dir="rtl"],
html[lang="fa"] {
  font-family: "Vazirmatn", "Tahoma", "Arial", sans-serif;
}

[dir="rtl"] *,
html[lang="fa"] * {
  font-family: inherit;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Hero Section */
.hero {
  background: linear-gradient(
    135deg,
    #ffb3b3 0%,
    #ff8a80 20%,
    #ff6b6b 40%,
    #ff5252 60%,
    #ff6b6b 80%,
    #ff8a80 100%
  );
  color: white;
  padding: 6rem 0 8rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  opacity: 0.5;
}

.hero::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 70%
  );
  animation: gradient-rotate 20s ease infinite;
}

@keyframes gradient-rotate {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(180deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

.hero-maple-leaf {
  width: 120px;
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
}

.hero-maple-leaf:hover {
  transform: scale(1.1) rotate(5deg);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.03em;
}

.title-en {
  font-size: 4.5rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  opacity: 0.95;
  letter-spacing: 0.01em;
}

.app-links {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.coming-soon {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.9;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.beta-notice {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 0.5rem;
  text-align: center;
}

.store-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.app-badge-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  border-radius: 8px;
  overflow: hidden;
}

.app-badge-btn:hover {
  transform: translateY(-3px) scale(1.02);
}

.app-badge-btn:active {
  transform: translateY(0) scale(0.98);
}

.app-badge-btn img {
  height: 44px;
  width: 148px;
  object-fit: contain;
  display: block;
}

.app-link {
  display: inline-block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-link:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.app-link img {
  height: 60px;
  width: auto;
  border-radius: 8px;
}

/* Features Section */
.features {
  padding: 6rem 0;
  background-color: var(--bg-secondary);
}

.section-title {
  font-size: 2.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  gap: 2rem;
  margin-top: 3rem;
  justify-content: center;
  align-items: stretch;
}

.feature-card {
  background: var(--bg-primary);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.feature-card:hover .feature-icon {
  background: linear-gradient(135deg, #ff8a80 0%, #ff6b6b 100%);
  transform: scale(1.05);
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  border-radius: 16px;
  padding: 12px;
  transition: transform 0.3s ease, background 0.3s ease;
}

.feature-icon svg {
  width: 100%;
  height: 100%;
  stroke: white;
}

.feature-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.feature-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  flex-grow: 1;
}

/* Screenshots Section */
.screenshots {
  padding: 6rem 0;
  background-color: var(--bg-primary);
}

.screenshots-description {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
  gap: 2rem;
  justify-content: center;
  align-items: stretch;
}

.screenshot-item {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--bg-primary);
}

.screenshot-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.screenshot-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  object-fit: cover;
}

/* About Section */
.about {
  padding: 6rem 0;
  background-color: var(--bg-primary);
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about-text {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.9;
  font-weight: 400;
}

.about-text:last-of-type {
  margin-bottom: 0;
}

/* Contact Section */
.contact {
  padding: 6rem 0;
  background-color: var(--bg-secondary);
}

.contact-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.9;
  font-weight: 400;
}

.contact-info {
  display: flex;
  justify-content: center;
  align-items: center;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow-md);
}

.contact-email:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #ff8a80 0%, #ff6b6b 100%);
}

.contact-icon {
  width: 24px;
  height: 24px;
  stroke: white;
}

/* Footer */
.footer {
  background-color: var(--bg-accent);
  padding: 2.5rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  direction: ltr; /* Footer always LTR regardless of page language */
}

.footer-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  direction: ltr; /* Footer text always LTR */
}

.footer-text a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  direction: ltr; /* Footer links always LTR */
}

.footer-text a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.heart-icon {
  color: var(--primary-color);
  display: inline-block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  .hero {
    padding: 4rem 0 6rem;
  }

  .hero-maple-leaf {
    width: 90px;
  }

  .hero-title {
    font-size: 2.75rem;
  }

  .title-en {
    font-size: 2.75rem;
    font-weight: 800;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 2.25rem;
    letter-spacing: -0.02em;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feature-card {
    padding: 2rem;
  }

  .about-text {
    font-size: 1rem;
  }

  .screenshots-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .screenshots-description {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .app-links {
    flex-direction: column;
  }

  .app-link img {
    height: 50px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 3rem 0 4rem;
  }

  .hero-maple-leaf {
    width: 70px;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .title-en {
    font-size: 2.25rem;
    font-weight: 800;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .features,
  .about,
  .screenshots {
    padding: 4rem 0;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
  }
}

/* Navigation - Shared across all pages */
.main-nav {
  background: white;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
}

/* Submit Banner */
.submit-banner {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 99;
}

.submit-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: relative;
}

.submit-banner-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  text-align: center;
}

.submit-banner-link {
  color: white;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.submit-banner-link:hover {
  opacity: 0.9;
}

.submit-banner-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
  transition: background 0.2s ease;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.submit-banner-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.submit-banner-close span {
  display: block;
  margin-top: -2px;
}

@media (max-width: 768px) {
  .submit-banner {
    padding: 0.875rem 0;
  }

  .submit-banner-content {
    padding-right: 2rem;
  }

  [dir="rtl"] .submit-banner-content {
    padding-right: 0;
    padding-left: 2rem;
  }

  .submit-banner-text {
    font-size: 0.875rem;
    gap: 0.5rem;
  }

  .submit-banner-link {
    font-size: 0.875rem;
  }

  .submit-banner-close {
    width: 24px;
    height: 24px;
    font-size: 1.25rem;
  }
}

[dir="rtl"] .submit-banner-close {
  right: auto;
  left: 0;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
}

.nav-logo-img {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
}

/* RTL support for navigation - Desktop */
@media (min-width: 769px) {
  [dir="rtl"] .nav-content {
    flex-direction: row-reverse;
  }

  [dir="rtl"] .nav-links {
    flex-direction: row-reverse;
  }
}

.lang-toggle {
  background: var(--bg-secondary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  color: var(--text-primary);
}

.lang-toggle:hover {
  background: var(--border-color);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 99;
  }

  .nav-links.mobile-open {
    transform: translateX(0);
  }

  /* RTL mobile menu - only fix slide direction, keep same alignment as English */
  [dir="rtl"] .nav-links {
    transform: translateX(100%);
  }

  [dir="rtl"] .nav-links.mobile-open {
    transform: translateX(0);
  }

  [dir="rtl"] .nav-content {
    flex-direction: row-reverse;
  }

  .mobile-menu-toggle {
    display: flex;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Animation for fade-in */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature-card {
  animation: fadeIn 0.6s ease-out;
}

.feature-card:nth-child(1) {
  animation-delay: 0.1s;
}

.feature-card:nth-child(2) {
  animation-delay: 0.2s;
}

.feature-card:nth-child(3) {
  animation-delay: 0.3s;
}

.feature-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon img,
.modal-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: stretch;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input {
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.form-group input::placeholder {
  color: #aaa;
}

.submit-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

.form-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Success State */
.modal-success {
  text-align: center;
  padding: 1rem 0;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.success-icon svg {
  width: 32px;
  height: 32px;
  stroke: white;
}

.modal-success h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.modal-success p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.close-success-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.close-success-btn:hover {
  background: var(--border-color);
}

/* Error State */
.modal-error {
  background: #fff5f5;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.error-message {
  color: #c62828;
  font-size: 0.875rem;
  margin: 0;
  text-align: center;
}

/* Responsive Modal */
@media (max-width: 480px) {
  .modal-content {
    padding: 2rem 1.5rem;
    border-radius: 16px;
  }

  .modal-title {
    font-size: 1.25rem;
  }

  .store-badges {
    flex-direction: column;
    gap: 1rem;
  }

  .app-badge-btn img {
    height: 48px;
  }
}
