/* ========================================
   ShintoPC Labs — Premium Shared Styles
   ======================================== */

/* ---- CSS Variables: Dark (default) & Light ---- */
:root {
  --bg-primary: #0e0e12;
  --bg-surface: #19191e;
  --bg-surface-low: #131317;
  --bg-surface-high: #1f1f25;
  --bg-surface-highest: #25252b;
  --bg-glass: rgba(37, 37, 43, 0.45);
  --bg-glass-strong: rgba(37, 37, 43, 0.7);
  --border-glass: rgba(72, 71, 76, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text-primary: #fcf8fe;
  --text-secondary: #acaab0;
  --accent-primary: #9da7ff;
  --accent-primary-dim: #4e62ff;
  --accent-secondary: #ac8aff;
  --accent-tertiary: #81ecff;
  --neon-primary: rgba(157, 167, 255, 0.35);
  --neon-secondary: rgba(172, 138, 255, 0.3);
  --neon-tertiary: rgba(0, 212, 236, 0.3);
  --neon-whatsapp: rgba(37, 211, 102, 0.25);
  --shadow-ambient: 0 8px 32px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

html.light {
  --bg-primary: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-surface-low: #f0f0f2;
  --bg-surface-high: #e8e8ec;
  --bg-surface-highest: #dddde2;
  --bg-glass: rgba(255, 255, 255, 0.6);
  --bg-glass-strong: rgba(255, 255, 255, 0.8);
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --text-primary: #1a1a1f;
  --text-secondary: #6b6b72;
  --neon-primary: rgba(77, 97, 255, 0.2);
  --neon-secondary: rgba(133, 85, 239, 0.15);
  --neon-tertiary: rgba(0, 87, 98, 0.15);
  --shadow-ambient: 0 8px 32px rgba(0, 0, 0, 0.08);
  color-scheme: light;
}

/* ---- Base ---- */
body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.4s ease, color 0.4s ease;
}

html.light body {
  background-color: var(--bg-primary);
}

.material-symbols-outlined {
  font-variation-settings: 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---- Glassmorphism ---- */
.glass-panel {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

.glass-panel:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.5s ease, transform 0.5s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.35), 0 12px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---- Gradients ---- */
.hero-gradient {
  background: 
    radial-gradient(ellipse 70% 60% at 20% 30%, rgba(99, 102, 241, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(139, 92, 246, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 50%, rgba(30, 41, 59, 0.9) 0%, transparent 100%),
    linear-gradient(180deg, #0f172a 0%, #0e0e12 100%);
}

.text-gradient {
  background: linear-gradient(135deg, #9da7ff 0%, #4e62ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.primary-gradient {
  background: linear-gradient(135deg, #9da7ff 0%, #4e62ff 100%);
}

.text-glow {
  text-shadow: 0 0 40px rgba(157, 167, 255, 0.5), 0 0 80px rgba(157, 167, 255, 0.15);
}

/* ---- Neon Glow Utilities ---- */
.neon-glow-primary {
  box-shadow: 0 0 20px var(--neon-primary), 0 0 60px rgba(157, 167, 255, 0.12);
}

.neon-glow-secondary {
  box-shadow: 0 0 20px var(--neon-secondary), 0 0 60px rgba(172, 138, 255, 0.12);
}

.neon-glow-tertiary {
  box-shadow: 0 0 20px var(--neon-tertiary), 0 0 60px rgba(0, 212, 236, 0.12);
}

/* ---- Animated Background (Hero) ---- */
.hero-bg-animated {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Floating glow orbs */
.hero-bg-animated::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -20%;
  width: 180%;
  height: 180%;
  background: 
    radial-gradient(circle 500px at 25% 35%, rgba(99, 102, 241, 0.2) 0%, transparent 55%),
    radial-gradient(circle 400px at 75% 55%, rgba(139, 92, 246, 0.15) 0%, transparent 55%),
    radial-gradient(circle 350px at 50% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 55%),
    radial-gradient(circle 250px at 15% 70%, rgba(244, 63, 94, 0.06) 0%, transparent 50%);
  animation: heroFloat 18s ease-in-out infinite;
}

.hero-bg-animated::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(157, 167, 255, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridDrift 30s linear infinite;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 30%, transparent 70%);
}

@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -20px) rotate(1deg); }
  66% { transform: translate(-20px, 15px) rotate(-1deg); }
}

@keyframes gridDrift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(40px, 40px); }
}

/* ---- Scroll Reveal Animations ---- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* ---- Button Effects ---- */
.btn-glow {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.35), 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.35s ease;
}
.btn-glow::before {
  content: '';
  position: absolute;
  inset: -3px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.6), rgba(139, 92, 246, 0.4), rgba(236, 72, 153, 0.3));
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.35s ease;
  filter: blur(15px);
}
.btn-glow:hover {
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.6), 0 0 60px rgba(99, 102, 241, 0.2), 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
.btn-glow:hover::before {
  opacity: 0.7;
}
.btn-glow:active {
  transform: translateY(0) scale(0.98);
}

