@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";

@custom-variant dark (&:is(.dark *));

/* ─── CloudPrime Brand Theme ─── */
:root {
  --cp-blue: #2E86AB;
  --cp-purple: #A23B72;
  --cp-orange: #F18F01;
  --cp-green: #28A745;
  --cp-dark-bg: #1A1A2E;
  --cp-darker-bg: #0F0F1A;
  --cp-text: #E8E8E8;
  --cp-text-muted: #9CA3AF;
  --cp-whatsapp: #25D366;

  --background: #ffffff;
  --foreground: #0F0F1A;
  --card: #ffffff;
  --card-foreground: #0F0F1A;
  --popover: #ffffff;
  --popover-foreground: #0F0F1A;
  --primary: #2E86AB;
  --primary-foreground: #ffffff;
  --secondary: #f0f4f8;
  --secondary-foreground: #0F0F1A;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #A23B72;
  --accent-foreground: #ffffff;
  --destructive: #ef4444;
  --border: #e2e8f0;
  --input: #e2e8f0;
  --ring: #2E86AB;
  --chart-1: #2E86AB;
  --chart-2: #A23B72;
  --chart-3: #F18F01;
  --chart-4: #28A745;
  --chart-5: #6366f1;
  --radius: 0.75rem;
  --sidebar: #f8fafc;
  --sidebar-foreground: #0F0F1A;
  --sidebar-primary: #2E86AB;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #f0f4f8;
  --sidebar-accent-foreground: #0F0F1A;
  --sidebar-border: #e2e8f0;
  --sidebar-ring: #2E86AB;
}

.dark {
  --background: #0F0F1A;
  --foreground: #E8E8E8;
  --card: #1A1A2E;
  --card-foreground: #E8E8E8;
  --popover: #1A1A2E;
  --popover-foreground: #E8E8E8;
  --primary: #2E86AB;
  --primary-foreground: #ffffff;
  --secondary: #252540;
  --secondary-foreground: #E8E8E8;
  --muted: #252540;
  --muted-foreground: #9CA3AF;
  --accent: #A23B72;
  --accent-foreground: #ffffff;
  --destructive: #ef4444;
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.12);
  --ring: #2E86AB;
  --chart-1: #2E86AB;
  --chart-2: #A23B72;
  --chart-3: #F18F01;
  --chart-4: #28A745;
  --chart-5: #818cf8;
  --sidebar: #1A1A2E;
  --sidebar-foreground: #E8E8E8;
  --sidebar-primary: #2E86AB;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #252540;
  --sidebar-accent-foreground: #E8E8E8;
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-ring: #2E86AB;
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-3xl: calc(var(--radius) * 2.2);
  --radius-4xl: calc(var(--radius) * 2.6);
  --font-sans: var(--font-jakarta);
  --font-mono: var(--font-geist-mono);
  --font-heading: var(--font-jakarta);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
  html {
    @apply font-sans;
    scroll-behavior: smooth;
  }
}

