/**
 * BestSEOTool - Custom Enhancements & Responsive Layout Architecture
 */

/* Theme Variables (dynamically overridden by header.php if set in Admin Customizer) */
:root {
  --primary-color: #4F46E5;
  --primary-hover: #4338CA;
  --accent-color: #F59E0B;
}

.hero-glow {
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
}

/* ==========================================================================
   Overtake CTA Banner - Bulletproof Responsive Layout
   ========================================================================== */
.overtake-banner {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%) !important;
  color: #FFFFFF !important;
  border-radius: 0.875rem !important;
  padding: 1.25rem 1.5rem !important;
  box-shadow: 0 10px 25px -5px rgba(30, 27, 75, 0.4) !important;
  border: 1px solid #3730A3 !important;
  width: 100% !important;
  max-width: 44rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.overtake-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
  width: 100% !important;
  align-items: stretch !important;
}

@media (min-width: 640px) {
  .overtake-container {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1.5rem !important;
  }
}

.overtake-info {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  text-align: left !important;
}

.overtake-cta {
  flex: 0 0 auto !important;
  width: 100% !important;
}

@media (min-width: 640px) {
  .overtake-cta {
    width: auto !important;
  }
}

.overtake-cta .btn {
  width: 100% !important;
  white-space: nowrap !important;
  padding: 0.625rem 1.25rem !important;
}

@media (min-width: 640px) {
  .overtake-cta .btn {
    width: auto !important;
  }
}

/* ==========================================================================
   Featured #1 Spotlight Card - Bulletproof Responsive Layout
   ========================================================================== */
.featured-glow {
  background: #FFFFFF !important;
  border: 2px solid #818CF8 !important;
  border-radius: 1rem !important;
  padding: 1.5rem !important;
  box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.25) !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 48rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.featured-card-inner {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
  align-items: center !important;
  width: 100% !important;
}

@media (min-width: 768px) {
  .featured-card-inner {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 2rem !important;
  }
}

.featured-details-wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 1rem !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
}

@media (min-width: 640px) {
  .featured-details-wrapper {
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    gap: 1.25rem !important;
  }
}

.featured-logo-box {
  position: relative !important;
  flex-shrink: 0 !important;
}

.featured-logo-box img {
  width: 4.25rem !important;
  height: 4.25rem !important;
  border-radius: 1rem !important;
  object-fit: cover !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
  display: block !important;
}

.featured-content-box {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
}

.featured-actions-wrapper {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  width: 100% !important;
  flex-shrink: 0 !important;
}

@media (min-width: 768px) {
  .featured-actions-wrapper {
    width: 10.5rem !important;
  }
}

