/**
 * Suraj Transport - Core Theme Styles
 * 3D effects, glassmorphism, animations, and component styles
 * Module: UI Theme & Components
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-content-smoothing: grayscale;
  margin: 0 !important;
  padding: 0 !important;
}

body {
  font-family: var(--st-font-family);
  background-color: var(--st-bg-primary);
  color: var(--st-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--st-transition-normal),
    color var(--st-transition-normal);
}

/* Fix for flexbox gaps caused by scripts or other invisible tags */
body > script, 
body > style, 
body > noscript,
body > template {
  display: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}

/* Selection Styling */
::selection {
  background-color: var(--st-brand-primary-light);
  color: var(--st-brand-primary-dark);
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid var(--st-brand-primary);
  outline-offset: 2px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--st-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--st-brand-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--st-brand-primary-dark);
}

/* ============================================
   3D EFFECTS & PERSPECTIVE
   ============================================ */

.st-perspective-container {
  perspective: var(--st-perspective);
  transform-style: preserve-3d;
}

.st-preserve-3d {
  transform-style: preserve-3d;
}

.st-backface-hidden {
  backface-visibility: hidden;
}

/* 3D Card Effect */
.st-card-3d {
  transform-style: preserve-3d;
  transition: transform var(--st-transition-slow);
}

.st-card-3d:hover {
  transform: perspective(1000px) rotateX(var(--st-card-tilt-x)) rotateY(var(--st-card-tilt-y)) translateZ(var(--st-3d-depth));
}

/* 3D Button Press */
.st-btn-3d {
  transition: all var(--st-transition-fast);
  transform-style: preserve-3d;
}

.st-btn-3d:active {
  transform: translateZ(-10px) scale(0.98);
}

/* ============================================
   GLASSMORPHISM
   ============================================ */

.st-glass {
  background: var(--st-glass-bg);
  backdrop-filter: blur(var(--st-glass-blur));
  -webkit-backdrop-filter: blur(var(--st-glass-blur));
  border: 1px solid var(--st-glass-border);
}

.st-glass-strong {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

[data-theme="dark"] .st-glass-strong {
  background: rgba(31, 31, 31, 0.95);
}

/* ============================================
   SHADOWS & GLOWS
   ============================================ */

.st-shadow-3d {
  box-shadow: var(--st-shadow-3d);
}

.st-shadow-glow {
  box-shadow: var(--st-shadow-glow);
}

.st-glow-red {
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.3),
    0 0 40px rgba(220, 38, 38, 0.2);
}

.st-glow-red-intense {
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.5),
    0 0 60px rgba(220, 38, 38, 0.3);
}

/* ============================================
   GRADIENTS
   ============================================ */

.st-gradient-brand {
  background: linear-gradient(135deg,
      var(--st-brand-primary) 0%,
      var(--st-brand-coral) 100%);
}

