/**
 * SarasotaRelated.com Lead Generation Widget - Custom Styles
 * Enhances Tailwind CSS with project-specific components and animations
 */

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

/* CSS Custom Properties for SarasotaRelated Brand Colors */
:root {
  /* Primary Brand Colors */
  --br-blue: #14307a;
  --br-orange: #ee7b34;
  --br-light-grey: #f7f7f7;
  --br-red: #d9534f;
  --br-white: #ffffff;
  
  /* Extended Color Palette */
  --br-blue-light: #1e3f8c;
  --br-blue-dark: #0f2654;
  --br-orange-light: #f59e0b;
  --br-orange-dark: #d97706;
  
  /* Status Colors */
  --success-green: #10b981;
  --warning-yellow: #f59e0b;
  --error-red: #ef4444;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* Base Styles */
body {
  font-family: var(--font-primary);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background-color: var(--br-light-grey);
}

/* Enhanced Google Places Autocomplete Styling */
.pac-container {
  background-color: var(--br-white);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border-top: none;
  margin-top: 2px;
  font-family: var(--font-primary);
}

.pac-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  line-height: 1.4;
  font-size: 14px;
}

.pac-item:last-child {
  border-bottom: none;
}

.pac-item:hover {
  background-color: #f9fafb;
}

.pac-item-selected {
  background-color: #eff6ff !important;
}

.pac-matched {
  color: var(--br-blue);
  font-weight: 600;
}

.pac-icon {
  margin-right: 8px;
  margin-top: 2px;
}

.pac-item-query {
  color: #374151;
  font-weight: 500;
}

/* Custom Animation Classes */
.slide-up {
  animation: slideUp 0.3s ease-out;
}

.slide-down {
  animation: slideDown 0.3s ease-out;
}

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

.fade-out {
  animation: fadeOut 0.3s ease-out;
}

.pulse-orange {
  animation: pulseOrange 2s infinite;
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Keyframe Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 300px;
  }
}

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

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

@keyframes pulseOrange {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(238, 123, 52, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(238, 123, 52, 0);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Progress Bar Enhancements */
.progress-glow {
  box-shadow: 0 0 10px rgba(238, 123, 52, 0.5);
}

/* Custom Form Focus States */
.form-input-focus {
  transition: all 0.2s ease-in-out;
}

.form-input-focus:focus {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Button Hover Effects */
.btn-primary-hover {
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
}

.btn-primary-hover:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-primary-hover:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

/* Loading Spinner Custom */
.spinner-custom {
  border: 3px solid #f3f4f6;
  border-top: 3px solid var(--br-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Status Message Variants */
.status-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-left: 4px solid var(--success-green);
}

.status-error {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  border-left: 4px solid var(--error-red);
}

.status-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left: 4px solid var(--warning-yellow);
}

.status-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-left: 4px solid var(--br-blue);
}

/* Card Hover Effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* Trust Indicator Icons */
.trust-icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Responsive Enhancements */
@media (max-width: 640px) {
  .pac-container {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Larger touch targets on mobile */
  button {
    min-height: 44px;
  }
  
  input {
    min-height: 44px;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --br-blue: #0000cc;
    --br-orange: #ff6600;
  }
}

/* Image Editor Styles */
.image-editor-section {
  margin-bottom: 1.5rem;
}

.image-preview-container {
  position: relative;
}

.image-preview-container img {
  max-width: 100%;
  height: auto;
  transition: opacity 0.2s ease-in-out;
}

.image-preview-container img.loading {
  opacity: 0.5;
}

.image-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.image-info span {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Crop Controls */
.crop-controls {
  margin: 1rem 0;
}

.crop-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.crop-btn {
  min-width: 60px;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 2px solid;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.crop-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.crop-btn.active {
  border-color: var(--br-blue);
  color: var(--br-blue);
  background-color: #eff6ff;
  font-weight: 600;
}

.crop-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Upload Button */
.upload-image-btn {
  transition: all 0.2s ease-in-out;
}

.upload-image-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.upload-image-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* Image Placeholder */
.image-preview-container [id$="-placeholder"] {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
}

.image-preview-container [id$="-placeholder"] span {
  color: #9ca3af;
  font-size: 0.75rem;
}

/* Responsive adjustments for image editor */
@media (max-width: 640px) {
  .crop-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .crop-btn {
    width: 100%;
  }
  
  .image-preview-container img {
    width: 100%;
  }
}

/* Dark mode preparation (for future use) */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles can be added here in the future */
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
    }
}