.featured-actions-wrapper .btn {
  width: 100% !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

/* Enforce SVG sizing inside all buttons and cards so icons never explode */
.btn svg, button svg, a svg, .featured-glow svg {
  max-width: 1.25rem !important;
  max-height: 1.25rem !important;
  width: 1rem !important;
  height: 1rem !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background: #FFFFFF;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.25s ease;
  transform: translateY(20px);
  opacity: 0;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Tab active state */
.tab-btn.active {
  background-color: var(--primary-color, #4F46E5) !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.table th, .table td {
  vertical-align: middle;
}

/* ==========================================================================
   Mobile-Optimized Leaderboard Table (100% Fit with No Clipping)
   ========================================================================== */
.rank-col {
  width: 5rem;
}

.bid-col {
  width: 8.5rem;
}

.action-col {
  width: 7.5rem;
}

.tool-logo {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  object-fit: cover;
}

@media (max-width: 640px) {
  .table-responsive {
    overflow-x: hidden !important;
  }

  .table {
    width: 100% !important;
    table-layout: fixed !important;
  }

  .table th, .table td {
    padding: 0.625rem 0.25rem !important;
    font-size: 0.75rem !important;
  }

  .rank-col {
    width: 2.25rem !important;
    max-width: 2.25rem !important;
    padding-left: 0.25rem !important;
    padding-right: 0.125rem !important;
  }

  .rank-badge {
    width: 1.625rem !important;
    height: 1.625rem !important;
    font-size: 0.7rem !important;
    line-height: 1.625rem !important;
  }

  .tool-logo {
    width: 2.25rem !important;
    height: 2.25rem !important;
    border-radius: 0.5rem !important;
  }

  .tool-info-col {
    width: auto !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }

  .bid-col {
    width: 4.5rem !important;
    max-width: 4.5rem !important;
    padding-left: 0.125rem !important;
    padding-right: 0.25rem !important;
  }

  .action-col {
    width: 3.75rem !important;
    max-width: 3.75rem !important;
    padding-left: 0.125rem !important;
    padding-right: 0.25rem !important;
  }

  .action-col .btn {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.7rem !important;
    border-radius: 0.375rem !important;
  }
}

/* ==========================================================================
   Dark / Light Mode Architecture & Theme Toggle Icons
   ========================================================================== */
.theme-toggle-btn {
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.theme-toggle-btn svg {
  pointer-events: none !important;
}

html.dark .theme-sun-icon {
  display: inline-block !important;
}
html.dark .theme-moon-icon {
  display: none !important;
}
html:not(.dark) .theme-sun-icon {
  display: none !important;
}
html:not(.dark) .theme-moon-icon {
  display: inline-block !important;
}

/* Logo switching for dark / light modes */
.dark-logo { display: none !important; }
.light-logo { display: inline-block !important; }
html.dark .dark-logo { display: inline-block !important; }
html.dark .light-logo { display: none !important; }

/* Dark Mode Tailwind-Equivalent Utility Classes */
html.dark .dark\:hidden { display: none !important; }
html.dark .dark\:block { display: block !important; }
html.dark .dark\:inline-block { display: inline-block !important; }
html.dark .dark\:flex { display: flex !important; }
html:not(.dark) .dark\:block { display: none !important; }
html:not(.dark) .dark\:flex { display: none !important; }

html.dark .dark\:text-white { color: #FFFFFF !important; }
html.dark .dark\:text-slate-200 { color: #E2E8F0 !important; }
html.dark .dark\:text-slate-300 { color: #CBD5E1 !important; }
html.dark .dark\:text-slate-400 { color: #94A3B8 !important; }
html.dark .dark\:text-slate-500 { color: #64748B !important; }
html.dark .dark\:text-indigo-400 { color: #818CF8 !important; }
html.dark .dark\:bg-slate-900 { background-color: #0F172A !important; }
html.dark .dark\:bg-slate-800 { background-color: #1E293B !important; }
html.dark .dark\:bg-slate-800\/50 { background-color: rgba(30, 41, 59, 0.5) !important; }
html.dark .dark\:bg-slate-800\/60 { background-color: rgba(30, 41, 59, 0.6) !important; }
html.dark .dark\:hover\:bg-slate-800:hover { background-color: #1E293B !important; }
html.dark .dark\:hover\:text-white:hover { color: #FFFFFF !important; }
html.dark .dark\:hover\:text-indigo-400:hover { color: #818CF8 !important; }
html.dark .dark\:border-slate-800 { border-color: #1E293B !important; }
html.dark .dark\:border-slate-700 { border-color: #334155 !important; }
html.dark .dark\:border-indigo-800 { border-color: #3730A3 !important; }
html.dark .dark\:border-indigo-900\/60 { border-color: rgba(49, 46, 129, 0.6) !important; }
html.dark .dark\:divide-slate-800 > :not([hidden]) ~ :not([hidden]) { border-color: #1E293B !important; }

/* Dark Mode Surfaces, Text & Components */
html.dark {
  color-scheme: dark;
  background-color: #0B0F19 !important;
  color: #F1F5F9 !important;
}

html.dark body {
  background-color: #0B0F19 !important;
  color: #E2E8F0 !important;
}

html.dark header {
  background-color: #0F172A !important;
  border-color: #1E293B !important;
}

html.dark #mobile-menu {
  background-color: #0F172A !important;
  border-color: #1E293B !important;
}

html.dark footer {
  background-color: #0B0F19 !important;
  border-color: #1E293B !important;
}

html.dark section.bg-white,
html.dark .card,
html.dark .bg-white {
  background-color: #111827 !important;
  border-color: #1F2937 !important;
  color: #E2E8F0 !important;
}

html.dark section.bg-slate-50,
html.dark .bg-slate-50 {
  background-color: #0B0F19 !important;
  border-color: #1F2937 !important;
}

html.dark .bg-slate-100 {
  background-color: #1E293B !important;
}

html.dark .bg-slate-200 {
  background-color: #1F2937 !important;
}

html.dark .tab-btn:not(.active) {
  color: #94A3B8 !important;
}

html.dark .tab-btn:not(.active):hover {
  color: #FFFFFF !important;
}

html.dark .border-slate-200,
html.dark .border-slate-100,
html.dark .border-slate-300 {
  border-color: #1F2937 !important;
}

html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6 {
  color: #F8FAFC !important;
}

html.dark .text-slate-700 {
  color: #CBD5E1 !important;
}

html.dark .text-slate-600 {
  color: #94A3B8 !important;
}

html.dark .text-slate-500,
html.dark .text-slate-400 {
  color: #64748B !important;
}

html.dark .bg-indigo-50 {
  background-color: rgba(99, 102, 241, 0.15) !important;
  color: #A5B4FC !important;
}

html.dark .border-indigo-200 {
  border-color: rgba(99, 102, 241, 0.3) !important;
}

html.dark .text-indigo-700 {
  color: #A5B4FC !important;
}

html.dark .bg-emerald-50 {
  background-color: rgba(16, 185, 129, 0.15) !important;
}

html.dark .bg-amber-50 {
  background-color: rgba(245, 158, 11, 0.15) !important;
}

/* Dark Mode Tables & Leaderboard Entries */
html.dark .table {
  color: #E2E8F0 !important;
  background-color: #111827 !important;
}

html.dark .table th {
  background-color: #0F172A !important;
  color: #94A3B8 !important;
  border-color: #1E293B !important;
}

html.dark .table td {
  border-color: #1E293B !important;
  background-color: transparent !important;
}

/* Fix row hover in dark mode (override style.css .table tr:hover td) */
html.dark .table tr:hover td,
html.dark .table tbody tr:hover td,
html.dark tr.hover\:bg-slate-50:hover td,
html.dark tr:hover td {
  background-color: #1E293B !important;
}

/* Tool Name & Links in Dark Mode (Highest specificity) */
html.dark .tool-info-col a,
html.dark .tool-info-col a.text-slate-900,
html.dark .tool-info-col a:visited,
html.dark .table a.text-slate-900,
html.dark a.text-slate-900,
html.dark .text-slate-900 {
  color: #F8FAFC !important;
}

html.dark .tool-info-col a:hover,
html.dark .table a.text-slate-900:hover,
html.dark a.text-slate-900:hover {
  color: #818CF8 !important;
}

/* Tool Short Description in Dark Mode */
html.dark .tool-info-col p,
html.dark .tool-info-col .text-slate-500 {
  color: #94A3B8 !important;
}

/* Bid Amount in Dark Mode */
html.dark .bid-col,
html.dark .bid-col div,
html.dark .bid-col .font-extrabold,
html.dark .bid-col .text-slate-900 {
  color: #F8FAFC !important;
}

html.dark .bid-col .text-slate-400 {
  color: #94A3B8 !important;
}

/* Action Links in Dark Mode */
html.dark .action-col a.text-indigo-600 {
  color: #818CF8 !important;
}

html.dark .action-col a.text-indigo-600:hover {
  color: #A5B4FC !important;
}

/* Standard Rank Badges in Dark Mode */
html.dark .rank-standard {
  background-color: #1E293B !important;
  color: #94A3B8 !important;
  border-color: #334155 !important;
}

/* Dark Mode Forms & Inputs */
html.dark .form-control,
html.dark .form-input,
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="password"],
html.dark input[type="number"],
html.dark input[type="url"],
html.dark select,
html.dark textarea {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748B !important;
}

/* Dark Mode Buttons & Badges */
html.dark .btn-secondary {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

html.dark .btn-secondary:hover {
  background-color: #334155 !important;
  color: #FFFFFF !important;
}

html.dark .badge-slate {
  background-color: #1E293B !important;
  color: #94A3B8 !important;
}

html.dark .badge-indigo {
  background-color: rgba(99, 102, 241, 0.2) !important;
  color: #A5B4FC !important;
}

html.dark .badge-amber {
  background-color: rgba(245, 158, 11, 0.2) !important;
  color: #FCD34D !important;
}

/* Dark Mode Special Elements */
html.dark .featured-glow {
  background: #111827 !important;
  border-color: #4F46E5 !important;
  box-shadow: 0 10px 30px -5px rgba(79, 70, 229, 0.35) !important;
}

html.dark .hero-glow {
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.22) 0%, rgba(11, 15, 25, 0) 70%) !important;
}

html.dark .toast {
  background-color: #1E293B !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}

html.dark .toast div {
  color: #F8FAFC !important;
}

html.dark #daily-reset-notice {
  background-color: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #FCD34D !important;
}

