@import url("dark-theme.css");

/* Base styles */
body {
  font-family: 'Vazirmatn', serif;
  background-color: #f9fafb;
  color: #111827;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Nav dropdown */
.nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 12rem;
  border-radius: 0.5rem;
  background-color: #fff;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  border: 1px solid rgb(0 0 0 / 0.05);
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 50;
}

/* Mega nav button (shared) */
.mega-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
}
.mega-nav-btn:hover {
  color: #2563eb;
  background-color: rgba(59, 130, 246, 0.06);
}
.mega-nav-btn-highlight {
  color: #7c3aed;
}
.mega-nav-btn-highlight:hover {
  color: #6d28d9;
  background-color: rgba(124, 58, 237, 0.06);
}

/* Nav text labels */
.mega-nav-labels {
  display: flex;
  align-items: center;
  gap: 0;
}
.mega-nav-label {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.mega-nav-label:hover {
  color: #2563eb;
  background-color: rgba(59, 130, 246, 0.06);
}
.mega-nav-label::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0.75rem;
  left: 0.75rem;
  height: 2px;
  background: #2563eb;
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.mega-nav-label:hover::after,
.mega-nav-trigger:hover .mega-nav-label:hover::after {
  transform: scaleX(1);
}

/* Mega nav trigger */
.mega-nav-trigger {
  position: relative;
}

/* Mega nav panel — simple dropdown */
.mega-nav-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0;
  padding-top: 12px;
  z-index: 50;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s;
}
.mega-nav-trigger:hover > .mega-nav-panel,
.mega-nav-panel:hover {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.mega-nav-panel-inner {
  width: 240px;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 0 0 1px rgb(0 0 0 / 0.05);
  padding: 0.375rem;
  overflow: hidden;
}
.mega-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.mega-nav-trigger:hover .mega-chevron {
  transform: rotate(180deg);
}

/* Promo section — subtle */
.mega-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
.mega-promo-content {
  flex: 1;
}
.mega-promo-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}
.mega-promo-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}
.mega-promo-desc {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.625rem;
}
.mega-promo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2563eb;
  padding: 0.375rem 0.75rem;
  background: #eff6ff;
  border-radius: 0.375rem;
  transition: background 0.2s ease;
}
.mega-promo-link:hover {
  background: #dbeafe;
}
.mega-promo-icon {
  opacity: 0.08;
  color: #2563eb;
  margin-left: 1rem;
}

/* Mega cat items (dropdown list) */
.mega-cat-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mega-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  color: #475569;
  border-radius: 0.375rem;
  transition: all 0.15s ease;
  text-decoration: none;
}
.mega-cat-item:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.mega-free-badge {
  font-size: 0.5rem;
  font-weight: 600;
  color: #16a34a;
  background: #f0fdf4;
  padding: 0.0625rem 0.25rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Bottom link in dropdown */
.mega-bottom-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  border-top: 1px solid #f3f4f6;
  margin-top: 0.25rem;
  padding-top: 0.625rem;
  border-radius: 0;
  transition: color 0.15s ease;
  text-decoration: none;
}
.mega-bottom-link:hover {
  color: #2563eb;
}


/* Mobile menu */
.mobile-menu {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 18rem;
  background-color: #fff;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.3s;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.mobile-menu.show {
  transform: translateX(0);
}
.mobile-menu .mobile-menu-header {
  flex-shrink: 0 !important;
}
.mobile-menu .mobile-menu-scroll {
  flex: 1 !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  -webkit-overflow-scrolling: touch;
}
/* Override the mobile menu to be hidden on desktop */
@media (min-width: 1024px) {
    #mobileMenu.mobile-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transform: none !important;
        right: -9999px !important;
    }
}

/* Make sure mobile menu is visible on mobile but hidden by default */
@media (max-width: 1023px) {
    #mobileMenu.mobile-menu {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateX(100%);
        right: 0 !important;
    }
    
    #mobileMenu.mobile-menu.show {
        transform: translateX(0) !important;
    }
}
/* Glass card */
.glass-card {
  border-radius: 1rem;
  background-color: rgb(255 255 255 / 0.7);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Primary button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background-color: #2c5bb8;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  transition: all 0.2s ease;
}
.btn-primary:hover {
  background-color: #244895;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(44 91 184 / 0.3);
}
.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3d74d4;
}
.btn-primary:active {
  transform: translateY(0);
}

/* Outline button */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid #2c5bb8;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2c5bb8;
  transition: all 0.2s ease;
}
.btn-outline:hover {
  background-color: #f0f5ff;
  transform: translateY(-1px);
}
.btn-outline:focus {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3d74d4;
}
.btn-outline:active {
  transform: translateY(0);
}

/* Input field */
.input-field {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: #fff;
  padding: 0.75rem 1rem;
  line-height: 1.5;
  font-size: 0.875rem;
  color: #111827;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.input-field::placeholder {
  color: #9ca3af;
}
.input-field:focus {
  border-color: #3d74d4;
  outline: none;
  box-shadow: 0 0 0 3px rgb(61 116 212 / 0.15);
}

/* Notification enter animation */
.notification-enter {
  animation: notificationSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes notificationSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Modern select */
.modern-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1.5px solid #d1d5db;
  background-color: #f9fafb;
  font-weight: 600;
  font-size: 0.875rem;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.5;
  width: 100%;
}
.modern-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background-color: #fff;
}

/* Text balance */
.text-balance {
  text-wrap: balance;
}

/* Admin panel mobile */
@media (max-width: 1023px) {
  .admin-topbar {
    padding-left: 3.5rem;
  }
}

/* Spin animation for loading states */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 1s linear infinite;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #2c5bb8;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(44, 91, 184, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 40;
  cursor: pointer;
  border: none;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: #244895;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(44, 91, 184, 0.4);
}
