/* ========================================
   MT4 Plugins Platform - Dark Theme CSS
   ======================================== */

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  background: #0a0f1c;
  color: #e2e8f0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Focus States */
.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  outline: none;
}

/* Dark Mode Toggle Switch - make checked/unchecked clearly distinguishable */
.form-switch .form-check-input {
  background-color: #374151;
  border-color: #4b5563;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%239ca3af'/%3e%3c/svg%3e");
}
.form-switch .form-check-input:checked {
  background-color: #10b981;
  border-color: #10b981;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* Links */
a {
  color: #10b981;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #34d399;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0f1c; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* Max height for dropdowns */
.max-h-64 { max-height: 16rem; }

/* SVG Icons */
svg {
  max-width: 100%;
  height: auto;
}

/* Validation messages */
.field-validation-error {
  color: #f87171;
  font-size: 0.8rem;
  margin-top: 4px;
}

.validation-summary-errors {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fca5a5;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.validation-summary-valid {
  display: none;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 1rem;
}

/* Hero Section */
.hero-showcase {
  position: relative;
  overflow: hidden;
  background-size: 200% 200%;
  animation: heroGradient 14s ease-in-out infinite;
}

.hero-showcase > div {
  position: relative;
  z-index: 1;
}

.hero-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px circle at 18% 28%, rgba(16, 185, 129, 0.12), transparent 60%),
    radial-gradient(520px circle at 78% 35%, rgba(16, 185, 129, 0.08), transparent 60%),
    radial-gradient(760px circle at 55% 88%, rgba(5, 150, 105, 0.12), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 18px);
  opacity: 0.95;
  pointer-events: none;
}

.hero-showcase::after {
  content: "";
  position: absolute;
  inset: -25%;
  background: radial-gradient(closest-side, rgba(16, 185, 129, 0.1), transparent 65%);
  filter: blur(32px);
  transform: translate3d(-12%, -8%, 0) scale(1);
  animation: heroFloat 10s ease-in-out infinite;
  pointer-events: none;
}

.hero-showcase h1 {
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-showcase p {
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.hero-fade-up {
  opacity: 0;
  transform: translateY(10px);
  animation: heroFadeUp 700ms ease-out forwards;
}

.hero-delay-1 { animation-delay: 120ms; }
.hero-delay-2 { animation-delay: 240ms; }

.hero-btn {
  transform: translateZ(0);
  will-change: transform, box-shadow;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgba(16, 185, 129, 0.2);
}

.hero-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(16, 185, 129, 0.15);
}

@keyframes heroGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes heroFloat {
  0%, 100% { transform: translate3d(-12%, -8%, 0) scale(1); }
  50% { transform: translate3d(10%, 6%, 0) scale(1.15); }
}

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero Particles */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-particles span {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(16, 185, 129, 0.4);
  border-radius: 50%;
  animation: particleDrift 18s linear infinite;
}

.hero-particles span:nth-child(1) { left: 8%; top: 20%; animation-delay: 0s; animation-duration: 22s; }
.hero-particles span:nth-child(2) { left: 18%; top: 65%; animation-delay: -3s; animation-duration: 19s; }
.hero-particles span:nth-child(3) { left: 32%; top: 35%; animation-delay: -6s; animation-duration: 24s; }
.hero-particles span:nth-child(4) { left: 45%; top: 80%; animation-delay: -2s; animation-duration: 20s; }
.hero-particles span:nth-child(5) { left: 55%; top: 15%; animation-delay: -8s; animation-duration: 26s; }
.hero-particles span:nth-child(6) { left: 68%; top: 50%; animation-delay: -4s; animation-duration: 21s; }
.hero-particles span:nth-child(7) { left: 78%; top: 25%; animation-delay: -10s; animation-duration: 23s; }
.hero-particles span:nth-child(8) { left: 88%; top: 70%; animation-delay: -5s; animation-duration: 25s; }
.hero-particles span:nth-child(9) { left: 25%; top: 90%; animation-delay: -7s; animation-duration: 18s; }
.hero-particles span:nth-child(10) { left: 72%; top: 85%; animation-delay: -1s; animation-duration: 27s; }

@keyframes particleDrift {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10% { opacity: 0.6; }
  50% { transform: translateY(-60px) translateX(15px) scale(1.3); opacity: 0.4; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-120px) translateX(-10px) scale(0.8); opacity: 0; }
}

/* Shimmer Effect */
.hero-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(16, 185, 129, 0.05) 35%,
    rgba(16, 185, 129, 0.1) 50%,
    rgba(16, 185, 129, 0.05) 65%,
    transparent 80%
  );
  background-size: 300% 100%;
  animation: shimmerSweep 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes shimmerSweep {
  0%, 100% { background-position: 200% 0; }
  50% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-showcase { animation: none; }
  .hero-showcase::after { animation: none; }
  .hero-fade-up { opacity: 1; transform: none; animation: none; }
  .hero-btn { transition: none; }
  .hero-particles span { animation: none; opacity: 0.3; }
  .hero-shimmer { animation: none; opacity: 0; }
}

