/* ============================= */
/* CSS Variables for Theming */
/* ============================= */
:root {
  /* Light Theme Colors */
  --bg-primary: #d6e4fd;
  --bg-secondary: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-light: #eaf0ff;
  --accent-primary: #3563e9;
  --accent-secondary: #1a37a7;
  --border-color: #cfdcff;
  --shadow-light: rgba(0, 0, 0, 0.04);
  --shadow-medium: rgba(0, 0, 0, 0.1);
  --shadow-heavy: rgba(0, 0, 0, 0.2);
  --gradient-overlay: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 100%
  );
  --card-bg: #1a37a7;
  --card-text: #040404;
  --menu-bg: #ffffff;
  --menu-active: #e8f0fe;
}

[data-theme="dark"] {
  /* Dark Theme Colors */
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f2e;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-light: #c5d0e6;
  --accent-primary: #5b8af5;
  --accent-secondary: #3563e9;
  --border-color: #2d3748;
  --shadow-light: rgba(0, 0, 0, 0.2);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --shadow-heavy: rgba(0, 0, 0, 0.6);
  --gradient-overlay: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 100%
  );
  --card-bg: #2d3748;
  --card-text: #e8eaed;
  --menu-bg: #1a1f2e;
  --menu-active: #2d3748;
}

/* ============================= */
/* Global Reset */
/* ============================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Vazir", sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  margin: 0;
  direction: rtl;
  overflow-x: hidden;
  transition: background-color 0.3s ease;
}

/* ============================= */
/* App Container */
/* ============================= */
.app-container {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background-color 0.3s ease;
}

main {
  width: 100%;
  flex: 1;
  padding-bottom: 20px;
}

/* ============================= */
/* Header */
/* ============================= */
header {
  padding: clamp(12px, 4vw, 18px);
  width: 100%;
  transition: all 0.3s ease;
}

.head-site {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  padding: clamp(10px, 3vw, 14px) clamp(14px, 4vw, 20px);
  border-radius: clamp(14px, 4vw, 18px);
  box-shadow: 0 4px 10px var(--shadow-light);
  width: 100%;
  animation: slideDown 0.5s ease forwards;
  transition: all 0.3s ease;
}

.title {
  color: var(--accent-primary);
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 700;
  transition: color 0.3s ease;
}

.logo-site svg {
  width: clamp(30px, 8vw, 40px);
  height: clamp(30px, 8vw, 40px);
  transition: all 0.3s ease;
}

.logo-site svg circle {
  transition: fill 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--accent-primary);
  border: none;
  border-radius: 50%;
  width: clamp(36px, 10vw, 44px);
  height: clamp(36px, 10vw, 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(53, 99, 233, 0.3);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(53, 99, 233, 0.4);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  width: clamp(18px, 5vw, 22px);
  height: clamp(18px, 5vw, 22px);
  stroke: white;
  stroke-width: 2.5;
  transition: all 0.3s ease;
  position: absolute;
}

.sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.moon-icon {
  opacity: 0;
  transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: rotate(-180deg) scale(0);
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ============================= */
/* Slider Section */
/* ============================= */
/* 
/* ============================= */
/* Pack Section */
/* ============================= */
.pack-main {
  padding: clamp(10px, 3vw, 16px) clamp(14px, 4vw, 18px);
  /* margin-top: clamp(-20px, -6vw, -8px); */
  width: 100%;
  margin-top: 0px;
}

/* Add a bit of horizontal breathing room from a possible sidebar on wider screens */
@media (min-width: 769px) {
  .pack-main {
    margin-left: clamp(8px, 3vw, 40px);
  }
}

.pack-main ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 3.5vw, 16px);
}

.pack-main li {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2.5vw, 12px);
  flex-direction: row-reverse;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.5s ease forwards;
}

.pack-main li:nth-child(1) {
  animation-delay: 0.3s;
}
.pack-main li:nth-child(2) {
  animation-delay: 0.4s;
}
.pack-main li:nth-child(3) {
  animation-delay: 0.5s;
}
.pack-main li:nth-child(4) {
  animation-delay: 0.6s;
}

.pack-main li::before {
  content: attr(data-num);
  width: clamp(24px, 7vw, 32px);
  height: clamp(24px, 7vw, 32px);
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(11px, 3vw, 15px);
  color: var(--accent-primary);
  font-weight: 600;
  flex-shrink: 0;
  background: var(--bg-secondary);
  box-shadow: 0 4px 12px rgba(53, 99, 233, 0.15);
  transition: all 0.3s ease;
}

.pack-main li:hover::before {
  transform: rotate(360deg) scale(1.1);
  background: var(--accent-primary);
  color: var(--bg-secondary);
  border-color: var(--accent-primary);
}

.pack-item {
  flex: 1;
  background: var(--card-bg);
  border-radius: clamp(12px, 3.5vw, 18px);
  padding: clamp(10px, 3vw, 14px) clamp(12px, 4vw, 18px);
  box-shadow: 0 8px 18px rgba(26, 55, 167, 0.25);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 50px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.pack-item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-overlay);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pack-item:hover::before {
  opacity: 1;
}