/* Ripple effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple .ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ---- Glow Pulse Animation ---- */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 15px var(--neon-primary); }
  50% { box-shadow: 0 0 30px var(--neon-primary), 0 0 60px rgba(157, 167, 255, 0.15); }
}

.glow-pulse {
  animation: glowPulse 3s ease-in-out infinite;
}

/* ---- Floating Animation ---- */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(3deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

.float-anim {
  animation: float 6s ease-in-out infinite;
}

/* ---- Mobile Menu ---- */
#mobile-menu {
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}
#mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ---- Carousel ---- */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.carousel-arrow {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}
.carousel-arrow:hover {
  background: var(--accent-primary-dim);
  color: white;
  box-shadow: 0 0 20px var(--neon-primary);
  border-color: transparent;
}

/* ---- Theme Toggle Button ---- */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
}
.theme-toggle:hover {
  background: var(--accent-primary-dim);
  color: white;
  box-shadow: 0 0 15px var(--neon-primary);
}

/* ---- Navbar Scroll Enhancement ---- */
nav#navbar {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.35s ease;
}

.navbar-scrolled {
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  padding-top: 0.6rem !important;
  padding-bottom: 0.6rem !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.08);
}

/* ---- Micro-Interactions ---- */

/* Nav link underline animation */
nav a:not(.btn-glow):not(.theme-toggle) {
  position: relative;
}

nav a:not(.btn-glow):not(.theme-toggle)::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #ec4899);
  transition: width 0.3s ease, left 0.3s ease;
  border-radius: 2px;
}

nav a:not(.btn-glow):not(.theme-toggle):hover::after {
  width: 100%;
  left: 0;
}

/* Button hover scale */
.btn-ripple:hover,
a[class*="btn-glow"]:hover,
button[class*="btn-glow"]:hover {
  transform: translateY(-2px) scale(1.02);
}

/* Icon hover bounce */
.material-symbols-outlined {
  transition: transform 0.3s ease;
}

.group:hover .material-symbols-outlined,
a:hover > .material-symbols-outlined,
button:hover > .material-symbols-outlined {
  transform: scale(1.15);
}

