/* OFM CRM Sunum - Custom Styles */

:root {
  /* Primary Colors */
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #3B82F6;
  
  /* Status Colors */
  --success: #10B981;
  --success-light: #34D399;
  --warning: #F59E0B;
  --warning-light: #FBBF24;
  --danger: #EF4444;
  --danger-light: #F87171;
  --info: #6366F1;
  --info-light: #818CF8;
  
  /* Neutrals */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  
  /* Pipeline Colors */
  --pipeline-new: #3B82F6;
  --pipeline-talking: #F59E0B;
  --pipeline-price: #F97316;
  --pipeline-appointment: #8B5CF6;
  --pipeline-attended: #22C55E;
  --pipeline-deposit: #10B981;
  --pipeline-lost: #EF4444;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* Card Hover Effect */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Gradient Backgrounds */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
}

.bg-gradient-hero {
  background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 50%, #60A5FA 100%);
}

/* Pipeline Stage Colors */
.stage-new { background-color: var(--pipeline-new); }
.stage-talking { background-color: var(--pipeline-talking); }
.stage-price { background-color: var(--pipeline-price); }
.stage-appointment { background-color: var(--pipeline-appointment); }
.stage-attended { background-color: var(--pipeline-attended); }
.stage-deposit { background-color: var(--pipeline-deposit); }
.stage-lost { background-color: var(--pipeline-lost); }

/* Text Gradient */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============================================
   COUNTER ANIMATIONS
   ============================================= */
.stats-number {
  font-variant-numeric: tabular-nums;
  transition: transform 0.3s ease, color 0.3s ease;
}

.counter-animating {
  transform: scale(1.05);
}

.counter-complete {
  animation: counter-pop 0.4s ease-out;
}

@keyframes counter-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* =============================================
   FLOW ARROW ANIMATION
   ============================================= */
@keyframes flow-arrow {
  0%, 100% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(8px);
    opacity: 0.5;
  }
}

.flow-arrow {
  animation: flow-arrow 1.5s ease-in-out infinite;
}

/* =============================================
   PULSE ANIMATION FOR CTAs
   ============================================= */
@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

.pulse-animation {
  position: relative;
}

.pulse-animation::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: pulse-ring 2s ease-out infinite;
  z-index: -1;
}

/* =============================================
   GLOW EFFECTS
   ============================================= */
