/* Template Preview Page Styles - Single Column Layout */

/* ==================== PREVIEW SECTION ==================== */
.template-preview-section {
  padding: 100px 0;
  background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
  position: relative;
}

.template-preview-section .section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.template-preview-section .section-header h2 {
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.template-preview-section .section-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ==================== PREVIEW CONTROLS ==================== */
.preview-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.device-btn {
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  background: var(--white);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.device-btn i {
  font-size: 1.25rem;
}

.device-btn:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-2px);
}

.device-btn.active {
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ==================== IFRAME WRAPPER ==================== */
.iframe-wrapper {
  width: 100%;
  height: 800px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 auto;
}

.iframe-wrapper.tablet-view {
  max-width: 768px;
  height: 1024px;
}

.iframe-wrapper.mobile-view {
  max-width: 375px;
  height: 667px;
}

#templateIframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.iframe-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.iframe-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.iframe-loader p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
}

/* ==================== PREVIEW ACTIONS ==================== */
.preview-actions {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.btn-preview-visit {
  padding: 1rem 2rem;
  border-radius: 12px;
  background: var(--white);
  border: 2px solid var(--border-color);
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-preview-visit:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-preview-visit i {
  font-size: 1.25rem;
}

/* ==================== TEMPLATE FEATURES SECTION ==================== */
.template-features-section {
  padding: 100px 0;
  background: linear-gradient(180deg, #F9FAFB 0%, #FFFFFF 100%);
}

.template-features-section .section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.template-features-section .section-header h2 {
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.template-features-section .section-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-color);
  flex-shrink: 0;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0;
  line-height: 1.5;
  padding-top: 0.5rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .iframe-wrapper {
    height: 700px;
  }

  .iframe-wrapper.tablet-view {
    height: 900px;
  }

  .iframe-wrapper.mobile-view {
    height: 600px;
  }
}

@media (max-width: 768px) {
  .template-preview-section,
  .template-features-section {
    padding: 80px 0;
  }

  .template-preview-section .section-header h2,
  .template-features-section .section-header h2 {
    font-size: 2rem;
  }

  .template-preview-section .section-header,
  .template-features-section .section-header {
    margin-bottom: 2.5rem;
  }

  .preview-controls {
    gap: 0.75rem;
  }

  .device-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
  }

  .device-btn span {
    display: none;
  }

  .iframe-wrapper {
    height: 600px;
    border-radius: 12px;
  }

  .iframe-wrapper.tablet-view {
    max-width: 100%;
    height: 700px;
  }

  .iframe-wrapper.mobile-view {
    max-width: 100%;
    height: 600px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .preview-actions {
    margin-top: 1.5rem;
  }

  .btn-preview-visit {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
  }
}

@media (max-width: 480px) {
  .iframe-wrapper {
    height: 500px;
  }

  .iframe-wrapper.tablet-view,
  .iframe-wrapper.mobile-view {
    height: 550px;
  }
}

/* ==================== SMOOTH SCROLLING ==================== */
html {
  scroll-behavior: smooth;
}

/* ==================== ACCESSIBILITY ==================== */
.device-btn:focus-visible,
.btn-preview-visit:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}
