/* 
 * Balboa Insights - Custom Styles
 * Supplement to Tailwind CSS
 */

/* =============================================
   CSS Custom Properties / Variables
   ============================================= */
:root {
  --color-navy: #0F172A;
  --color-teal: #0FA9B0;
  --color-warm-gray: #64748B;
  --color-light-bg: #F8FAFC;
  --color-success: #10B981;
  --color-white: #FFFFFF;
  
  --font-montserrat: 'Montserrat', sans-serif;
  --font-inter: 'Inter', sans-serif;
  
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
}

/* =============================================
   Base Styles
   ============================================= */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

/* Skip link styles */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only:focus {
  position: absolute;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* =============================================
   Typography Enhancements
   ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-montserrat);
  font-weight: 700;
  line-height: 1.2;
}

p, li, span {
  line-height: 1.7;
}

/* =============================================
   Animation Utilities
   ============================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(15, 169, 176, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(15, 169, 176, 0);
  }
}

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

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-pulse-glow {
  animation: pulse-glow 2s infinite;
}

/* Staggered animation delays */
.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-400 { animation-delay: 400ms; }
.animation-delay-500 { animation-delay: 500ms; }

/* =============================================
   Interactive Element Enhancements
   ============================================= */

/* Button hover effects */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.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 var(--transition-slow);
}

.btn-primary:hover::before {
  left: 100%;
}

/* Card hover effects */
.card-hover {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.15);
}

/* Link underline animation */
.link-underline {
  position: relative;
  text-decoration: none;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-teal);
  transition: width var(--transition-normal);
}

.link-underline:hover::after {
  width: 100%;
}

/* =============================================
   Form Styles
   ============================================= */
input, textarea, select {
  font-family: var(--font-inter);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(15, 169, 176, 0.15);
}

/* Custom select arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 48px;
  appearance: none;
}

/* =============================================
   Navbar Styles
   ============================================= */
#navbar {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#navbar.scrolled {
  background-color: var(--color-navy);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* =============================================
   Hero Section Background
   ============================================= */
.hero-pattern {
  background-color: var(--color-navy);
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(15, 169, 176, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(15, 169, 176, 0.1) 0%, transparent 50%);
}

/* Hero dual gradient background */
.bg-gradient-hero {
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(15, 169, 176, 0.5) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(15, 169, 176, 0.5) 0%, transparent 50%);
}

/* CTA section centered gradient glow */
.bg-gradient-cta {
  background-image: radial-gradient(circle at 50% 50%, rgba(15, 169, 176, 1) 0%, transparent 60%);
}

/* Grid pattern overlay */
.grid-pattern {
  background-image: 
    linear-gradient(rgba(15, 169, 176, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 169, 176, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* =============================================
   Card Styles
   ============================================= */
.card {
  background: var(--color-white);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
  box-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.15);
}

/* =============================================
   Gradient Text
   ============================================= */
.gradient-text {
  background: linear-gradient(135deg, var(--color-teal), #0d8a90);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============================================
   Scroll Progress Indicator (optional)
   ============================================= */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-teal);
  z-index: 100;
  transition: width 0.1s linear;
}

/* =============================================
   Loading State
   ============================================= */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================
   Responsive Utilities
   ============================================= */
@media (max-width: 768px) {
  h1 {
    font-size: 2.25rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  .hide-mobile {
    display: none;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none;
  }
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
  nav, footer, .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  a {
    text-decoration: underline;
  }
  
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
  }
}

/* =============================================
   Dark Mode Support (future enhancement)
   ============================================= */
@media (prefers-color-scheme: dark) {
  /* 
   * TODO: Add dark mode styles if desired
   * Example:
   * :root {
   *   --color-bg: #0F172A;
   *   --color-text: #F8FAFC;
   * }
   */
}

/* =============================================
   Reduced Motion Support
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
