/* ==========================================================================
   Container Styles
   ========================================================================== */

.horizon-order-iframe-container {
  position: relative;
  width: 100%;
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Loading Placeholder
   ========================================================================== */

.horizon-iframe-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  color: #666;
  transition: opacity 0.3s ease;
}

.horizon-iframe-loading[data-height] {
  height: var(--iframe-height, 600px);
}

.horizon-iframe-loading-text {
  margin: 15px 0 0 0;
  font-size: 16px;
  font-weight: 500;
  color: #555;
  text-align: center;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.horizon-iframe-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e0e6ed;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: horizon-spin 1s linear infinite;
  margin-bottom: 10px;
}

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

/* ==========================================================================
/* Simple iframe height fix */
.horizon-order-iframe {
  width: 100%;
  height: 90vh !important;
  min-height: 500px;
  border: none;
  border-radius: 8px;
  transition: opacity 0.3s ease;
  background: #fff;
}

.horizon-order-iframe.loaded {
  opacity: 1;
}

.horizon-order-iframe.loading {
  opacity: 0;
}

/* ==========================================================================
   Error States
   ========================================================================== */

.horizon-iframe-error {
  padding: 20px;
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  border: 1px solid #f44336;
  border-radius: 8px;
  color: #c62828;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  margin: 20px 0;
}

.horizon-iframe-error strong {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .horizon-order-iframe-container {
    margin: 15px 0;
    border-radius: 6px;
  }

  .horizon-order-iframe {
    border-radius: 6px;
  }

  .horizon-iframe-loading {
    min-height: 300px;
    border-radius: 6px;
  }

  .horizon-iframe-loading-text {
    font-size: 14px;
    padding: 0 20px;
  }

  .horizon-iframe-spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }
}

@media (max-width: 480px) {
  .horizon-order-iframe-container {
    margin: 10px 0;
    border-radius: 4px;
  }

  .horizon-order-iframe {
    border-radius: 4px;
  }

  .horizon-iframe-loading {
    min-height: 250px;
    border-radius: 4px;
    padding: 20px;
  }

  .horizon-iframe-loading-text {
    font-size: 13px;
  }

  .horizon-iframe-spinner {
    width: 35px;
    height: 35px;
  }
}

/* ==========================================================================
   Theme Integration
   ========================================================================== */

/* Light theme support */
.horizon-order-iframe-container.light-theme {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.horizon-order-iframe-container.light-theme .horizon-iframe-loading {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-color: #dee2e6;
  color: #495057;
}

/* Custom height support */
.horizon-order-iframe-container[data-iframe-height='90vh']
  .horizon-iframe-loading {
  height: 90vh;
  min-height: 500px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .horizon-order-iframe {
    height: 85vh !important;
    min-height: 400px;
  }

  .horizon-order-iframe-container[data-iframe-height='90vh']
    .horizon-iframe-loading {
    height: 85vh;
    min-height: 400px;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.horizon-order-iframe:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .horizon-iframe-loading {
    background: #ffffff;
    border: 2px solid #000000;
    color: #000000;
  }

  .horizon-iframe-spinner {
    border-color: #cccccc;
    border-top-color: #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .horizon-iframe-spinner {
    animation: none;
  }

  .horizon-order-iframe,
  .horizon-iframe-loading {
    transition: none;
  }
}