.st-gradient-hero {
  background: linear-gradient(135deg,
      var(--st-brand-primary-light) 0%,
      #fff5f5 25%,
      #fff 50%,
      #fff7ed 75%,
      var(--st-brand-primary-light) 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

.st-gradient-text {
  background: linear-gradient(135deg,
      var(--st-brand-primary) 0%,
      var(--st-brand-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 40px rgba(220, 38, 38, 0.5);
    transform: scale(1.02);
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateIn3D {
  from {
    opacity: 0;
    transform: perspective(1000px) rotateY(-45deg);
  }

  to {
    opacity: 1;
    transform: perspective(1000px) rotateY(0);
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Animation Classes */
.st-animate-float {
  animation: float 4s ease-in-out infinite;
}

.st-animate-pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

.st-animate-shimmer {
  position: relative;
  overflow: hidden;
}

.st-animate-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.4),
      transparent);
  animation: shimmer 2s infinite;
}

.st-animate-slide-up {
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.st-animate-slide-down {
  animation: slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.st-animate-scale-in {
  animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.st-animate-rotate-in-3d {
  animation: rotateIn3D 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.st-animate-bounce-in {
  animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.st-animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.st-animate-spin {
  animation: spin 1s linear infinite;
}

/* Stagger Delays */
.st-stagger-1 {
  animation-delay: 0.1s;
}

.st-stagger-2 {
  animation-delay: 0.2s;
}

.st-stagger-3 {
  animation-delay: 0.3s;
}

.st-stagger-4 {
  animation-delay: 0.4s;
}

.st-stagger-5 {
  animation-delay: 0.5s;
}

.st-stagger-6 {
  animation-delay: 0.6s;
}

/* ============================================
   BUTTONS
   ============================================ */

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--st-font-family);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--st-radius-xl);
  border: none;
  cursor: pointer;
  transition: all var(--st-transition-normal);
  text-decoration: none;
}

.st-btn-primary {
  background: var(--st-brand-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

.st-btn-primary:hover {
  background: var(--st-brand-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}

.st-btn-secondary {
  background: var(--st-bg-secondary);
  color: var(--st-text-primary);
  border: 1px solid var(--st-border-light);
}

.st-btn-secondary:hover {
  background: var(--st-bg-tertiary);
  border-color: var(--st-border-medium);
}

.st-btn-ghost {
  background: transparent;
  color: var(--st-text-primary);
}

.st-btn-ghost:hover {
  background: var(--st-bg-secondary);
}

.st-btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.st-btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ============================================
   CARDS
   ============================================ */

.st-card {
  background: var(--st-bg-elevated);
  border-radius: var(--st-radius-2xl);
  border: 1px solid var(--st-border-light);
  overflow: hidden;
  transition: all var(--st-transition-normal);
}

.st-card:hover {
  border-color: var(--st-border-medium);
  box-shadow: var(--st-shadow-lg);
}

.st-card-header {
  padding: var(--st-spacing-lg);
  border-bottom: 1px solid var(--st-border-light);
}

.st-card-body {
  padding: var(--st-spacing-lg);
}

.st-card-footer {
  padding: var(--st-spacing-lg);
  border-top: 1px solid var(--st-border-light);
  background: var(--st-bg-secondary);
}

/* ============================================
   FORMS
   ============================================ */

.st-form-group {
  margin-bottom: var(--st-spacing-lg);
}

.st-form-label {
  display: block;
  margin-bottom: var(--st-spacing-sm);
  font-weight: 500;
  color: var(--st-text-primary);
}

.st-form-input,
.st-form-select,
.st-form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--st-font-family);
  font-size: 1rem;
  color: var(--st-text-primary);
  background: var(--st-bg-primary);
  border: 2px solid var(--st-border-light);
  border-radius: var(--st-radius-xl);
  transition: all var(--st-transition-fast);
}

.st-form-input:focus,
.st-form-select:focus,
.st-form-textarea:focus {
  outline: none;
  border-color: var(--st-brand-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.st-form-input::placeholder {
  color: var(--st-text-tertiary);
}

.st-form-error {
  border-color: var(--st-danger) !important;
}

.st-form-error-message {
  margin-top: var(--st-spacing-sm);
  font-size: 0.875rem;
  color: var(--st-danger);
}

/* ============================================
   BADGES
   ============================================ */

.st-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.st-badge-primary {
  background: var(--st-brand-primary-light);
  color: var(--st-brand-primary);
}

.st-badge-success {
  background: var(--st-success-light);
  color: var(--st-success);
}

.st-badge-warning {
  background: var(--st-warning-light);
  color: var(--st-warning);
}

.st-badge-info {
  background: var(--st-info-light);
  color: var(--st-info);
}

/* ============================================
   ALERTS
   ============================================ */

.st-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--st-spacing-md);
  padding: var(--st-spacing-lg);
  border-radius: var(--st-radius-xl);
  border: 1px solid transparent;
}

.st-alert-info {
  background: var(--st-info-light);
  border-color: var(--st-info);
  color: var(--st-info);
}

.st-alert-success {
  background: var(--st-success-light);
  border-color: var(--st-success);
  color: var(--st-success);
}

.st-alert-warning {
  background: var(--st-warning-light);
  border-color: var(--st-warning);
  color: var(--st-warning);
}

.st-alert-danger {
  background: var(--st-danger-light);
  border-color: var(--st-danger);
  color: var(--st-danger);
}

/* ============================================
   LOADING STATES
   ============================================ */

.st-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--st-border-light);
  border-top-color: var(--st-brand-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.st-skeleton {
  background: linear-gradient(90deg,
      var(--st-bg-secondary) 25%,
      var(--st-bg-tertiary) 50%,
      var(--st-bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--st-radius-md);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.st-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--st-spacing-lg);
}

.st-container-narrow {
  max-width: 800px;
}

.st-container-wide {
  max-width: 1440px;
}

.st-main {
  padding-top: 0;
  padding-bottom: 60px;
  min-height: calc(100vh - 80px);
}

.hidden {
  display: none !important;
}

.st-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.st-text-gradient {
  background: linear-gradient(135deg,
      var(--st-brand-primary) 0%,
      var(--st-brand-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.st-underline-animate {
  position: relative;
}

.st-underline-animate::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--st-brand-primary);
  transition: all var(--st-transition-normal);
  transform: translateX(-50%);
}

.st-underline-animate:hover::after {
  width: 100%;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 1024px) {
  .st-card-3d:hover {
    transform: translateY(-4px);
  }

  .st-hide-mobile {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .st-hide-desktop {
    display: none !important;
  }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.st-toast-container {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.st-toast {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  border-left: 4px solid var(--st-info);
}

.st-toast-show {
  transform: translateX(0);
  opacity: 1;
}

.st-toast-success {
  border-left-color: var(--st-success);
}

.st-toast-error {
  border-left-color: var(--st-danger);
}

.st-toast-warning {
  border-left-color: var(--st-warning);
}

.st-toast-info {
  border-left-color: var(--st-info);
}

.st-toast-message {
  font-weight: 600;
  color: var(--st-text-primary);
  font-size: 0.95rem;
}

.st-toast-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--st-text-tertiary);
  cursor: pointer;
}

.st-toast-close:hover {
  color: var(--st-danger);
}
.hidden { display: none !important; }
/* ============================================
   IMMERSIVE SPLASH SCREEN (Enterprise Native)
   ============================================ */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000; /* Instant black to prevent white flickers */
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
  background: #000;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.65) contrast(1.1);
  will-change: transform, opacity;
}

.splash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
}

.splash-content {
  text-align: center;
  z-index: 10;
  animation: splashContentUp 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes splashContentUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.splash-logo {
  height: 70px;
  margin-bottom: 30px;
}

.splash-loader-container {
  width: 140px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin: 0 auto 20px;
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(5px);
}

.splash-loader-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: #e31837;
  box-shadow: 0 0 15px #e31837;
  animation: splashLoadLoop 2s infinite ease-in-out;
}

@keyframes splashLoadLoop {
  0% { left: -40%; }
  50% { left: 100%; }
  100% { left: -40%; }
}

.splash-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.splash-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* --- Suraj Enterprise: Global Dark Mode Shield (Landing Page + Components) --- */
[data-theme="dark"] body {
  background-color: var(--st-bg-primary);
  color: var(--st-text-primary);
}

[data-theme="dark"] .st-section-light {
  background: var(--st-bg-primary) !important;
}

[data-theme="dark"] .st-section-gradient {
  background: linear-gradient(135deg, var(--st-bg-primary) 0%, var(--st-bg-secondary) 100%) !important;
}

[data-theme="dark"] .st-feature-card,
[data-theme="dark"] .st-calculator-card,
[data-theme="dark"] .premium-glass-card,
[data-theme="dark"] .st-glass,
[data-theme="dark"] .st-card-island {
  background: var(--st-bg-elevated) !important;
  border-color: var(--st-border-light) !important;
  box-shadow: var(--st-shadow-xl) !important;
}

[data-theme="dark"] .st-feature-title,
[data-theme="dark"] .st-section-title,
[data-theme="dark"] .st-calculator-header h3,
[data-theme="dark"] .st-form-label {
  color: var(--st-text-primary) !important;
}

[data-theme="dark"] .st-feature-desc,
[data-theme="dark"] .st-section-subtitle,
[data-theme="dark"] .st-calculator-header p,
[data-theme="dark"] .st-refund-desc {
  color: var(--st-text-secondary) !important;
}

[data-theme="dark"] .st-form-input,
[data-theme="dark"] .st-form-select,
[data-theme="dark"] .premium-glass-input {
  background: var(--st-bg-secondary) !important;
  border-color: var(--st-border-medium) !important;
  color: var(--st-text-primary) !important;
}

[data-theme="dark"] .st-feature-icon {
  background: rgba(227, 24, 55, 0.15) !important;
  box-shadow: none !important;
}

[data-theme="dark"] .st-animate-float {
  background: var(--st-bg-elevated) !important;
  color: var(--st-text-primary) !important;
  border-color: var(--st-border-light) !important;
}

[data-theme="dark"] .st-hero-fade,
[data-theme="dark"] .premium-hero-fade {
  background: linear-gradient(to top, var(--st-bg-primary) 0%, transparent 100%) !important;
}

[data-theme="dark"] .st-navbar {
  background: var(--st-bg-glass) !important;
  border-bottom-color: var(--st-border-light) !important;
}

[data-theme="dark"] .st-nav-link {
  color: var(--st-text-secondary) !important;
}

[data-theme="dark"] .st-nav-link:hover,
[data-theme="dark"] .st-nav-link.active {
  color: var(--st-brand-primary) !important;
}

[data-theme="dark"] #instant-app {
  background: linear-gradient(135deg, var(--st-bg-primary) 0%, var(--st-bg-secondary) 100%) !important;
}
