/*==========================================================================
  فایل استایل نهایی و کامل برای فست استارز (نسخه جامع و بهبودیافته)
==========================================================================*/

/*----------------------------------------------------------------
  0. استایل‌های عمومی و پایه‌ای (General & Base Styles)
----------------------------------------------------------------*/
@font-face {
  font-family: "IRANSans";
  src: url("../wp-content/themes/Divi/fonts/woff2/IRANSansWeb.woff2")
      format("woff2"),
    url("../wp-content/themes/Divi/fonts/woff/IRANSansWeb.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

:root {
  --primary-color: #0088cc;
  --secondary-color: #ffd700;
  --accent-color: #f0f8ff;
  --text-color: #1a2c4e;
  --border-color: #e0e6f0;
  --body-bg: #f9fafb;
  --hover-shadow: rgba(0, 136, 204, 0.25);
  --success-color: #4caf50;
  --error-color: #f44336;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "IRANSans";
}

body {
  direction: rtl;
  background-color: var(--body-bg);
  color: var(--text-color);
  line-height: 1.7;
  padding-top: 80px;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/*----------------------------------------------------------------
  1. هدر و ناوبری (Header & Navigation)
----------------------------------------------------------------*/
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: #ffffff;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.07);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 54px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-size: 24px;
  font-weight: bold;
  margin-right: 15px;
  color: var(--text-color);
}

.main-nav .nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu a {
  color: #333;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 0.5rem 1rem;
  position: relative;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: var(--primary-color);
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--primary-color);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-menu a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
}

/*----------------------------------------------------------------
  2. کامپوننت‌های مشترک فرم (Shared Form Components)
----------------------------------------------------------------*/
.purchase-container h1 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.purchase-container > p {
  text-align: center;
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 30px;
}

.user-details-container {
  max-width: 600px;
  margin: 40px auto;
  padding: 30px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
  border: 1px solid var(--border-color);
  position: relative;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input,
.form-group .search-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fdfdfd;
}

.form-group input:focus,
.search-wrapper .search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--hover-shadow);
  outline: none;
  background: #fff;
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-wrapper .search-input {
  padding: 14px 18px 14px 40px;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  font-size: 1.2rem;
}

.search-loader {
  display: none;
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
}

.circle-progress {
  width: 20px;
  height: 20px;
  border: 3px solid var(--primary-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.clear-search {
  display: none;
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--error-color);
  cursor: pointer;
  padding: 5px;
  font-size: 1.2rem;
}

.mobile-input-wrapper {
  position: relative;
}

.mobile-input-wrapper .mobile-logo {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 30px;
  height: auto;
}

#mobile {
  padding-right: 50px !important;
}

.user-info {
  background: var(--accent-color);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  margin-bottom: 30px;
  border-right: 5px solid var(--primary-color);
  animation: slideIn 0.5s ease-out;
}

.user-info .profile-image {
  display: block;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  margin: 0 auto 15px auto;
}

.user-info h2 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  text-align: center;
}

.user-info p {
    background-color: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    border-right: 4px solid var(--secondary-color);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.user-info p strong {
    font-weight: 700;
    color: var(--text-color);
}

.terms-notice {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.terms-agreement {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 20px;
}

.submit-btn {
  background: linear-gradient(135deg, var(--primary-color), #00aaff);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  margin-top: 25px;
  padding: 15px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
  transition: all 0.3s ease;
}

.submit-btn:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
  transform: translateY(-3px);
}

.submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.form-messages {
  text-align: center;
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  display: none; /* Initially hidden */
}
.form-messages.success {
  color: var(--success-color);
  background: #e8f5e9;
  display: block;
}
.form-messages.error {
  color: var(--error-color);
  background: #ffebee;
  display: block;
}

/*----------------------------------------------------------------
  3. استایل‌های اختصاصی صفحه خرید پرمیوم (index.php)
----------------------------------------------------------------*/
.premium-purchase-container .user-details-container {
  padding-top: 80px; /* فضا برای لیبل "انتخاب بسته" */
}

.premium-purchase-container .form-group,
.premium-purchase-container .premium-options {
  max-width: 450px;
  margin-right: auto;
  margin-left: auto;
}

.package-selection > label {
  position: absolute;
  top: 30px;
  right: 35px;
  font-size: 1.6rem;
  font-weight: 800;
}

.discount-badge-container {
  position: absolute;
  top: 35px;
  left: 35px;
}

.discount-badge {
  background: #e91e63;
  color: white;
  padding: 5px 15px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.premium-option {
  background-color: #fff;
  border: 2px solid var(--border-color);
  color: var(--text-color);
  padding: 20px 25px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  margin-bottom: 15px;
}

.premium-option:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 0 8px 20px rgba(0, 136, 204, 0.15);
}

.premium-option.selected {
  border-color: var(--primary-color);
  background-color: var(--accent-color);
  box-shadow: 0 0 0 4px var(--hover-shadow);
}

.premium-option .package-price {
  color: var(--primary-color);
  font-weight: 700;
}

.price-summary {
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  margin-top: 20px;
}

/*----------------------------------------------------------------
  4. استایل‌های اختصاصی صفحه خرید استارز (stars.php)
----------------------------------------------------------------*/
.stars-hero {
  text-align: center;
  padding: 20px 0 40px;
  margin-bottom: 40px;
}

.stars-hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
}

.stars-hero .section-desc {
  font-size: 1.3rem;
  color: #555;
  max-width: 600px;
  margin: 0 auto;
}

.stars-selector-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  max-width: 950px;
  margin: 0 auto 40px auto;
}

