/**
 * HyzenPro Frontend Styles
 * Global styles for all HyzenPro blocks
 */

/* Reset and base styles */
.hyzenpro-block {
  box-sizing: border-box;
}

.hyzenpro-block *,
.hyzenpro-block *::before,
.hyzenpro-block *::after {
  box-sizing: inherit;
}

/* Common button styles */
.hyzenpro-button {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  line-height: 1.4;
}

.hyzenpro-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hyzenpro-button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.hyzenpro-button:active {
  transform: translateY(0);
}

/* Common icon styles */
.hyzenpro-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.hyzenpro-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Common loading styles */
.hyzenpro-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 14px;
}

.hyzenpro-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: hyzenpro-spin 1s linear infinite;
}

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

/* Common message styles */
.hyzenpro-message {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin: 12px 0;
}

.hyzenpro-message.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #065f46;
}

.hyzenpro-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #991b1b;
}

.hyzenpro-message.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
}

.hyzenpro-message.info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #1e40af;
}

/* Common responsive utilities */
.hyzenpro-hide-mobile {
  display: block;
}

.hyzenpro-show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hyzenpro-hide-mobile {
    display: none;
  }
  
  .hyzenpro-show-mobile {
    display: block;
  }
}

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

/* Focus styles for better accessibility */
.hyzenpro-block button:focus,
.hyzenpro-block a:focus,
.hyzenpro-block input:focus,
.hyzenpro-block textarea:focus,
.hyzenpro-block select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Common animation classes */
.hyzenpro-fade-in {
  animation: hyzenpro-fade-in 0.5s ease-out;
}

.hyzenpro-slide-up {
  animation: hyzenpro-slide-up 0.5s ease-out;
}

.hyzenpro-scale-in {
  animation: hyzenpro-scale-in 0.3s ease-out;
}

@keyframes hyzenpro-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes hyzenpro-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hyzenpro-scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Print styles */
@media print {
  .hyzenpro-user-rating,
  .hyzenpro-content-callout.is-dismissible .hyzenpro-dismiss-button {
    display: none !important;
  }
  
  .hyzenpro-affiliate-product .hyzenpro-cta-button {
    background: transparent !important;
    color: #000 !important;
    border: 1px solid #000 !important;
  }
  
  .hyzenpro-comparison-table {
    break-inside: avoid;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .hyzenpro-block {
    border-width: 2px;
  }
  
  .hyzenpro-button {
    border: 2px solid currentColor;
  }
  
  .hyzenpro-star,
  .hyzenpro-thumbs-button,
  .hyzenpro-emoji-button {
    border: 1px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .hyzenpro-block *,
  .hyzenpro-block *::before,
  .hyzenpro-block *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* RTL support */
[dir="rtl"] .hyzenpro-block {
  text-align: right;
}

[dir="rtl"] .hyzenpro-pros-cons-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .hyzenpro-affiliate-product .hyzenpro-product-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .hyzenpro-callout-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .hyzenpro-callout-content.icon-right {
  flex-direction: row;
}

/* Block category styles */
.block-editor-block-types-list__item[data-id*="hyzenpro"] .block-editor-block-types-list__item-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 4px;
}

/* Common block wrapper styles */
.wp-block-hyzenpro-pros-cons,
.wp-block-hyzenpro-affiliate-product,
.wp-block-hyzenpro-comparison-table,
.wp-block-hyzenpro-user-rating,
.wp-block-hyzenpro-content-callout {
  margin: 1.5em 0;
}

/* Ensure blocks don't break layout */
.wp-block-hyzenpro-comparison-table {
  overflow-x: auto;
}

/* Common hover effects */
.hyzenpro-block [class*="button"]:hover,
.hyzenpro-block [class*="cta"]:hover {
  transform: translateY(-1px);
}

.hyzenpro-block [class*="card"]:hover,
.hyzenpro-block [class*="product"]:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Ensure proper spacing in block editor */
.block-editor-block-list__layout .wp-block[data-type*="hyzenpro"] {
  margin-top: 28px;
  margin-bottom: 28px;
}

