/* Custom styles for Vinit Joshi Freelance Growth Portfolio */

:root {
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --accent: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.35);
  --dark-bg: #090d16;
  --dark-card: #0f172a;
  --dark-border: rgba(255, 255, 255, 0.08);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--dark-bg);
  color: #f1f5f9;
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
}

/* Global word break to prevent sentences from escaping boxes on mobile */
p, h1, h2, h3, h4, h5, h6, span, a, li, label, div {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Glassmorphism effects */
.glass-panel {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--dark-border);
}

.glass-panel-hover {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.5), 0 0 20px -5px var(--primary-glow);
}

/* Ambient glow backgrounds (hidden on mobile to prevent horizontal viewport distortion) */
.ambient-glow-1 {
  position: absolute;
  top: -100px;
  right: -50px;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-2 {
  position: absolute;
  bottom: 10%;
  left: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

@media (max-width: 768px) {
  .ambient-glow-1,
  .ambient-glow-2 {
    display: none;
  }
}

/* Gradient text */
.gradient-text-blue {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-emerald {
  background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #6ee7b7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Pulse animation */
@keyframes softPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.pulse-badge {
  animation: softPulse 2.5s infinite ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #090d16;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Range input custom styling */
input[type=range] {
  -webkit-appearance: none;
  background: #1e293b;
  height: 8px;
  border-radius: 4px;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.8);
  border: 2px solid #ffffff;
  transition: transform 0.15s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Dropdown Navigation Menu */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 270px;
  background: rgba(13, 19, 33, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.125rem;
  padding: 0.5rem;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 25px -5px rgba(59, 130, 246, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
}

/* Open state via hover or click */
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown:hover #nav-more-icon,
.nav-dropdown.is-open #nav-more-icon {
  transform: rotate(180deg);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #cbd5e1;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #ffffff;
  transform: translateX(4px);
}

.dropdown-item i {
  width: 1.125rem;
  text-align: center;
}

/* Mobile drawer styling */
#mobile-menu {
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive utilities */
@media (max-width: 640px) {
  .pulse-badge {
    animation: none;
  }
}

/* Calculator metrics fluid typography to prevent overflow */
#metric-pipeline {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  line-height: 1.25;
}

#metric-roas {
  font-size: clamp(0.95rem, 1.8vw, 1.25rem);
  line-height: 1.25;
}

/* Universal responsive hardening for mobile viewports (320px - 640px) */
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

pre, code, kbd, samp {
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 640px) {
  .glass-panel {
    max-width: 100%;
  }

  .exp-card {
    max-width: 100%;
    overflow: hidden;
  }

  /* Prevent automatic iOS input zoom */
  input[type="text"],
  input[type="email"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px;
  }
}
