/**
 * Gohealme React App - Styles
 * Version: 1.0.0
 */

/* Reset and Base Styles */
#gohealme-root * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#gohealme-root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading State */
#gohealme-root:empty::before {
  content: 'Loading Gohealme...';
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  font-size: 1.25rem;
  color: #667eea;
  font-weight: 600;
}

/* Overlay Backdrop */
#gohealme-root .overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Cart Slide-in Animation */
#gohealme-root .cart-panel {
  animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Button Hover Effects */
#gohealme-root button {
  transition: all 0.3s ease;
}

#gohealme-root button:hover {
  transform: translateY(-1px);
}

#gohealme-root button:active {
  transform: translateY(0);
}

/* Card Hover Effects */
#gohealme-root .product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#gohealme-root .product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Input Focus States */
#gohealme-root input,
#gohealme-root textarea {
  transition: border-color 0.3s ease;
}

#gohealme-root input:focus,
#gohealme-root textarea:focus {
  outline: none;
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Scrollbar Styling */
#gohealme-root ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#gohealme-root ::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#gohealme-root ::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

#gohealme-root ::-webkit-scrollbar-thumb:hover {
  background: #5568d3;
}

/* Notification Animation */
@keyframes slideInNotification {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutNotification {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

#gohealme-root .notification {
  animation: slideInNotification 0.3s ease-out, slideOutNotification 0.3s ease-in 1.7s;
}

/* Responsive Styles */
@media (max-width: 768px) {
  #gohealme-root .cart-panel {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  #gohealme-root .product-grid {
    grid-template-columns: 1fr !important;
  }
  
  #gohealme-root header {
    padding: 1rem !important;
  }
  
  #gohealme-root header h1 {
    font-size: 1.5rem !important;
  }
  
  #gohealme-root .hero h2 {
    font-size: 2rem !important;
  }
  
  #gohealme-root .hero p {
    font-size: 1rem !important;
  }
}

@media (max-width: 480px) {
  #gohealme-root header {
    flex-direction: column;
    gap: 1rem;
  }
  
  #gohealme-root .hero {
    padding: 2rem 1rem !important;
  }
  
  #gohealme-root .product-grid {
    padding: 2rem 1rem !important;
  }
}

/* Print Styles */
@media print {
  #gohealme-root .cart-panel,
  #gohealme-root .overlay-backdrop,
  #gohealme-root button {
    display: none !important;
  }
}

/* Accessibility */
#gohealme-root *:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
  #gohealme-root {
    color-scheme: light;
  }
}

/* Loading Spinner */
#gohealme-root .spinner {
  border: 3px solid #f3f4f6;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
#gohealme-root .message-success {
  background: #10b981;
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  margin: 1rem 0;
}

#gohealme-root .message-error {
  background: #ef4444;
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Prevent body scroll when modals are open */
body.gohealme-modal-open {
  overflow: hidden;
}

/* Image Loading State */
#gohealme-root img {
  background: #f3f4f6;
  transition: opacity 0.3s ease;
}

#gohealme-root img:not([src]) {
  opacity: 0.5;
}

/* Button Disabled State */
#gohealme-root button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* WordPress Integration Compatibility */
#gohealme-root {
  isolation: isolate;
  position: relative;
  z-index: 1;
}

/* Override WordPress defaults that might interfere */
#gohealme-root img {
  height: auto;
  max-width: 100%;
  vertical-align: middle;
}

#gohealme-root a {
  text-decoration: none;
}

#gohealme-root h1,
#gohealme-root h2,
#gohealme-root h3,
#gohealme-root h4,
#gohealme-root h5,
#gohealme-root h6 {
  font-weight: inherit;
  line-height: inherit;
}