/* ===============================================
   STAR NEWS - PROFESSIONAL THEME SYSTEM
   Two themes: Professional & Vibrant
   =============================================== */

/* === BASE VARIABLES === */
:root {
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* === PROFESSIONAL THEME (Default) === */
[data-theme="professional"],
:root {
  /* Primary Colors - Professional Blue & Navy */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #60a5fa;
  --primary-dark: #1d4ed8;

  /* Secondary Colors - Sophisticated Teal */
  --secondary: #06b6d4;
  --secondary-hover: #0891b2;
  --secondary-light: #22d3ee;

  /* Accent Colors - Warm Coral for highlights */
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-light: #fb923c;

  /* Neutrals - Dark Professional (Slate) */
  --background: #0f172a;
  --foreground: #f8fafc;
  --surface: #1e293b;
  --surface-hover: #334155;
  --surface-raised: #1e293b;

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-dim: #64748b;

  /* Borders */
  --border: #334155;
  --border-hover: #475569;
  --border-focus: #3b82f6;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.15);

  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Brand-specific */
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-blue: #3b82f6;

  --metal-dark: #334155;
  --carbon-dark: #1e293b;

  /* Glow Colors */
  --glow-start: rgba(59, 130, 246, 0.5);
  --glow-mid: rgba(59, 130, 246, 0.8);
}

/* === VIBRANT THEME (Original) === */
[data-theme="vibrant"] {
  /* Vibrant Colors - Original scheme */
  --primary: #ff0055;
  --primary-hover: #d60047;
  --primary-light: #ff1a6b;
  --primary-dark: #c00041;

  --secondary: #00e5ff;
  --secondary-hover: #00c7e6;
  --secondary-light: #1aebff;

  --accent: #7000ff;
  --accent-hover: #5c00cc;
  --accent-light: #8a1aff;

  /* Dark backgrounds */
  --background: #0a0a0a;
  --foreground: #ededed;
  --surface: #1a1a1a;
  --surface-hover: #2a2a2a;
  --surface-raised: #2a2a2a;

  /* Text Colors */
  --text-primary: #ededed;
  --text-secondary: #b0b0b0;
  --text-tertiary: #808080;
  --text-dim: #666666;

  /* Borders */
  --border: #333333;
  --border-hover: #444444;
  --border-focus: #ff0055;

  /* Shadows - Vibrant glows */
  --shadow-sm: 0 0 5px rgba(255, 0, 85, 0.2);
  --shadow-md: 0 4px 14px 0 rgba(255, 0, 85, 0.3);
  --shadow-lg: 0 10px 40px rgba(255, 0, 85, 0.4);
  --shadow-xl: 0 20px 60px rgba(255, 0, 85, 0.5);

  /* Status Colors */
  --success: #00ff88;
  --warning: #ffaa00;
  --error: #ff0055;
  --info: #00e5ff;

  /* Brand colors - keep vibrant */
  --accent-cyan: #00e5ff;
  --accent-purple: #7000ff;
  --accent-pink: #ff0055;
  --accent-red: #ff1a40;
  --accent-green: #00ff88;
  --accent-blue: #0088ff;

  --metal-dark: #333333;
  --carbon-dark: #1a1a1a;

  /* Glow Colors */
  --glow-start: rgba(255, 0, 85, 0.5);
  --glow-mid: rgba(255, 0, 85, 0.8);
}

/* === GLOBAL STYLES === */
html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
  position: relative;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* === BACKGROUND HANDLING === */
/* Professional theme - Clean background */
[data-theme="professional"] html,
[data-theme="professional"] body {
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #fdf4ff 100%);
  background-attachment: fixed;
}

[data-theme="professional"] body::before,
[data-theme="professional"] body::after {
  display: none !important;
}

/* Vibrant theme - Keep the animated background */
[data-theme="vibrant"] html {
  background-image: url('/images/bg4x.png') !important;
  background-size: cover !important;
  background-position: center !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
  min-height: 100% !important;
}

[data-theme="vibrant"] body::after {
  content: '' !important;
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/images/bg4x.png') !important;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.9;
  z-index: -10;
  pointer-events: none;
  animation: bg-zoom 30s ease-in-out infinite alternate !important;
}

[data-theme="vibrant"] body::before {
  content: '' !important;
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 50%, rgba(112, 0, 255, 0.05), transparent 60%),
    radial-gradient(circle at 10% 10%, rgba(255, 0, 85, 0.03), transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(0, 229, 255, 0.03), transparent 50%),
    rgba(10, 10, 10, 0.2) !important;
  z-index: -9;
  pointer-events: none;
  animation: bg-pulse 20s ease-in-out infinite alternate !important;
}

@keyframes bg-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

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

@keyframes bg-zoom {
  0% {
    transform: scale(1);
  }

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

/* === TYPOGRAPHY === */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
  color: var(--text-primary);
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* === UTILITIES === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: transform var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  position: relative;
  overflow: hidden;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width var(--transition-slow), height var(--transition-slow);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:active {
  transform: scale(0.95);
}

/* === GLASSMORPHISM === */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
}

[data-theme="professional"] .glass {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(37, 99, 235, 0.1);
}

.glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="professional"] .glass:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(37, 99, 235, 0.2);
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: var(--radius-sm);
}

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

/* === ANIMATIONS === */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

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

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

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

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes bounce {

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

  50% {
    transform: translateY(-10px);
  }
}

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

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

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 5px var(--glow-start, rgba(37, 99, 235, 0.5));
  }

  50% {
    box-shadow: 0 0 20px var(--glow-mid, rgba(37, 99, 235, 0.8)), 0 0 30px var(--glow-mid, rgba(37, 99, 235, 0.6));
  }
}

/* === ANIMATION UTILITY CLASSES === */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-down {
  animation: fadeInDown 0.8s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.8s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.8s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
  animation: bounce 1s ease-in-out infinite;
}

.animate-rotate {
  animation: rotate 2s linear infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* Staggered delays */
.animate-delay-100 {
  animation-delay: 0.1s;
}

.animate-delay-200 {
  animation-delay: 0.2s;
}

.animate-delay-300 {
  animation-delay: 0.3s;
}

.animate-delay-400 {
  animation-delay: 0.4s;
}

.animate-delay-500 {
  animation-delay: 0.5s;
}

/* === LOADING SPINNER === */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 6px;
}

/* === SHIMMER EFFECT === */
.shimmer {
  background: linear-gradient(90deg,
      var(--surface) 0%,
      var(--surface-hover) 50%,
      var(--surface) 100%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

/* === SCROLL ANIMATIONS === */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === PAGE TRANSITIONS === */
.page-transition-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.page-transition-exit {
  opacity: 1;
}

.page-transition-exit-active {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}