/* ===================================
   Novium Consulting - Main Stylesheet
   Mobile-First Optimized
   =================================== */

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #00f3ff;
}

/* Glassmorphism Utilities */
.glass-card {
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(0, 243, 255, 0.3);
  transform: translateY(-5px);
  box-shadow: 0 10px 40px -10px rgba(0, 243, 255, 0.15);
}

/* Neon Text Glow */
.text-glow {
  text-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

.text-glow-gold {
  text-shadow: 0 0 20px rgba(249, 190, 0, 0.5);
}

/* Canvas Positioning */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: #050505;
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-accent {
  background: linear-gradient(135deg, #00f3ff 0%, #bd00ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-gold {
  background: linear-gradient(135deg, #F9BE00 0%, #ff8c00 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Watercolor Backgrounds */
.watercolor-hero-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-image: url('./images/tech-hero.png');
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  mix-blend-mode: screen;
  z-index: 1;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.watercolor-accent-bg {
  background-image: url('./images/tech-accent.png');
  background-size: cover;
  background-position: center;
  mix-blend-mode: color-dodge;
  opacity: 0.3;
}

/* Keyframe Animations */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

@keyframes network-pulse {
  0%   { transform: scale(0.95); opacity: 0.5; }
  50%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

@keyframes radar-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes flow-dash {
  to { stroke-dashoffset: -40; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes neon-pulse-strong {
  0%, 100% {
    box-shadow: 0 0 10px var(--neon-color), 0 0 20px var(--neon-color);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 20px var(--neon-color), 0 0 40px var(--neon-color), 0 0 80px var(--neon-color);
    filter: brightness(1.2);
  }
}

@keyframes orbit-3d {
  from { transform: rotateY(0deg) rotateX(10deg); }
  to   { transform: rotateY(360deg) rotateX(10deg); }
}

@keyframes cyber-scan {
  0%   { top: -10%; opacity: 0; height: 5px; }
  10%  { opacity: 1; height: 2px; box-shadow: 0 0 15px var(--neon-color); }
  90%  { opacity: 1; height: 2px; }
  100% { top: 110%; opacity: 0; }
}

@keyframes matrix-fall {
  0%   { transform: translateY(-100%); opacity: 0; }
  5%   { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}

@keyframes hologram {
  0%, 100% { opacity: 1; transform: scale(1); }
  3%       { opacity: 0.8; transform: skewX(1deg); }
  6%       { opacity: 1; transform: skewX(0deg); }
  7%       { opacity: 0.9; transform: scaleY(1.02); }
  8%       { opacity: 1; transform: scaleY(1); }
  50%      { opacity: 0.95; }
  52%      { opacity: 0.4; transform: skewX(-2deg); }
  54%      { opacity: 1; transform: skewX(0deg); }
}

@keyframes grow-graph {
  0%   { height: 0; }
  100% { height: var(--target-height); }
}

@keyframes progress-bar {
  to { width: 100%; }
}

/* Typing Effect */
.typing-effect {
  overflow: hidden;
  border-right: .15em solid #00ff00;
  white-space: nowrap;
  margin: 0;
  letter-spacing: .15em;
  animation: typing 3.5s steps(40, end), blink .75s step-end infinite;
}

/* Preview Box */
.preview-box {
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.95) 0%, rgba(20, 20, 20, 0.8) 100%);
  border: 1px solid rgba(0, 243, 255, 0.1);
  border-radius: 1rem;
  padding: 0;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}

/* Carousel */
.carousel-container {
  width: 100%;
  height: 400px;
  position: relative;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.95) 0%, rgba(20, 20, 20, 0.8) 100%);
  border: 1px solid rgba(0, 243, 255, 0.1);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
  margin-top: 2rem;
  touch-action: pan-y;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: scale(0.95);
}

.carousel-slide.active {
  opacity: 1;
  z-index: 10;
  pointer-events: auto;
  transform: scale(1);
}

.carousel-nav {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  z-index: 20;
}

.carousel-dot {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.carousel-dot.active {
  background: rgba(255, 255, 255, 0.2);
}

.carousel-dot.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: var(--neon-color, #00f3ff);
  animation: progress-bar 5s linear forwards;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s;
}

.carousel-arrow:hover {
  background: rgba(0, 243, 255, 0.1);
  border-color: #00f3ff;
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.carousel-prev {
  left: 15px;
}

.carousel-next {
  right: 15px;
}

/* Spectacular Text */
.spectacular-text {
  font-family: 'Orbitron', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 243, 255, 0.8);
}

/* ===================================
   MOBILE OPTIMIZATIONS
   =================================== */

/* Mobile Menu animation */
#mobile-menu {
  transition: opacity 0.3s ease;
}

#mobile-menu:not(.hidden) {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#mobile-menu .mobile-link {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0.5rem 1.5rem;
}

/* Mobile menu CTA buttons */
.mobile-menu-cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 80%;
  max-width: 280px;
  margin-top: 1rem;
}

.mobile-menu-cta a {
  display: block;
  text-align: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s;
}

/* ---- Mobile (< 768px) ---- */
@media (max-width: 767px) {
  /* Reduce backdrop-blur for performance */
  .glass-card {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  /* Disable hover transform on touch devices - use active instead */
  .glass-card:hover {
    transform: none;
    box-shadow: none;
  }

  .glass-card:active {
    border-color: rgba(0, 243, 255, 0.3);
    transform: scale(0.98);
  }

  /* Hero section - use svh for correct mobile viewport */
  section.min-h-screen {
    min-height: calc(100vh - 60px);
    min-height: calc(100svh - 60px);
  }

  /* Reduce watercolor BG opacity for readability */
  .watercolor-hero-bg {
    opacity: 0.2;
  }

  /* About section glass card */
  .glass-card.p-8 {
    padding: 1.25rem;
  }

  /* Service cards padding */
  .glass-card.p-10 {
    padding: 1.5rem;
  }

  /* Modal improvements */
  #modal-content {
    max-height: 95vh;
    max-height: 95svh;
    border-radius: 1rem;
    margin: 0.5rem;
  }

  #modal-overlay {
    padding: 0.5rem;
    align-items: flex-end;
  }

  /* Modal header compact */
  .modal-body > div:first-child.h-48,
  .modal-body > .h-48 {
    height: 100px;
    min-height: 100px;
  }

  .modal-body .h-48 h2,
  .modal-body > div:first-child h2 {
    font-size: 1.4rem;
  }

  .modal-body .h-48 i.text-8xl {
    font-size: 3.5rem;
    opacity: 0.05;
  }

  /* Modal padding */
  .modal-body .p-8 {
    padding: 1.25rem;
  }

  /* Carousel mobile size */
  .carousel-container {
    height: 260px;
    margin-top: 1rem;
  }

  .carousel-arrow {
    width: 34px;
    height: 34px;
  }

  .carousel-prev {
    left: 6px;
  }

  .carousel-next {
    right: 6px;
  }

  .spectacular-text {
    font-size: 0.85rem;
    letter-spacing: 1px;
  }

  /* Preview box */
  .preview-box {
    height: 220px;
    margin-top: 1rem;
  }

  /* Footer */
  footer .flex.flex-col.md\\:flex-row {
    gap: 2rem;
  }

  /* Solutions grid */
  #solutions .glass-card {
    padding: 1.5rem;
  }

  /* Blog cards image smaller */
  #blog-grid article .h-48 {
    height: 140px;
  }

  /* Nav bar compact */
  #navbar {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  #navbar .text-2xl {
    font-size: 1.2rem;
  }

  #navbar .w-10 {
    width: 2rem;
    height: 2rem;
  }

  #navbar .w-10 span {
    font-size: 0.9rem;
  }

  /* Menu button touch target */
  #menu-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Scroll indicator */
  .animate-bounce {
    bottom: 1.5rem;
  }

  /* CTA button full width on mobile */
  .flex.flex-col.md\\:flex-row.gap-4 a {
    width: 100%;
    text-align: center;
  }

  /* Modal CTA buttons */
  .modal-body .inline-block {
    display: block;
    width: 100%;
    text-align: center;
  }

  /* About grid - single column on mobile */
  .grid.grid-cols-2.gap-6 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* BPMN card inner grid */
  .modal-body .grid.grid-cols-1.md\\:grid-cols-2 {
    grid-template-columns: 1fr;
  }

  /* Reduce section padding on mobile */
  .py-24 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  /* Font size adjustments for hero */
  h1.text-5xl {
    font-size: 2.2rem;
    line-height: 1.2;
  }

  /* Section titles */
  h3.text-3xl {
    font-size: 1.6rem;
  }

  /* Service card titles */
  .glass-card h4.text-2xl {
    font-size: 1.2rem;
  }
}