/* Card hover lift */
.glass-panel,
.glass-card {
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.5s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Smooth link color transitions */
a {
  transition: color 0.25s ease, transform 0.25s ease;
}

/* Profile image hover pulse */
.profile-glow:hover {
  transform: scale(1.05);
}

/* ---- Profile Image Glow ---- */
.profile-glow {
  box-shadow: 0 0 25px var(--neon-primary), 0 0 50px rgba(157, 167, 255, 0.1);
  transition: box-shadow 0.4s ease;
}
.profile-glow:hover {
  box-shadow: 0 0 35px var(--neon-primary), 0 0 70px rgba(157, 167, 255, 0.2);
}

/* ---- Light Mode Overrides ---- */
html.light .hero-gradient {
  background: radial-gradient(ellipse 80% 50% at 50% 50%, rgba(77, 97, 255, 0.08) 0%, transparent 70%);
}

html.light .hero-bg-animated::after {
  background-image: radial-gradient(rgba(77, 97, 255, 0.08) 1px, transparent 1px);
}

html.light .text-gradient {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

html.light .text-glow {
  text-shadow: 0 0 20px rgba(79, 70, 229, 0.1);
}

/* Global text color overrides for light mode */
html.light body {
  color: #1f2937; /* Tailwind Gray 800 */
}

html.light h1,
html.light h2,
html.light h3,
html.light h4,
html.light h5,
html.light h6 {
  color: #111827 !important; /* Tailwind Gray 900 */
}

/* Preserve specific brand colors */
html.light .text-emerald-500, 
html.light .text-emerald-400 { color: #059669 !important; }
html.light .text-amber-500, 
html.light .text-amber-400 { color: #d97706 !important; }
html.light .text-indigo-500, 
html.light .text-indigo-400 { color: #4f46e5 !important; }
html.light .text-primary { color: #4f46e5 !important; }

/* General utility colors */
html.light .text-on-surface { color: #111827 !important; }
html.light .text-on-surface-variant { color: #4b5563 !important; }

/* Navbar */
html.light nav {
  background: rgba(255, 255, 255, 0.8) !important;
  border-bottom-color: rgba(0, 0, 0, 0.05) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

html.light nav a {
  color: #4b5563 !important;
}

html.light nav a:hover, 
html.light nav a.text-white {
  color: #111827 !important;
}

/* Mobile menu */
html.light #mobile-menu {
  background: rgba(255, 255, 255, 0.98) !important;
  border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

/* Glass panels in light mode */
html.light .glass-panel,
html.light .glass-card {
  background: rgba(255, 255, 255, 0.75) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html.light .glass-panel:hover,
html.light .glass-card:hover {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(79, 70, 229, 0.2) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* PROTECT DARK OVERLAYS: Ensure text stays white on dark backgrounds */
html.light #apps h3,
html.light #apps p,
html.light #apps span:not(.label-sm),
html.light .bg-gradient-to-t h3,
html.light .bg-gradient-to-t p,
html.light .bg-gradient-to-t span,
html.light .bg-gradient-to-t div,
html.light .bg-\[\\#0e0e12\]\/60 h3,
html.light .bg-\[\\#0e0e12\]\/60 p,
html.light .bg-\[\\#0e0e12\]\/60 span,
html.light [class*="bg-gradient-to-t"] *,
html.light [class*="bg-[#0e0e12]"] * {
  color: #ffffff !important;
}

/* Specifically ensure descriptions inside cards are white and slightly translucent */
html.light .bg-gradient-to-t .text-on-surface-variant,
html.light #apps .text-on-surface-variant {
  color: rgba(255, 255, 255, 0.75) !important;
}



/* Background containers */
html.light .bg-surface-container-lowest { background-color: #f3f4f6 !important; }
html.light .bg-surface-container { background-color: #f9fafb !important; }

/* Footer */
html.light footer {
  background-color: #f3f4f6 !important;
  border-color: rgba(0, 0, 0, 0.05) !important;
}

html.light footer .text-white {
  color: #111827 !important;
}

/* Theme toggle */
html.light .theme-toggle {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #111827;
}

/* Generic slate text overrides */
html.light .text-slate-400 { color: #6b7280 !important; }
html.light .text-slate-300 { color: #4b5563 !important; }
html.light .text-slate-500 { color: #9ca3af !important; }


/* Form inputs */
html.light input,
html.light textarea {
  background-color: #fff !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #1a1a1f !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
  color: #999 !important;
}

/* Footer */
html.light footer {
  background-color: #f0f0f2 !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Contact info links */
html.light a.text-white {
  color: #1a1a1f !important;
}

/* Borders */
html.light .border-white\/5,
html.light .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Profile image */
html.light .profile-glow {
  box-shadow: 0 0 25px rgba(77, 97, 255, 0.15), 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Theme toggle in light mode */
html.light .theme-toggle {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1f;
}

/* Carousel arrows */
html.light .carousel-arrow {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1f;
}

/* Privacy page background override */
html.light body {
  background-image: 
    radial-gradient(at 0% 0%, rgba(77, 97, 255, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(78, 98, 255, 0.04) 0px, transparent 50%) !important;
}

/* ---- Responsive Helpers ---- */
@media (max-width: 768px) {
  .carousel-arrow {
    width: 40px;
    height: 40px;
  }
}
