/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* CSS Variables for consistent theming */
:root {
  --primary-color: #0c7cd5;
  --secondary-color: #0088cc;
  --accent-color: #4285f4;
  --success-color: #34a853;
  --warning-color: #fbbc04;
  --error-color: #ea4335;
  --text-primary: #1a1a1a;
  --text-secondary: #5f6368;
  --text-light: #ffffff;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-accent: #e8f0fe;
  --border-color: #e1e3e6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Vazirmatn', 'Helvetica Neue', Arial, sans-serif;
}

/* Body styling */
body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f8f9fa 0%, #e8f0fe 100%);
  min-height: 100vh;
  direction: rtl;
}

/* Container for main content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header styling with modern design */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: var(--text-light);
  padding: 20px 15px; /* Reduced padding */
  border-radius: var(--border-radius-lg);
  margin-bottom: 30px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.header-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px; /* Reduced gap */
  position: relative;
  z-index: 1;
}

.header-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  padding: 15px; /* Reduced padding */
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.header-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.header-card img {
  max-width: 70px !important; /* Smaller logo */
  width: 100%;
  height: auto;
}

.header-card h1 {
  font-size: 1.2rem; /* Smaller h1 */
  margin: 0 0 4px 0 !important;
}

.header-card p {
  font-size: 0.9rem; /* Smaller paragraph */
  margin: 0 !important;
}

.hero-modern {
  display: flex;
  align-items: center;
  gap: 15px; /* Reduced gap */
}

.hero-icon {
  font-size: 2rem; /* Smaller icon */
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
}

.hero-content h2 {
  margin-bottom: 10px; /* Reduced margin */
  font-size: 1.2rem; /* Smaller h2 */
  font-weight: 700;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(5px);
}

/* Cards container with improved layout */
.cards-container {
  display: block; /* Ensures container is a block element */
  margin-bottom: 40px;
}

.tab-headers {
  display: flex;
  justify-content: center; /* Center the tabs */
  flex-wrap: wrap; /* Allow tabs to wrap on smaller screens */
  gap: 15px; /* Space between tabs */
  margin-bottom: 30px;
  background: var(--bg-primary);
  padding: 15px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

/* Enhanced card styling - now for tab headers */
.card-header.mobile-toggle {
  flex-grow: 1; /* Allow headers to grow and fill space */
  text-align: center;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 18px 25px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column; /* Stack title and badge */
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-header.mobile-toggle:hover {
  background: var(--bg-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header.mobile-toggle.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: var(--text-light);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header.mobile-toggle.active h2,
.card-header.mobile-toggle.active .iran-badge,
.card-header.mobile-toggle.active .premium-badge,
.card-header.mobile-toggle.active .free-badge,
.card-header.mobile-toggle.active .mobile-toggle-icon {
  color: var(--text-light) !important;
}

.card-header h2 {
  margin-bottom: 0; /* Remove margin as items are stacked with gap */
  font-size: 1.2rem; /* Slightly smaller for tab headers */
}

.mobile-toggle-icon {
  display: none; /* Hide toggle icon for desktop tab headers */
}

/* Tab content area */
.tab-content-area {
  display: none; /* Hidden by default */
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  padding: 30px;
  margin-top: 30px; /* Space between tabs and content */
}

.tab-content-area.has-active-tab {
  display: block; /* Show when a tab is active */
}

/* Individual tab content sections */
.tab-content {
  display: none; /* Hidden by default */
}

.tab-content.active {
  display: block; /* Show active content */
}


/* Badge styling - ensure they look good on active tabs */
.iran-badge,
.premium-badge,
.free-badge {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.iran-badge {
  background: #ff6b6b;
  color: white;
}

.premium-badge {
  background: #ffd700;
  color: #8b4513;
}

.free-badge {
  background: #98fb98;
  color: #006400;
}

.mobile-toggle-icon {
  font-size: 1.2rem;
  transition: var(--transition);
  color: var(--text-secondary);
  margin-left: auto; /* Push icon to the right in RTL */
}

.card-header.expanded .mobile-toggle-icon {
  transform: rotate(180deg);
}

.tab-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
  gap: 20px; /* Space between feature categories */
  margin-bottom: 30px;
}

.feature-category {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

.feature-category h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-category ul {
  list-style: none;
  padding-right: 20px;
}

.feature-category li {
  position: relative;
  margin-bottom: 8px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-category li::before {
  content: '✓';
  position: absolute;
  right: -20px;
  color: var(--success-color);
  font-weight: bold;
}

/* Stats styling */
.tab-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* More responsive stats grid */
  gap: 20px;
  margin: 30px 0;
  padding: 25px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color); /* Added border for consistency */
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Enhanced button styles */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  color: var(--text-light);
  padding: 15px 30px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--bg-secondary), var(--border-color));
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--border-color), var(--bg-secondary));
}

.iran-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.iran-btn:hover {
  background: linear-gradient(135deg, #ee5a24, #ff6b6b);
}

.premium-btn {
  background: linear-gradient(135deg, #ffd700, #ffb347);
  color: #8b4513;
}

.premium-btn:hover {
  background: linear-gradient(135deg, #ffb347, #ffd700);
}

/* Action buttons container */
.action-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 25px;
}

/* Guarantee badge */
.guarantee-badge {
  background: linear-gradient(135deg, var(--success-color), #2ecc71);
  color: white;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  text-align: center;
  margin: 20px 0;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Support section */
.support {
  background: var(--bg-primary);
  padding: 30px;
  border-radius: var(--border-radius-lg);
  text-align: center;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.support h3 {
  color: var(--text-primary);
  font-size: 1.4rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.support p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
}

.support a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.support a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* Footer styling */
footer {
  text-align: center;
  padding: 30px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
}

/* Responsive Design */
@media (min-width: 769px) {
  .tab-features {
    grid-template-columns: repeat(2, 1fr); /* 2x2 grid for larger screens */
  }
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  header {
    padding: 30px 20px;
    margin-bottom: 20px;
  }
  
  .header-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .cards-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .card-header {
    padding: 20px;
  }
  
  .card-content {
    padding: 20px;
  }
  
  .iran-stats, .card-stats {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 20px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    padding: 18px 20px;
  }
  
  .hero-icon {
    font-size: 2.5rem;
  }
  
  .hero-content h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  header {
    padding: 25px 15px;
  }
  
  .card-header h2 {
    font-size: 1.1rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
}



/* Loading states and micro-interactions */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Focus states for accessibility */
.btn:focus,
.card-header:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .btn,
  .mobile-toggle-icon {
    display: none;
  }
  
  .card-content {
    display: block !important;
    max-height: none !important;
    opacity: 1 !important;
  }
}
