/* Base Layout Resets & Interactive Enhancements */
html {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid #6366F1;
  outline-offset: 4px;
}

/* Glassmorphic Smooth Visual Foundations */
.glass-panel {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.dark .glass-panel {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Google AdSense Explicit Dimension Allocations to Safeguard Core Web Vitals */
.adsense-container {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

/* Custom Webkit scrollbars across layouts */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background-color: #F1F5F9;
}

.dark ::-webkit-scrollbar-track {
  background-color: #0F172A;
}

::-webkit-scrollbar-thumb {
  background-color: #CBD5E1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #94A3B8;
}

.dark ::-webkit-scrollbar-thumb {
  background-color: #334155;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background-color: #475569;
}

/* GPU Accelerated Micro-Transitions Layer */
.tool-card-interactive {
  transform: translateZ(0);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-card-interactive:hover {
  transform: translateY(-2px);
}

/* ============================================================================
   ADDITIONAL STYLING FOR ENHANCED TOOLS (Optional)
   ============================================================================ */

/* Percentage calculator - color-coded results */
.percentage-positive {
  color: #10B981;
}

.percentage-negative {
  color: #EF4444;
}

.dark .percentage-positive {
  color: #34D399;
}

.dark .percentage-negative {
  color: #F87171;
}

/* Toast notification enhancements */
.toast-success {
  background-color: #1E293B;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.dark .toast-success {
  background-color: #312E81;
}

.toast-error {
  background-color: #E11D48;
}

/* Quick tax buttons hover */
.quick-tax-btn:hover {
  background-color: #E0E7FF;
}

.dark .quick-tax-btn:hover {
  background-color: rgba(99, 102, 241, 0.2);
}

/* Case converter button active state */
.case-btn:active {
  transform: scale(0.95);
}

/* JSON status indicators */
.json-valid {
  color: #059669;
}

.dark .json-valid {
  color: #34D399;
}

.json-invalid {
  color: #DC2626;
}

.dark .json-invalid {
  color: #F87171;
}

/* Image converter drop zone hover */
#drop-zone.drag-over {
  border-color: #6366F1;
  background-color: rgba(99, 102, 241, 0.05);
}

/* Responsive adjustments for small screens */
@media (max-width: 640px) {
  .tool-card-interactive {
    transform: none;
  }

  .tool-card-interactive:hover {
    transform: translateY(-1px);
  }
}

/* Print styles */
@media print {
  .adsense-container {
    display: none !important;
  }

  #toast-dispatch-stack {
    display: none !important;
  }

  header,
  footer {
    position: static !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :focus-visible {
    outline: 3px solid #4F46E5;
    outline-offset: 2px;
  }

  .tool-card-interactive {
    border-width: 2px;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .tool-card-interactive {
    transform: none !important;
  }

  .tool-card-interactive:hover {
    transform: none !important;
  }
}

/* ============================================================
   GRADIENT BAR
   ============================================================ */
.gradient-bar {
  background: linear-gradient(to right, #6366F1, #8B5CF6, #06B6D4);
  height: 6px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* ============================================================
   THEME TOGGLE ICONS - FIXED
   ============================================================ */
/* Hide both icons by default, show the correct one */
#theme-toggle-dark-icon,
#theme-toggle-light-icon {
  display: none !important;
}

/* When dark mode is active, show the sun icon (to switch to light) */
html.dark #theme-toggle-light-icon {
  display: inline-block !important;
}

/* When light mode is active, show the moon icon (to switch to dark) */
html:not(.dark) #theme-toggle-dark-icon {
  display: inline-block !important;
}