.glow-primary {
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

.glow-success {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.glow-warning {
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

/* =============================================
   MODULE ICON HOVER
   ============================================= */
.module-icon {
  transition: all 0.3s ease;
  cursor: pointer;
}

.module-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.module-icon:hover .w-12 {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

/* =============================================
   HIERARCHY TREE LINE
   ============================================= */
.tree-line {
  position: relative;
}

.tree-line::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--gray-300);
  transform: translateX(-50%);
}

/* =============================================
   NAVIGATION ACTIVE STATE
   ============================================= */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* =============================================
   FLOATING ANIMATION
   ============================================= */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* =============================================
   SHIMMER LOADING EFFECT
   ============================================= */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(90deg, 
    var(--gray-200) 0%, 
    var(--gray-100) 50%, 
    var(--gray-200) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* =============================================
   RIPPLE EFFECT
   ============================================= */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* =============================================
   GRADIENT TEXT ANIMATION
   ============================================= */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.animated-gradient-text {
  background: linear-gradient(90deg, #2563EB, #6366F1, #8B5CF6, #6366F1, #2563EB);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
}

/* =============================================
   TOOLTIP STYLES
   ============================================= */
.tooltip {
  position: relative;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: var(--gray-900);
  color: white;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 50;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gray-900);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* =============================================
   BADGE PULSE
   ============================================= */
@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

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

/* =============================================
   MOBILE MENU ANIMATION
   ============================================= */
.mobile-menu-enter {
  transform: translateX(-100%);
  opacity: 0;
}

.mobile-menu-enter-active {
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* =============================================
   PIPELINE CARD HOVER
   ============================================= */
.pipeline-card {
  transition: all 0.3s ease;
}

.pipeline-card:hover {
  transform: translateY(-4px) scale(1.02);
  z-index: 10;
}

/* =============================================
   FEATURE CARD ICON ANIMATION
   ============================================= */
.feature-card .feature-icon {
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

/* =============================================
   RESPONSIVE TYPOGRAPHY
   ============================================= */
@media (max-width: 640px) {
  .hero-title {
    font-size: 2rem;
    line-height: 2.5rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hero-title {
    font-size: 3rem;
    line-height: 3.5rem;
  }
}

@media (min-width: 1025px) {
  .hero-title {
    font-size: 3.75rem;
    line-height: 4.25rem;
  }
}

/* =============================================
   SCROLL PROGRESS BAR
   ============================================= */
#scroll-progress {
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

/* =============================================
   MODAL STYLES
   ============================================= */
#module-modal .bg-white {
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s ease;
}

#module-modal:not(.hidden) .bg-white {
  transform: scale(1);
  opacity: 1;
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================
   FLOWCHART COMPONENT STYLES
   ============================================= */

/* Container */
.flowchart {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Individual Step */
.flow-step {
  display: flex;
  gap: 1.5rem;
  position: relative;
  padding-bottom: 2rem;
}

/* Vertical connecting line */
.flow-step::before {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 3rem;
  width: 2px;
  height: calc(100% - 1.5rem);
  background: linear-gradient(to bottom, var(--primary) 0%, var(--gray-300) 100%);
}

.flow-step:last-child::before {
  display: none;
}

/* Step Number Circle */
.flow-number {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
  z-index: 1;
  transition: all 0.3s ease;
}

.flow-step:hover .flow-number {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
}

/* Step Content Card */
.flow-content {
  flex: 1;
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.flow-step:hover .flow-content {
  transform: translateX(8px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

/* Step Title */
.flow-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.flow-title span {
  font-size: 1.25rem;
}

/* Step Description */
.flow-desc {
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Step Notes */
.flow-notes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flow-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.flow-note i {
  color: var(--primary);
}

/* Actor Badges */
.actor-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.actor-badge.customer {
  background: #DBEAFE;
  color: #1D4ED8;
}

.actor-badge.sales {
  background: #D1FAE5;
  color: #065F46;
}

.actor-badge.ops {
  background: #EDE9FE;
  color: #5B21B6;
}

.actor-badge.tl {
  background: #FEF3C7;
  color: #92400E;
}

.actor-badge.admin {
  background: #F3F4F6;
  color: #374151;
}

/* Flow Step Variants */
.flow-step.success .flow-number {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.flow-step.success:hover .flow-number {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.flow-step.warning .flow-number {
  background: linear-gradient(135deg, var(--warning) 0%, #D97706 100%);
  box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
}

.flow-step.warning:hover .flow-number {
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.flow-step.danger .flow-number {
  background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.flow-step.danger:hover .flow-number {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.flow-step.info .flow-number {
  background: linear-gradient(135deg, var(--info) 0%, #4F46E5 100%);
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.flow-step.info:hover .flow-number {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Flow Summary Box */
.flow-summary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
  border-radius: 1rem;
  padding: 2rem;
  color: white;
  margin-top: 2rem;
}

.flow-summary h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.flow-summary ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.flow-summary li {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.flow-summary li span:first-child {
  opacity: 0.9;
}

/* Page Navigation */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.page-nav-prev {
  background: var(--gray-100);
  color: var(--gray-700);
}

.page-nav-prev:hover {
  background: var(--gray-200);
  transform: translateX(-4px);
}

.page-nav-next {
  background: var(--primary);
  color: white;
}

.page-nav-next:hover {
  background: var(--primary-dark);
  transform: translateX(4px);
}

/* Decision Point Diamond */
.flow-step.decision .flow-number {
  border-radius: 0;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--warning) 0%, var(--danger) 100%);
}

.flow-step.decision .flow-number span {
  transform: rotate(-45deg);
}

/* Branch Paths */
.flow-branch {
  margin-left: 4rem;
  padding-left: 1.5rem;
  border-left: 2px dashed var(--gray-300);
}

.flow-branch-label {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--gray-100);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 640px) {
  .flow-step {
    gap: 1rem;
  }
  
  .flow-number {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
  }
  
  .flow-step::before {
    left: 1rem;
    top: 2.5rem;
  }
  
  .flow-content {
    padding: 1rem;
  }
  
  .flow-title {
    font-size: 1rem;
  }
  
  .page-nav {
    flex-direction: column;
  }
  
  .page-nav a {
    justify-content: center;
  }
}