.pack-item:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .pack-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(26, 55, 167, 0.4);
  }
}

[data-theme="dark"] .pack-item {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.pack-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 2vw, 10px);
  width: 100%;
}

.pack-open button {
  background: transparent;
  border: none;
  color: var(--card-text);
  font-size: clamp(12px, 3.3vw, 16px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  padding: 0;
  flex: 1;
  text-align: right;
}

.pack-open button:active {
  opacity: 0.7;
  transform: translateX(-3px);
}

@media (hover: hover) {
  .pack-open button:hover {
    opacity: 0.85;
    transform: translateX(-3px);
  }
}

.pack-open p {
  /* Use primary text color so it adapts between light/dark themes */
  /* Use unified site theme variable so light/dark toggles consistently */
  color: var(--text-primary);
  font-size: clamp(11px, 3vw, 14px);
  white-space: nowrap;
  margin: 0 auto;
  font-weight: 500;
}

.pack-icon {
  width: clamp(16px, 4.5vw, 22px);
  height: clamp(16px, 4.5vw, 22px);
  stroke: var(--card-text);
  stroke-width: 2;
  opacity: 0.9;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.pack-item:hover .pack-icon {
  transform: scale(1.1) rotate(-5deg);
}

/* ============================= */
/* Download App Link */
/* ============================= */
.link-app {
  padding: clamp(14px, 4vw, 18px);
  width: 100%;

  padding-bottom: 6rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 10px);
  color: var(--text-secondary);
  font-size: clamp(12px, 3.3vw, 15px);
  transition: all 0.3s ease;
  cursor: pointer;
}

.link-item:active {
  color: var(--accent-primary);
}

@media (hover: hover) {
  .link-item:hover {
    color: var(--accent-primary);
  }

  .link-item:hover svg {
    transform: translateY(-2px);
  }
}

.link-item svg {
  width: clamp(16px, 4.5vw, 20px);
  height: clamp(16px, 4.5vw, 20px);
  stroke: currentColor;
  transition: transform 0.3s ease;
}

.link-item a {
  text-decoration: none;
  color: inherit;
}

/* ============================= */
/* Bottom Menu */
/* ============================= */
.bottom-menu {
  position: fixed;
  left: 50%;
  bottom: clamp(8px, 2.5vw, 12px);
  transform: translateX(-50%);
  width: calc(100% - clamp(20px, 6vw, 28px));
  max-width: 430px;
  height: auto;
  border-radius: clamp(10px, 3vw, 14px);
  padding: clamp(6px, 2vw, 10px);
  z-index: 9999;
  box-shadow: 0 10px 30px var(--shadow-medium);
  border: 1px solid var(--border-color);
  background: var(--menu-bg);
  transition: all 0.3s ease;
}

.menu-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(8px, 3vw, 14px);
  gap: clamp(6px, 2vw, 10px);
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: clamp(6px, 2vw, 10px);
  transition: all 0.3s ease;
  border-radius: clamp(8px, 2vw, 12px);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  position: relative;
}

.menu-btn:active {
  background: var(--menu-active);
  transform: scale(0.95);
}

@media (hover: hover) {
  .menu-btn:hover {
    background: var(--menu-active);
  }
}

.menu-btn svg {
  width: clamp(20px, 5.5vw, 26px);
  height: clamp(20px, 5.5vw, 26px);
  stroke: var(--text-secondary);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.menu-btn:active svg,
.menu-btn:hover svg,
.menu-btn.active svg {
  opacity: 1;
  stroke: var(--accent-primary);
}

.menu-btn.active {
  background: var(--menu-active);
}

.menu-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: var(--accent-primary);
  border-radius: 3px;
}

.menu-divider {
  display: none;
}

/* ============================= */
/* Responsive Design */
/* ============================= */


@media screen and (min-width: 431px) and (max-width: 768px) {
  .app-container {
    max-width: 100%;
  }

  .bottom-menu {
    width: calc(100% - 40px);
  }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
  .app-container {
    max-width: 600px;
  }
}

@media screen and (min-width: 1025px) {
  .app-container {
    max-width: 700px;
    box-shadow: 0 0 40px var(--shadow-medium);
  }
}

/* ============================= */
/* Animations */
/* ============================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/* ============================= */
/* Accessibility */
/* ============================= */
.menu-btn:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

button:focus:not(:focus-visible) {
  outline: none;
}

/* ============================= */
/* Utility */
/* ============================= */
* {
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* ============================= */
/* Toast Notification */
/* ============================= */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(26, 55, 167, 0.95);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px var(--shadow-heavy);
  z-index: 10000;
  transition: transform 0.3s ease;
  backdrop-filter: blur(10px);
  max-width: 90%;
  text-align: center;
  font-family: "Vazir", sans-serif;
}

[data-theme="dark"] .toast {
  background: rgba(91, 138, 245, 0.95);
}