/* ---- Small phones (< 375px) ---- */
@media (max-width: 374px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .carousel-container {
    height: 220px;
  }

  .carousel-arrow {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  #modal-content {
    margin: 0.25rem;
  }

  h1.text-5xl {
    font-size: 1.8rem;
  }
}

/* ---- Tablet (768-1023px) ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  .carousel-container {
    height: 340px;
  }
}

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .carousel-slide {
    transition: opacity 0.1s ease;
  }

  #particles-canvas {
    display: none;
  }
}

/* ---- Safe area (notched phones) ---- */
@supports (padding: env(safe-area-inset-top)) {
  #navbar {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }

  #mobile-menu {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}

/* ---- Landscape mobile ---- */
@media (max-height: 500px) and (orientation: landscape) {
  section.min-h-screen {
    min-height: auto;
    padding-top: 5rem;
    padding-bottom: 3rem;
  }

  .carousel-container {
    height: 200px;
  }

  #mobile-menu {
    gap: 0.25rem;
    overflow-y: auto;
  }

  #mobile-menu .mobile-link {
    min-height: 36px;
    font-size: 0.9rem;
  }
}

/* iOS bounce scroll fix */
body {
  -webkit-overflow-scrolling: touch;
}

/* Thinner scrollbar on mobile modals */
@media (max-width: 767px) {
  #modal-content::-webkit-scrollbar {
    width: 3px;
  }

  #modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
  }
}

/* Swipe hint for carousels on mobile */
.swipe-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: swipeHintFade 4s ease forwards;
  pointer-events: none;
}

@keyframes swipeHintFade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

@media (min-width: 768px) {
  .swipe-hint {
    display: none;
  }
}
