/* Import Google Fonts for Premium themes */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap');

/* Custom Font: Queens Condensed Light */
@font-face {
  font-family: 'Queens Condensed';
  src: url('/static/fonts/QueensCondensed-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* Theme System with CSS Variables */
:root {
  /* Global font family for the entire site */
  --global-font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  
  /* Dark theme (default) */
  --theme-bg: #212529;
  --theme-card-bg: #343a40;
  --theme-text: #ffffff;
  --theme-text-muted: #6c757d;
  --theme-border: rgba(255, 255, 255, 0.125);
  --theme-shadow: rgba(0, 0, 0, 0.25);
  --theme-primary: #007bff;
  --theme-success: #28a745;
  --theme-warning: #ffc107;
  --theme-danger: #dc3545;
}

/* Global font application */
body, html {
  font-family: var(--global-font-family) !important;
}

/* Light theme overrides */
.theme-light {
  --theme-bg: #ffffff;
  --theme-card-bg: #f8f9fa;
  --theme-text: #212529;
  --theme-text-muted: #6c757d;
  --theme-border: rgba(0, 0, 0, 0.125);
  --theme-shadow: rgba(0, 0, 0, 0.15);
  --theme-primary: #007bff;
  --theme-success: #28a745;
  --theme-warning: #ffc107;
  --theme-danger: #dc3545;
}

/* Premium Coastal theme - inspired by Wyndham San Diego Bay */
.theme-coastal {
  --theme-bg: linear-gradient(135deg, #f7f9fb 0%, #ffffff 100%);
  --theme-card-bg: #ffffff;
  --theme-text: #3275bf;
  --theme-text-muted: #5a7590;
  --theme-border: rgba(var(--theme-primary-rgb), 0.15);
  --theme-shadow: rgba(var(--theme-primary-rgb), 0.12);
  --theme-primary: #3275bf;
  --theme-secondary: #5a94d4;
  --theme-accent: #c49b61;
  --theme-primary-rgb: 50, 117, 191;
  --theme-secondary-rgb: 90, 148, 212;
  --theme-accent-rgb: 196, 155, 97;
  --theme-success: #28a745;
  --theme-warning: #ffc107;
  --theme-danger: #dc3545;
}

/* SR Premium theme - Professional dark blue */
.theme-sr-premium {
  --theme-bg: #2F5670;
  --theme-card-bg: rgba(255, 255, 255, 0.08);
  --theme-text: #FFFFFF;
  --theme-text-muted: rgba(255, 255, 255, 0.7);
  --theme-border: rgba(255, 255, 255, 0.15);
  --theme-shadow: rgba(0, 0, 0, 0.3);
  --theme-primary: #FFFFFF;
  --theme-secondary: rgba(255, 255, 255, 0.9);
  --theme-accent: rgba(255, 255, 255, 0.8);
  --theme-primary-rgb: 255, 255, 255;
  --theme-secondary-rgb: 255, 255, 255;
  --theme-accent-rgb: 255, 255, 255;
  --theme-success: #28a745;
  --theme-warning: #ffc107;
  --theme-danger: #dc3545;
}

/* Apply theme variables to common elements */
.theme-light .container,
.theme-light body {
  background-color: var(--theme-bg) !important;
  color: var(--theme-text) !important;
}

.theme-light .card {
  background-color: var(--theme-card-bg) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

.theme-light .text-muted {
  color: var(--theme-text-muted) !important;
}

.theme-light .card-header {
  background-color: rgba(0, 0, 0, 0.03) !important;
  border-bottom-color: var(--theme-border) !important;
}

/* Premium Coastal theme styling */
body.theme-coastal {
  background: var(--theme-bg) !important;
  color: var(--theme-text) !important;
  min-height: 100vh;
  font-family: var(--global-font-family) !important;
}

.theme-coastal .container {
  background: var(--theme-bg) !important;
  color: var(--theme-text) !important;
  font-family: var(--global-font-family) !important;
}

.theme-coastal .card {
  background-color: var(--theme-card-bg) !important;
  border: 1px solid var(--theme-border) !important;
  color: var(--theme-text) !important;
  box-shadow: 0 8px 25px var(--theme-shadow) !important;
  border-radius: 12px !important;
}

.theme-coastal .text-muted {
  color: var(--theme-text-muted) !important;
}

.theme-coastal .card-header {
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb), 0.05) 0%, rgba(var(--theme-secondary-rgb), 0.05) 100%) !important;
  border-bottom: 1px solid var(--theme-border) !important;
  border-radius: 12px 12px 0 0 !important;
}

.theme-coastal .btn-primary {
  background: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: white !important;
  border-radius: 8px !important;
  padding: 12px 24px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

.theme-coastal .btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(var(--theme-primary-rgb), 0.3) !important;
  background: var(--theme-primary) !important;
}

.theme-coastal .btn-outline-primary {
  border-color: var(--theme-primary) !important;
  color: var(--theme-primary) !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

.theme-coastal .btn-outline-primary:hover {
  background: var(--theme-primary) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(var(--theme-primary-rgb), 0.2) !important;
}

.theme-coastal h1, .theme-coastal h2, .theme-coastal h3, .theme-coastal h4, .theme-coastal h5 {
  color: var(--theme-primary) !important;
  font-weight: 600 !important;
  font-family: var(--global-font-family) !important;
  letter-spacing: -0.025em !important;
}

.theme-coastal p, .theme-coastal div, .theme-coastal span, .theme-coastal label {
  font-family: var(--global-font-family) !important;
}

.theme-coastal .business-logo {
  border: none !important;
  box-shadow: 0 8px 25px var(--theme-shadow) !important;
  transition: all 0.3s ease !important;
}

.theme-coastal .business-logo:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 12px 35px var(--theme-shadow) !important;
}

.theme-coastal .business-logo-fallback {
  color: var(--theme-primary) !important;
  text-shadow: 0 2px 4px var(--theme-shadow) !important;
}

.theme-coastal .fas.fa-hand-holding-usd {
  color: var(--theme-primary) !important;
}

/* SR Premium theme styling */
body.theme-sr-premium {
  background: var(--theme-bg) !important;
  color: var(--theme-text) !important;
  min-height: 100vh;
  font-family: 'Queens Condensed', 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.theme-sr-premium .container {
  background: var(--theme-bg) !important;
  color: var(--theme-text) !important;
  font-family: 'Queens Condensed', 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.theme-sr-premium .card {
  background-color: var(--theme-card-bg) !important;
  border: 1px solid var(--theme-border) !important;
  color: var(--theme-text) !important;
  box-shadow: 0 8px 25px var(--theme-shadow) !important;
  border-radius: 12px !important;
}

.theme-sr-premium .text-muted {
  color: var(--theme-text-muted) !important;
}

.theme-sr-premium .card-header {
  background: rgba(255, 255, 255, 0.05) !important;
  border-bottom: 1px solid var(--theme-border) !important;
  border-radius: 12px 12px 0 0 !important;
}

.theme-sr-premium .btn-primary {
  background: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: var(--theme-bg) !important;
  border-radius: 8px !important;
  padding: 12px 24px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

.theme-sr-premium .btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(var(--theme-primary-rgb), 0.3) !important;
  background: var(--theme-secondary) !important;
  color: var(--theme-bg) !important;
}

.theme-sr-premium .btn-outline-primary {
  border-color: var(--theme-primary) !important;
  color: var(--theme-primary) !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

.theme-sr-premium .btn-outline-primary:hover {
  background: var(--theme-primary) !important;
  color: var(--theme-bg) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(var(--theme-primary-rgb), 0.2) !important;
}

.theme-sr-premium h1, .theme-sr-premium h2, .theme-sr-premium h3, .theme-sr-premium h4, .theme-sr-premium h5 {
  color: var(--theme-primary) !important;
  font-weight: 300 !important;
  font-family: 'Queens Condensed', 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif !important;
  letter-spacing: -0.025em !important;
}

.theme-sr-premium p, .theme-sr-premium div, .theme-sr-premium span, .theme-sr-premium label {
  font-family: 'Queens Condensed', 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.theme-sr-premium .business-logo {
  border: none !important;
  box-shadow: 0 8px 25px var(--theme-shadow) !important;
  transition: all 0.3s ease !important;
}

.theme-sr-premium .business-logo:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 12px 35px var(--theme-shadow) !important;
}

.theme-sr-premium .business-logo-fallback {
  color: var(--theme-primary) !important;
  text-shadow: 0 2px 4px var(--theme-shadow) !important;
}

.theme-sr-premium .fas.fa-hand-holding-usd {
  color: var(--theme-primary) !important;
}

/* Business Logo Styling - Transparent background, no border */
.business-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  background: transparent !important;
  border: none !important;
  box-shadow: 0 4px 12px var(--theme-shadow);
}

.business-logo-fallback {
  color: var(--theme-primary);
  font-size: 4rem;
}

@media (max-width: 576px) {
  .business-logo {
    width: 100px;
    height: 100px;
  }
}

/* Non-critical theme styles - moved from inline */

/* Purple color for affiliate fees */
.text-purple {
    color: #8b5cf6 !important;
}

/* Enhanced Hero Section Styling */
.text-gradient {
    background: linear-gradient(135deg, #007bff, #28a745, #ffc107);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand-gradient:hover {
    background: linear-gradient(135deg, #32cd32, #7fffd4, #20b2aa) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    transform: scale(1.05) !important;
}

.nav-gradient:hover {
    background: linear-gradient(135deg, #32cd32, #7fffd4, #20b2aa) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    transform: scale(1.02) !important;
}

.hero-description {
    background: linear-gradient(135deg, rgba(0,123,255,0.05), rgba(40,167,69,0.05), rgba(255,193,7,0.05));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.feature-icon {
    position: relative;
    display: inline-block;
}

.feature-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(0,123,255,0.1), rgba(40,167,69,0.1));
    border-radius: 50%;
    z-index: -1;
}

.feature-icon i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.feature-icon:hover i {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .hero-description {
        margin: 0 1rem;
    }
    
    .feature-icon::before {
        width: 60px;
        height: 60px;
    }
}

/* Loading States for Time Period Picker */
.btn-loading {
    position: relative;
    opacity: 0.6;
    background: rgba(var(--bs-primary-rgb), 0.1) !important;
    backdrop-filter: blur(2px);
    border-color: rgba(var(--bs-primary-rgb), 0.3) !important;
    cursor: not-allowed !important;
    transition: all 0.3s ease;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.1) 0%, 
        rgba(255,255,255,0.3) 50%, 
        rgba(255,255,255,0.1) 100%);
    animation: shimmer 1.5s infinite;
    border-radius: inherit;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.card-loading {
    position: relative;
    pointer-events: none;
}

.card-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(1px);
    border-radius: inherit;
    z-index: 10;
    animation: pulse-loading 1.5s infinite;
}

@keyframes pulse-loading {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Dark theme adjustments for loading states */
[data-bs-theme="dark"] .card-loading::after {
    background: rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .btn-loading {
    background: rgba(var(--bs-primary-rgb), 0.15) !important;
}

/* Form loading states */
.form-loading {
    opacity: 0.7 !important;
    position: relative !important;
}

.form-loading::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(1px) !important;
    z-index: 10 !important;
    border-radius: 0.375rem !important;
}

.btn-loading {
    position: relative !important;
}

.btn-loading .btn-text {
    opacity: 0.3 !important;
}

.btn-loading::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 20px !important;
    height: 20px !important;
    margin: -10px 0 0 -10px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-top: 2px solid #fff !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
}

/* Navbar link loading states */
.nav-link-loading {
    position: relative !important;
    opacity: 1 !important;
    pointer-events: none !important;
    background: #28a745 !important;
    color: #ffffff !important;
    backdrop-filter: blur(4px) !important;
    border-radius: 0.375rem !important;
    transition: all 0.3s ease !important;
    border: 2px solid #155724 !important;
    transform: scale(0.95) !important;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.6) !important;
}

.nav-link-loading::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
    animation: shimmer 1.5s infinite !important;
    border-radius: inherit !important;
}

.nav-link-loading::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    right: 8px !important;
    width: 12px !important;
    height: 12px !important;
    margin-top: -6px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-top: 2px solid #ffffff !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
}

/* Dark theme navbar loading adjustments */
[data-bs-theme="dark"] .nav-link-loading {
    background: rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .nav-link-loading::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent) !important;
}

/* Additional navbar loading styles */
.navbar .nav-link-loading {
    margin: 0 2px !important;
    padding: 0.5rem 0.75rem !important;
}

/* Brand logo loading state */
.navbar-brand-loading {
    opacity: 0.6 !important;
    pointer-events: none !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(2px) !important;
    border-radius: 0.375rem !important;
    transition: all 0.3s ease !important;
    transform: scale(0.98) !important;
}

/* Adjust when navbar is collapsed */
.navbar-toggler[aria-expanded="true"] ~ .container-fluid + .language-selector {
    top: 120px !important;
}