/* ─── Glassmorphism ─── */
.glass-card {
  background: rgba(26, 26, 46, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark .glass-card {
  background: rgba(26, 26, 46, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

:is(:not(.dark)) .glass-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.glass-card-light {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
}

/* ─── Gradient Text ─── */
.gradient-text {
  background: linear-gradient(135deg, #2E86AB, #A23B72);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-orange {
  background: linear-gradient(135deg, #F18F01, #2E86AB);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Gradient Button ─── */
.btn-gradient {
  background: linear-gradient(135deg, #2E86AB, #A23B72);
  transition: all 0.3s ease;
}

.btn-gradient:hover {
  background: linear-gradient(135deg, #246d8c, #872f5e);
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(46, 134, 171, 0.3);
}

/* ─── Chart Bars ─── */
.chart-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

:is(:not(.dark)) .chart-bar {
  background: #e9ecef;
}

.chart-fill {
  height: 100%;
  background: var(--cp-blue);
  border-radius: 2px;
  transition: width 1s ease;
}

.chart-fill-green {
  background: var(--cp-green);
}

/* ─── Pulse Animation for CTA ─── */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(46, 134, 171, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(46, 134, 171, 0);
  }
}

.pulse-glow {
  animation: pulse-glow 2.5s infinite;
}

/* ─── Float Animation ─── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

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

.animate-float-delayed {
  animation: float 8s ease-in-out 2s infinite;
}

.animate-float-slow {
  animation: float 10s ease-in-out 1s infinite;
}

/* ─── Fade In Up ─── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.7s ease-out forwards;
  opacity: 0;
}

/* ─── Fade In ─── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
}

/* ─── Slide In Left ─── */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-left {
  animation: slideInLeft 0.7s ease-out forwards;
  opacity: 0;
}

/* ─── Typing Cursor ─── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typing-cursor::after {
  content: "|";
  animation: blink 1s infinite;
  color: #2E86AB;
  font-weight: 100;
}

/* ─── Background Blobs ─── */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  pointer-events: none;
}

.bg-blob-blue {
  background: var(--cp-blue);
}

.bg-blob-purple {
  background: var(--cp-purple);
}

/* ─── Custom Scrollbar ─── */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(46, 134, 171, 0.3);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(46, 134, 171, 0.5);
}

/* ─── Section spacing ─── */
.section-padding {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .section-padding {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

/* ─── Dark mode navbar ─── */
.dark .navbar-glass {
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar-glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* ─── Card Hover ─── */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dark .card-hover:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ─── Savings Banner ─── */
.savings-banner {
  background: linear-gradient(135deg, var(--cp-blue), var(--cp-purple));
  color: white;
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

/* ─── FAQ Accordion ─── */
.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  font-weight: 600;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary .faq-icon {
  transition: transform 0.3s ease;
}

.faq-item[open] summary .faq-icon {
  transform: rotate(180deg);
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

/* ─── Grayscale logos ─── */
.grayscale-logos {
  filter: grayscale(100%);
  opacity: 0.5;
}

/* ─── Hero section ─── */
.hero-section {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding-top: 5rem;
}

/* ─── Testimonial card ─── */
.testimonial-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  height: 100%;
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ─── Select styling for dark mode ─── */
.dark select {
  background-color: var(--secondary);
  color: var(--foreground);
  border-color: var(--border);
}

.dark select option {
  background-color: var(--card);
  color: var(--foreground);
}

/* ─── Dark mode text contrast fixes ─── */
/* Bright-colored badges/labels on dark mode get darker text */
.dark .bg-primary\/10 {
  color: #7dd3fc;
}

.dark .text-green-500 {
  color: #4ade80;
}

.dark .text-sky-500 {
  color: #7dd3fc;
}

.dark .text-orange-500 {
  color: #fdba74;
}

/* Glass card in dark mode - ensure text is always readable */
.dark .glass-card {
  background: rgba(15, 15, 30, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Stat cards with bg-secondary inside glass-card in dark mode */
.dark .glass-card .bg-secondary {
  background: rgba(30, 30, 55, 0.8);
}

/* Bright info boxes/panels in dark mode */
.dark .bg-primary\/5 {
  background: rgba(46, 134, 171, 0.08);
}

.dark .bg-green-500\/5 {
  background: rgba(40, 167, 69, 0.08);
}

/* Ensure muted-foreground is visible on bright backgrounds in dark mode */
.dark .bg-primary\/10,
.dark .bg-green-500\/10,
.dark .bg-sky-500\/10,
.dark .bg-orange-500\/10 {
  color: #d1d5db;
}

/* Coverage checker - bright input on blue background */
.dark .glass-card-light input {
  color: #1a1a2e;
}

.dark .glass-card-light input::placeholder {
  color: #6b7280;
}

/* Table header in dark mode */
.dark table thead tr.bg-secondary th {
  color: #e8e8e8;
  background: rgba(30, 30, 55, 0.8);
}

/* Chart bars in dark mode */
.dark .chart-bar {
  background: rgba(255, 255, 255, 0.08);
}

/* Card hover in dark mode - ensure shadow is visible */
.dark .card-hover:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Stat card floating badge in dark mode */
.dark .glass-card .bg-card {
  background: rgba(20, 20, 40, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Bold text always visible */
.dark .font-bold,
.dark .text-foreground {
  color: #e8e8e8;
}

.dark .text-muted-foreground {
  color: #9ca3af;
}
