@tailwind base;
@tailwind components;
@tailwind utilities;

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  width: 100vw;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

@layer utilities {
  .text-balance {
    text-wrap: balance;
  }
}

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 3.9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 96.1%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;
    --accent: 0 0% 96.1%;
    --accent-foreground: 0 0% 9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 89.8%;
    --input: 0 0% 89.8%;
    --ring: 0 0% 3.9%;
    --chart-1: 12 76% 61%;
    --chart-2: 173 58% 39%;
    --chart-3: 197 37% 24%;
    --chart-4: 43 74% 66%;
    --chart-5: 27 87% 67%;
    --radius: 0.5rem;
    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 240 5.9% 10%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 240 4.8% 95.9%;
    --sidebar-accent-foreground: 240 5.9% 10%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
  .dark {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;
    --card: 0 0% 3.9%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 3.9%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 9%;
    --secondary: 0 0% 14.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 0 0% 14.9%;
    --muted-foreground: 0 0% 63.9%;
    --accent: 0 0% 14.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 14.9%;
    --input: 0 0% 14.9%;
    --ring: 0 0% 83.1%;
    --chart-1: 220 70% 50%;
    --chart-2: 160 60% 45%;
    --chart-3: 30 80% 55%;
    --chart-4: 280 65% 60%;
    --chart-5: 340 75% 55%;
    --sidebar-background: 240 5.9% 10%;
    --sidebar-foreground: 240 4.8% 95.9%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 240 3.7% 15.9%;
    --sidebar-accent-foreground: 240 4.8% 95.9%;
    --sidebar-border: 240 3.7% 15.9%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* Additional Widget-specific styles */
.w-full { width: 100%; }
.min-h-500 { min-height: 500px; }
.bg-gray-50 { background-color: #f9fafb; }
.p-4 { padding: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }

/* Cards */
.bg-white { background-color: white; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }

/* New goal card styles for modern design */
.goal-card-modern {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  max-width: 220px;
  min-height: 160px;
  flex: 1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.goal-card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.goal-card-modern:hover {
  border-color: #9ca3af;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.goal-card-modern:hover::before {
  opacity: 1;
}

.goal-card-modern.selected {
  border-color: #2563eb;
  background: #2563eb;
  color: white;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.25), 0 8px 10px -6px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.goal-card-modern.selected::before {
  opacity: 0;
}

/* Form field styling improvements */
.form-field-modern {
  position: relative;
  flex: 1;
  max-width: 16rem;
}

.form-input-modern {
  width: 100%;
  padding: 16px 20px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 16px;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.form-input-modern:hover {
  border-color: #9ca3af;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.form-input-modern:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input-modern.placeholder {
  color: #9ca3af;
}

/* Icon styling within form inputs */
.form-input-icon {
  width: 20px;
  height: 20px;
  color: #9ca3af;
  margin-right: 8px;
}

/* Button styling improvements */
.btn-modern {
  background: #2563eb;
  color: white;
  padding: 16px 48px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-modern:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.btn-modern:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Container improvements */
.widget-container {
  background: #f8fafc;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.main-card {
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
}

/* Typography improvements */
.heading-main {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.subheading {
  font-size: 1.125rem;
  color: #64748b;
  font-weight: 500;
  line-height: 1.5;
}

/* Typography */
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-gray-600 { color: #4b5563; }
.text-gray-500 { color: #6b7280; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-white { color: white; }
.text-blue-600 { color: #2563eb; }
.text-blue-800 { color: #1e40af; }
.text-orange-600 { color: #ea580c; }
.text-green-600 { color: #16a34a; }
.text-purple-600 { color: #9333ea; }

/* Background colors */
.bg-orange-100 { background-color: #fed7aa; }
.bg-green-100 { background-color: #dcfce7; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-gray-200 { background-color: #e5e7eb; }

/* Spacing */
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* Grid Layout */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Flexbox */
.justify-between { justify-content: space-between; }
.items-stretch { align-items: stretch; }
.flex-1 { flex: 1 1 0%; }

/* Borders */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-blue-500 { border-color: #3b82f6; }
.rounded-md { border-radius: 0.375rem; }

/* Goal Cards */
.goal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  max-width: 140px;
  flex: 1 1 0%;
}

.goal-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.goal-card.selected {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.goal-icon {
  width: 1rem;
  height: 1rem;
  margin-bottom: 0.5rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-select {
  width: 100%;
  height: 3rem;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  background-color: white;
  color: #111827;
}

.form-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select option {
  color: #111827;
  background-color: white;
}

/* Select placeholder styling */
.form-select:invalid {
  color: #6b7280;
}

/* Remove white text from all select elements */
select {
  color: #111827 !important;
  background-color: white !important;
}

select option {
  color: #111827 !important;
  background-color: white !important;
}

/* Tooltip fixes */
.group:hover .absolute {
  color: #111827 !important;
  background-color: #f9fafb !important;
  border: 1px solid #d1d5db;
}

/* Remove white text from tooltips */
span[role="img"] + * {
  color: #374151 !important;
}

/* Slider label fixes */
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280 !important;
  font-weight: 500;
}

.slider-labels span {
  color: #6b7280 !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background-color: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-primary:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-full {
  width: 100%;
}

/* Transitions */
.transition-all { transition-property: all; }
.duration-200 { transition-duration: 200ms; }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }

/* Text utilities */
.whitespace-nowrap { white-space: nowrap; }

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Width utilities */
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.min-w-60 { min-width: 15rem; }
.max-w-64 { max-width: 16rem; }

/* Max width */
.max-w-2xl { max-width: 42rem; }

/* Min height */
.min-h-700 { min-height: 800px; }

/* Shadow utilities */
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }

/* Slider Styles */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e5e7eb;
  border-radius: 5px;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #3b82f6;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #3b82f6;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom Select Dropdown Styles */
.custom-select {
  position: relative;
  width: 100%;
}

/* Force wider dropdown containers */
.dropdown-container-wide {
  max-width: 220px !important;
  min-width: 220px !important;
}

.custom-select-trigger {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50px;
  font-size: 16px;
  color: #ffffff !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
}

.custom-select-trigger:hover {
  border-color: rgba(255, 255, 255, 0.5) !important;
}

.custom-select-trigger:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.custom-select-trigger.placeholder {
  color: rgba(255, 255, 255, 0.7) !important;
}

.custom-select-chevron {
  width: 20px;
  height: 20px;
  color: #6b7280;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.custom-select-chevron.open {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  max-height: 180px;
  overflow-y: auto;
  backdrop-filter: blur(15px);
}

.custom-select-option {
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  border: none;
  background: transparent !important;
  color: #ffffff !important;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-select-option:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
}

.custom-select-option:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.3) !important;
}

.custom-select-option:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.custom-select-option:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Selected Country Tags */
.selected-country-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #dbeafe;
  color: #1e40af;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.selected-country-flag {
  width: 16px;
  height: 12px;
  border-radius: 2px;
}

.remove-country-btn {
  background: none;
  border: none;
  color: #1e40af;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.remove-country-btn:hover {
  background-color: rgba(30, 64, 175, 0.1);
  color: #1e3a8a;
}

/* Form improvements */
.form-label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Goal card improvements */
.goal-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  max-width: 140px;
  flex: 1;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.goal-card:hover {
  border-color: #9ca3af;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.goal-card.selected {
  border-color: #3b82f6;
  background-color: #eff6ff;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

.goal-icon {
  width: 32px;
  height: 32px;
  padding: 8px;
  border-radius: 8px;
  margin: 0 auto 12px;
}

/* Button improvements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  gap: 8px;
}

.btn-primary {
  background: #3b82f6;
  color: white;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-full {
  width: 100%;
  max-width: 400px;
}

/* Modal styling */
.modal-overlay {
  z-index: 9999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
}

.modal-content {
  z-index: 10000 !important;
  position: relative !important;
}

/* Ensure modals appear above everything */
.z-50 { z-index: 9999 !important; }

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Widget root container - remove all margins and padding */
#widget-root, #root {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: calc(100% + 100px) !important;
}

/* Ensure proper layout flow */
.dropdown-container-wide {
  flex: 0 0 220px;
}

