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

body {
  font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  text-align: right;
  direction: rtl;
  overflow-x: hidden;
}

/* Main Container */
.main-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #581c87 50%, #0f172a 100%);
  position: relative;
}

/* Background Pattern */
.background-pattern {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 25%, rgba(156, 146, 172, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(156, 146, 172, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

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

/* دکمه خانه بزرگ و واضح */
.home-button-container {
  position: relative;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid rgba(16, 185, 129, 0.5);
}

.big-home-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border: none;
  border-radius: 0.75rem;
  padding: 1rem 2rem;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  position: relative;
  overflow: hidden;
  min-width: 250px;
}

.big-home-button::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.7s ease;
}

.big-home-button:hover::before {
  left: 100%;
}

.big-home-button:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(16, 185, 129, 0.6);
  background: linear-gradient(135deg, #059669, #0891b2);
}

.big-home-button:active {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.home-icon {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 0.3s ease;
}

.big-home-button:hover .home-icon {
  transform: scale(1.2);
}

/* Header Styles */
.header {
  text-align: center;
  padding: 4rem 1rem;
}

.header-content {
  max-width: 64rem;
  margin: 0 auto;
}

.main-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #10b981, #06b6d4, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}

.main-subtitle {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  color: #cbd5e1;
  margin-bottom: 2rem;
  line-height: 1.6;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.feature-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

.feature-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.badge-dot.emerald {
  background-color: #10b981;
}
.badge-dot.cyan {
  background-color: #06b6d4;
}
.badge-dot.blue {
  background-color: #3b82f6;
}

/* Main Content */
.main-content {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

/* Stats Section */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.stat-card:hover {
  border-color: rgba(71, 85, 105, 0.8);
  transform: translateY(-2px);
}

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

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: #94a3b8;
  font-weight: 500;
}

.stat-icon {
  padding: 0.75rem;
  border-radius: 0.75rem;
  transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.1);
}

.emerald-gradient {
  background: linear-gradient(to right, #10b981, #059669);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cyan-gradient {
  background: linear-gradient(to right, #06b6d4, #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blue-gradient {
  background: linear-gradient(to right, #3b82f6, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.emerald-bg {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.cyan-bg {
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}

.blue-bg {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

/* Filters Section */
.filters-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: border-color 0.3s ease;
}

.filters-card:hover {
  border-color: rgba(71, 85, 105, 0.8);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.filters-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-icon {
  padding: 0.5rem;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(236, 72, 153, 0.2));
  border-radius: 0.5rem;
}

.filters-title h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.toggle-btn:hover {
  color: #ffffff;
  background: rgba(71, 85, 105, 0.5);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.filter-badge:hover {
  background: rgba(16, 185, 129, 0.3);
}

.filter-badge button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.125rem;
  margin-right: 0.25rem;
}

.filters-content {
  margin-top: 1.5rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.filter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
}

.filter-select,
.filter-input {
  background: rgba(71, 85, 105, 0.5);
  border: 1px solid rgba(100, 116, 139, 0.5);
  border-radius: 0.5rem;
  color: #ffffff;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.filter-select:hover,
.filter-input:hover {
  border-color: rgba(100, 116, 139, 0.8);
}

.search-input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #94a3b8;
  pointer-events: none;
}

.search-input-wrapper .filter-input {
  padding-right: 2.5rem;
}

.filters-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(71, 85, 105, 0.5);
}

.btn-outline {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.5);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-outline:hover {
  background: rgba(71, 85, 105, 0.5);
  color: #ffffff;
}

.btn-primary {
  background: linear-gradient(to right, #10b981, #06b6d4);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(to right, #059669, #0891b2);
  box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.4);
}

/* Tabs Section */
.tabs-container {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 1rem;
  overflow: hidden;
}

.tabs-header {
  border-bottom: 1px solid rgba(71, 85, 105, 0.5);
  background: rgba(30, 41, 59, 0.3);
}

.tabs-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  max-width: 24rem;
  margin: 0 auto;
  padding: 0.25rem;
}

.tab-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.tab-button.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.5);
}

.tab-button:not(.active):hover {
  color: #ffffff;
  background: rgba(71, 85, 105, 0.3);
}

.tab-content {
  position: relative;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Map View */
.map-container {
  position: relative;
  height: 600px;
  width: 100%;
}

#map {
  height: 100%;
  width: 100%;
  z-index: 1;
}

/* List View */
#list-view {
  padding: 1.5rem;
}

.gyms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.gym-card {
  background: rgba(71, 85, 105, 0.3);
  border: 1px solid rgba(100, 116, 139, 0.5);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.gym-card:hover {
  border-color: rgba(100, 116, 139, 0.8);
  background: rgba(71, 85, 105, 0.5);
  transform: translateY(-2px);
}

.gym-card-header {
  padding: 1.25rem 1.25rem 0.75rem;
}

.gym-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.gym-card:hover .gym-card-title {
  color: #10b981;
}

.gym-card-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

.gym-card-content {
  padding: 0.75rem 1.25rem 1.25rem;
}

.gym-card-address {
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gym-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gym-type-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Loading States */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: #10b981;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loading-overlay p {
  color: #94a3b8;
  font-size: 0.875rem;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 1rem;
}

.no-results-content {
  max-width: 24rem;
  margin: 0 auto;
}

.no-results-icon {
  width: 6rem;
  height: 6rem;
  background: rgba(71, 85, 105, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.no-results-icon .icon {
  width: 3rem;
  height: 3rem;
  color: #64748b;
}

.no-results h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.no-results p {
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
}

/* Animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    padding: 2rem 1rem;
  }

  .main-content {
    padding: 0 1rem 2rem;
  }

  .stats-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

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

  .filters-actions {
    flex-direction: column;
  }

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

  .map-container {
    height: 400px;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 2rem;
  }

  .main-subtitle {
    font-size: 1rem;
  }

  .feature-badges {
    flex-direction: column;
    align-items: center;
  }

  .tabs-list {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.8);
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border: none;
}

.leaflet-popup-tip {
  background: #ffffff;
}

.leaflet-popup-content {
  margin: 0;
  padding: 0;
  font-family: "Vazirmatn", sans-serif;
}

.popup-content {
  padding: 1rem;
  text-align: right;
  direction: rtl;
  min-width: 200px;
}

.popup-content h3 {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.popup-content p {
  font-size: 0.875rem;
  color: #475569;
  margin-bottom: 0.25rem;
}

.popup-type-badge {
  display: inline-block;
  background: #dcfdf4;
  color: #065f46;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  margin-top: 0.5rem;
}

/* اضافه کردن انیمیشن به دکمه خانه */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0px);
  }
}

.big-home-button {
  animation: float 3s ease-in-out infinite;
}