.popular-packages,
.all-packages {
  width: 100%;
  text-align: center;
}

.popular-packages h3,
.all-packages h3 {
  margin-bottom: 30px;
  font-size: 2rem;
  font-weight: 700;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
  justify-content: center;
  width: 100%;
}

.package-card {
  position: relative;
  overflow: hidden;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
  border-radius: 50%;
}

.package-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 215, 0, 0.6),
        transparent 40%
    );
    opacity: var(--glow-intensity, 0);
    transition: opacity 0.2s ease-out;
    z-index: 1;
}

.package-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--secondary-color);
}

.package-card .portal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 215, 0, 0.4), /* Softer color */
        transparent 70% /* Softer, more diffused edge */
    );
    opacity: var(--glow-intensity, 0);
    transition: opacity 0.4s ease-out; /* Smoother transition */
    pointer-events: none;
    z-index: 1;
}

.package-content {
  z-index: 2;
}

.package-card.selected {
  border-color: var(--secondary-color);
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.package-card.selected .portal {
    opacity: 1; /* Ensure glow is visible */
    animation: breathe 2s infinite ease-in-out;
}

.stars-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row-reverse;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 1rem;
  font-weight: 700;
}

.stars-icon svg {
  fill: var(--secondary-color);
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

.stars-price {
  display: block;
  color: var(--primary-color);
  font-weight: bold;
  margin-top: 10px;
  font-size: 1rem;
}

.custom-amount-section {
  text-align: center;
  max-width: 700px;
  width: 100%;
  padding: 30px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
}

.custom-amount-section h3 {
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.custom-input {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 auto 15px auto;
  max-width: 400px;
}

#customStars {
  width: 100%;
  padding: 14px 20px 14px 55px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1.4rem;
  font-weight: 500;
  transition: all 0.3s ease;
  background: #fdfdfd;
  text-align: left;
  direction: ltr;
}

#customStars:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--hover-shadow);
  outline: none;
}

.custom-input .stars-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  pointer-events: none;
}

.custom-price {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 25px;
  min-height: 30px;
}

#iframeContainer {
  height: 400px;
  width: 100%;
  overflow: hidden;
  margin-top: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

/*----------------------------------------------------------------
  5. انیمیشن‌ها (Keyframes)
----------------------------------------------------------------*/
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathe {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/*----------------------------------------------------------------
  6. استایل‌های واکنش‌گرا (Media Queries)
----------------------------------------------------------------*/
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .main-nav .nav-menu {
    display: none;
  }

  .purchase-container h1 {
    font-size: 1.8rem;
  }

  .user-details-container {
    padding: 20px 15px;
  }

  .premium-purchase-container .user-details-container {
    padding-top: 70px;
  }

  .package-selection > label {
    top: 20px;
    right: 20px;
    font-size: 1.4rem;
  }

  .discount-badge-container {
    top: 25px;
    left: 20px;
  }

  .stars-hero h1 {
    font-size: 2.2rem;
  }
  .stars-hero .section-desc {
    font-size: 1.1rem;
  }

  .custom-amount-section {
    padding: 20px;
  }
}

/* --- Custom Checkbox Styles --- */
.styled-checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 1rem;
    position: relative;
    padding-left: 35px; /* Make space for the custom checkbox */
    margin-bottom: 12px;
}

/* Hide the browsers default checkbox */
.styled-checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Create a custom checkbox */
.styled-checkbox-container label::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 22px;
    width: 22px;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: all 0.2s ease;
}

/* On mouse-over, add a grey background color */
.styled-checkbox-container:hover input ~ label::before {
    background-color: #ddd;
}

/* When the checkbox is checked, add a blue background */
.styled-checkbox-container input:checked ~ label::before {
    background-color: #2196F3;
    border-color: #2196F3;
}

/* Create the checkmark/indicator (hidden when not checked) */
.styled-checkbox-container label::after {
    content: "";
    position: absolute;
    display: none;
}

/* Show the checkmark when checked */
.styled-checkbox-container input:checked ~ label::after {
    display: block;
}

/* Style the checkmark/indicator */
.styled-checkbox-container label::after {
    left: 8px;
    top: 50%;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: translateY(-65%) rotate(45deg);
}

.styled-checkbox-container a {
    color: #007bff;
    text-decoration: none;
}

.styled-checkbox-container a:hover {
    text-decoration: underline;
}