/* Language selector fixes */
.language-selector svg {
  width: 1rem !important;
  height: 1rem !important;
  flex-shrink: 0;
}

/* ===================================================================
   GLOBAL DARK THEME OVERRIDES
   Force dark theme on all remaining views with Tailwind-style light classes
   =================================================================== */

/* Override bg-white, bg-gray-50, bg-gray-100 everywhere */
.bg-white { background-color: rgba(30, 41, 59, 0.7) !important; backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.08); }
.bg-gray-50, .bg-gray-100 { background-color: rgba(15, 23, 42, 0.5) !important; }
.bg-gray-200 { background-color: rgba(51, 65, 85, 0.5) !important; }

/* Override text colors */
.text-gray-900, .text-gray-800 { color: #e2e8f0 !important; }
.text-gray-700, .text-gray-600 { color: #94a3b8 !important; }
.text-gray-500 { color: #64748b !important; }
.text-gray-400 { color: #475569 !important; }

/* Override borders */
.border-gray-200, .border-gray-300 { border-color: rgba(255,255,255,0.08) !important; }
.divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: rgba(255,255,255,0.08) !important; }

/* Override blue buttons with brand emerald */
.bg-blue-600 { background-color: #10b981 !important; }
.bg-blue-600:hover, .bg-blue-700, .hover\:bg-blue-700:hover { background-color: #059669 !important; }
.text-blue-600 { color: #10b981 !important; }
.text-blue-800 { color: #34d399 !important; }
.bg-blue-100 { background-color: rgba(16, 185, 129, 0.15) !important; }
.bg-blue-50 { background-color: rgba(16, 185, 129, 0.08) !important; }

/* Override yellow alert colors for dark mode */
.bg-yellow-50 { background-color: rgba(234, 179, 8, 0.1) !important; }
.border-yellow-200 { border-color: rgba(234, 179, 8, 0.25) !important; }
.text-yellow-800 { color: #fde047 !important; }

/* Override green text for dark mode */
.text-green-600, .text-green-500 { color: #34d399 !important; }

/* Override red alert colors for dark mode */
.text-red-600 { color: #f87171 !important; }
.bg-red-50 { background-color: rgba(239, 68, 68, 0.1) !important; }

/* Override alert boxes for dark theme */
.alert { background: rgba(30, 41, 59, 0.8); border: 1px solid rgba(255,255,255,0.1); color: #e2e8f0; border-radius: 0.75rem; padding: 1rem 1.25rem; }
.alert-success { background: rgba(16, 185, 129, 0.15) !important; border-color: rgba(16, 185, 129, 0.3) !important; color: #34d399 !important; }
.alert-danger { background: rgba(239, 68, 68, 0.15) !important; border-color: rgba(239, 68, 68, 0.3) !important; color: #f87171 !important; }
.alert-info { background: rgba(59, 130, 246, 0.15) !important; border-color: rgba(59, 130, 246, 0.3) !important; color: #93c5fd !important; }
.alert-warning { background: rgba(234, 179, 8, 0.15) !important; border-color: rgba(234, 179, 8, 0.3) !important; color: #fde047 !important; }

/* Override form inputs globally */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"],
input[type="tel"], input[type="url"], textarea, select {
    background-color: rgba(15, 23, 42, 0.8) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #e2e8f0 !important;
}
input::placeholder, textarea::placeholder { color: #475569 !important; }
input:focus, textarea:focus, select:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
    outline: none !important;
}

/* Override shadow cards */
.shadow, .shadow-sm, .shadow-md, .shadow-lg { box-shadow: 0 4px 24px rgba(0,0,0,0.3) !important; }
.rounded-lg, .rounded-xl { border-radius: 1rem; }

/* Container/layout */
.container { max-width: 80rem; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }

/* Override primary color classes */
.bg-primary-600, .bg-primary-500 { background-color: #10b981 !important; }
.bg-primary-600:hover, .hover\:bg-primary-700:hover { background-color: #059669 !important; }
.text-primary-600, .text-primary-500 { color: #10b981 !important; }
.text-primary-500:hover, .hover\:text-primary-400:hover { color: #34d399 !important; }
.ring-primary-500, .focus\:ring-primary-500:focus { --tw-ring-color: rgba(16, 185, 129, 0.4) !important; }
.border-primary-500, .focus\:border-primary-500:focus { border-color: #10b981 !important; }

/* Table dark theme */
table { color: #e2e8f0; }
th { color: #94a3b8; border-color: rgba(255,255,255,0.08); }
td { border-color: rgba(255,255,255,0.05); }

/* ===================================================================
   COMPONENT DESIGN SYSTEM (from Layout)
   Duplicated here so all views can use these classes
   =================================================================== */

/* Glassmorphism Card */
.glass-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

/* Gradient Brand Button */
.btn-brand {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-brand:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    color: white;
    text-decoration: none;
}

/* Secondary Button */
.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
}

/* Input Styling */
.input-dark {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: #e2e8f0;
    transition: all 0.2s;
    width: 100%;
}
.input-dark:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background: rgba(255, 255, 255, 0.08);
}
.input-dark::placeholder { color: #64748b; }

/* Badge */
.badge-brand {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Product Card */
.product-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    transition: all 0.3s ease;
    overflow: hidden;
}
.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Navigation */
.nav-dark {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-link-dark {
    color: #94a3b8;
    font-weight: 500;
    transition: color 0.2s;
    text-decoration: none;
}
.nav-link-dark:hover { color: #10b981; }
.nav-link-dark.active { color: #10b981; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0f1c; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* Brand color utilities */
.text-brand-400 { color: #34d399; }
.text-brand-500 { color: #10b981; }
.from-brand-400 { --tw-gradient-from: #34d399; }
.to-brand-600 { --tw-gradient-to: #059669; }
.from-brand-500\/80 { --tw-gradient-from: rgba(16,185,129,0.8); }
.shadow-brand-500\/20 { box-shadow: 0 10px 30px rgba(16,185,129,0.2); }

/* Hover utilities */
.hover\:text-brand-300:hover { color: #6ee7b7 !important; }
.hover\:text-brand-400:hover { color: #34d399 !important; }

/* No underline utility */
.no-underline { text-decoration: none !important; }
.no-underline:hover { text-decoration: none !important; }

/* ===================================================================
   CHECKOUT – Payment Option Dark Theme
   =================================================================== */
.payment-option {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    transition: all 0.25s ease !important;
}
.payment-option:hover {
    border-color: rgba(16, 185, 129, 0.45) !important;
    background: rgba(16, 185, 129, 0.08) !important;
}
.payment-option.selected,
.payment-option:has(input[type="radio"]:checked) {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.12) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15), 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

/* Radio button dark theme */
.payment-option input[type="radio"] {
    accent-color: #10b981;
    background-color: rgba(15, 23, 42, 0.8) !important;
}

/* Override gradient button in checkout */
.from-blue-600 { --tw-gradient-from: #10b981 !important; }
.to-indigo-600 { --tw-gradient-to: #059669 !important; }
.hover\:from-blue-700:hover { --tw-gradient-from: #059669 !important; }
.hover\:to-indigo-700:hover { --tw-gradient-to: #047857 !important; }
