/**
 * Cobrazo Tech - Custom Styles
 * Dark professional tech theme with glassmorphism & smooth animations
 */

/* ═══════════ CSS VARIABLES ═══════════ */
:root {
  --cobra-cyan: #00d4ff;
  --cobra-purple: #7c3aed;
  --cobra-green: #10b981;
  --cobra-gold: #f59e0b;
  --cobra-dark: #0a0f1c;
  --cobra-darker: #060b14;
  --cobra-card: #111827;
  --glass-bg: rgba(17, 24, 39, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* ═══════════ BASE STYLES ═══════════ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  overflow-x: hidden;
  background: var(--cobra-darker);
}

::selection {
  background: rgba(0, 212, 255, 0.3);
  color: white;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--cobra-darker);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.5);
}

/* ═══════════ GLASSMORPHISM ═══════════ */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(0, 212, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.08);
}

/* ═══════════ NAVIGATION ═══════════ */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(6, 11, 20, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
  position: relative;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cobra-cyan), var(--cobra-purple));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ═══════════ BUTTONS ═══════════ */
.btn-primary {
  background: linear-gradient(135deg, var(--cobra-cyan), #0ea5e9, var(--cobra-purple));
  background-size: 200% 200%;
  color: white;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  animation: gradientShift 4s ease infinite;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0, 212, 255, 0.3);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-2px);
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ═══════════ GRADIENT TEXT ═══════════ */
.gradient-text {
  background: linear-gradient(135deg, var(--cobra-cyan), #38bdf8, var(--cobra-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════ HERO SECTION ═══════════ */
.hero-bg {
  background: radial-gradient(ellipse at 20% 50%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 50%, rgba(124, 58, 237, 0.05) 0%, transparent 50%);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* Floating Orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--cobra-cyan);
  top: 10%;
  left: -10%;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--cobra-purple);
  top: 60%;
  right: -5%;
  animation-delay: -7s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: var(--cobra-green);
  bottom: 10%;
  left: 30%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.9); }
  75% { transform: translate(10px, 10px) scale(1.05); }
}

/* Hero Visual */
.hero-visual {
  position: relative;
  animation: heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* ═══════════ ANIMATIONS ═══════════ */
.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float 4s ease-in-out infinite;
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-ping-slow {
  animation: pingSlow 3s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pingSlow {
  0% { transform: scale(1); opacity: 0.5; }
  75%, 100% { transform: scale(1.5); opacity: 0; }
}

/* Scroll Animations */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-left"] {
  transform: translateX(30px);
}

[data-animate].visible {
  opacity: 1;
  transform: translate(0);
}

/* Fallback: if animations JS fails, make all content visible after 3s */
@keyframes forceVisible {
  to { opacity: 1; transform: none; }
}
[data-animate] {
  animation: forceVisible 0s 3s forwards;
}

/* ═══════════ SERVICE CARDS ═══════════ */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cobra-cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-card:hover::before {
  opacity: 1;
}

.service-card:hover {
  transform: translateY(-5px);
}

/* ═══════════ PORTFOLIO ═══════════ */
.portfolio-filter {
  background: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
  border: 1px solid transparent;
}

.portfolio-filter:hover {
  background: rgba(0, 212, 255, 0.1);
  color: var(--cobra-cyan);
}

.portfolio-filter.active {
  background: rgba(0, 212, 255, 0.15);
  color: var(--cobra-cyan);
  border-color: rgba(0, 212, 255, 0.3);
}

.portfolio-item {
  transition: all 0.5s ease;
}

.portfolio-item.hidden-item {
  opacity: 0;
  transform: scale(0.8);
  position: absolute;
  pointer-events: none;
}

/* ═══════════ PORTFOLIO IMAGE CAROUSEL ═══════════ */
.portfolio-carousel {
  position: relative;
  height: 14rem; /* h-56 */
  overflow: hidden;
  background: #0a0f1c;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.6s ease, transform 4s ease;
  z-index: 0;
}

.carousel-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
  animation: kenBurns 8s ease-in-out infinite alternate;
}

.carousel-slide.exiting {
  opacity: 0;
  transform: scale(0.95);
  z-index: 1;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

@keyframes kenBurns {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* Arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease;
}

.carousel-arrow:hover {
  background: rgba(0, 212, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

.portfolio-carousel:hover .carousel-arrow,
.portfolio-item:hover .carousel-arrow {
  opacity: 1;
}

/* Dots */
.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  gap: 6px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-dot.active {
  background: var(--cobra-cyan, #00d4ff);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
  transform: scale(1.3);
}

.carousel-dot:hover:not(.active) {
  background: rgba(255, 255, 255, 0.6);
}

/* Counter badge */
.carousel-counter {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 15;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-carousel:hover .carousel-counter {
  opacity: 1;
}

/* Overlay should sit above carousel but below status badge */
.carousel-overlay {
  z-index: 20;
}

/* ═══════════ PRICING CARDS ═══════════ */
.pricing-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 212, 255, 0.1);
}

/* ═══════════ CHAT WIDGET ═══════════ */
#chat-window {
  animation: chatSlideUp 0.3s ease;
}

@keyframes chatSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Chat Messages */
.chat-message {
  max-width: 85%;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-bubble {
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble.bot {
  background: rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
  color: #e5e7eb;
}

.chat-bubble.user {
  background: linear-gradient(135deg, var(--cobra-cyan), #0ea5e9);
  border-bottom-right-radius: 4px;
  color: white;
}

/* Chat messages container layout */
#chat-messages {
  display: flex;
  flex-direction: column;
}

/* ═══════════ SOCIAL PROOF POPUP ═══════════ */
#social-proof.show {
  transform: translateX(0);
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 768px) {
  #chat-window {
    width: calc(100vw - 1.5rem);
    right: -0.75rem;
    bottom: 5rem;
    height: 70vh;
    max-height: 500px;
  }

  #whatsapp-float {
    bottom: 6rem;
  }

  .orb {
    display: none; /* Hide orbs on mobile for performance */
  }
}

@media (max-width: 640px) {
  #hero h1 {
    font-size: 2rem;
  }
}

/* ═══════════ LOADING ANIMATION ═══════════ */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--cobra-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 212, 255, 0.1);
  border-top-color: var(--cobra-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════ UTILITY CLASSES ═══════════ */
.text-shadow {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.glow-cyan {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.glow-purple {
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}
