/*
 * Wexira Premium Dark Theme
 * Standardized CSS for White-on-Black Aesthetic
 * Version: 2.6.0
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --wexira-bg: #000000;
  --wexira-card-bg: rgba(17, 17, 17, 0.7);
  --wexira-border: rgba(51, 51, 51, 0.5);
  --wexira-text-primary: #ffffff;
  --wexira-text-secondary: #a1a1aa;
  --wexira-accent: #6366f1; /* Indigo 500 */
  --wexira-accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --wexira-glass-border: rgba(255, 255, 255, 0.1);
}

/* 1. Reset Font declarations to resolve 404 errors */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Inter'), local('sans-serif'); /* Fallback to Inter to fix 404s */
}

body {
  font-family: 'Outfit', 'Inter', sans-serif !important;
  background-color: var(--wexira-bg) !important;
  color: var(--wexira-text-primary) !important;
  -webkit-font-smoothing: antialiased;
}

/* 2. Global UI Cleanup */
#back-to-grid, #back-to-tools {
  display: none !important;
}

.in-iframe nav,
.in-iframe footer,
.in-iframe section,
.in-iframe #donation-ribbon {
  display: none !important;
}

.in-iframe body {
  background: transparent !important;
}

/* 3. Containers & Card Glassmorphism */
#app, #uploader, .min-h-screen {
  background-color: var(--wexira-bg) !important;
}

#tool-uploader, #tool-interface, .bg-gray-800, .bg-gray-900 {
  background-color: var(--wexira-card-bg) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid var(--wexira-glass-border) !important;
  border-radius: 1rem !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

/* 4. Inputs & Search Bar */
#search-bar {
  background-color: rgba(31, 31, 31, 0.8) !important;
  backdrop-filter: blur(4px) !important;
  color: #fff !important;
  border: 1px solid var(--wexira-border) !important;
  padding: 0.75rem 1.25rem !important;
  transition: all 0.3s ease !important;
}

#search-bar:focus {
  border-color: var(--wexira-accent) !important;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2) !important;
}

/* 5. Tool Grid Refinement */
#tool-grid > a, #tool-grid > div {
  background: linear-gradient(145deg, #0a0a0a, #111111) !important;
  border: 1px solid var(--wexira-border) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden !important;
}

#tool-grid > a:hover {
  transform: translateY(-8px) !important;
  border-color: var(--wexira-accent) !important;
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.3) !important;
}

#tool-grid h3 {
  color: #fff !important;
  font-weight: 600 !important;
}

#tool-grid p {
  color: var(--wexira-text-secondary) !important;
}

/* 6. Buttons & Interactive Elements */
.btn-gradient, #process-btn, #add-rule-btn {
  background: var(--wexira-accent-gradient) !important;
  border: none !important;
  font-weight: 600 !important;
  letter-spacing: 0.025em !important;
  transition: all 0.3s ease !important;
  color: #fff !important;
}

.btn-gradient:hover, #process-btn:hover {
  filter: brightness(1.1) !important;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4) !important;
  transform: scale(1.02) !important;
}

/* 7. Drop Zone Enhancement */
#drop-zone {
  background-color: rgba(10, 10, 10, 0.5) !important;
  border: 2px dashed rgba(99, 102, 241, 0.4) !important;
  transition: all 0.3s ease !important;
}

#drop-zone:hover {
  border-color: var(--wexira-accent) !important;
  background-color: rgba(99, 102, 241, 0.05) !important;
}

#drop-zone i, #drop-zone svg {
  color: var(--wexira-accent) !important;
  stroke: var(--wexira-accent) !important;
}

/* 8. Text Visibility Overrides */
h1, h2, h3, .text-white {
  color: #ffffff !important;
}

p, span, label {
  color: var(--wexira-text-secondary) !important;
}

.text-gray-200, .text-gray-300, .text-gray-400 {
  color: var(--wexira-text-secondary) !important;
}

/* 9. Specialized Controls (e.g., checkboxes, selectors) */
input[type="checkbox"] {
  accent-color: var(--wexira-accent) !important;
}

.rounded-lg.border.border-indigo-700\/40 {
  background-color: rgba(99, 102, 241, 0.05) !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
  backdrop-filter: blur(8px) !important;
}

/* 10. Modals & Alerts */
#loader-modal, #alert-modal {
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  background-color: rgba(0, 0, 0, 0.8) !important;
}

#loader-modal > div, #alert-modal > div {
  background-color: #0c0c0c !important;
  border: 1px solid var(--wexira-glass-border) !important;
  box-shadow: 0 0 50px rgba(0, 0, 0, 1) !important;
  border-radius: 1.25rem !important;
}

/* Solid Spinner Refinement */
.solid-spinner {
  border: 3px solid rgba(99, 102, 241, 0.1);
  border-top: 3px solid var(--wexira-accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* 11. Custom Scrollbar for Dark Theme */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #000;
}
::-webkit-scrollbar-thumb {
  background: #222;
  border-radius: 5px;
  border: 2px solid #000;
}
::-webkit-scrollbar-thumb:hover {
  background: #333;
}
