/* CausalFunnel Heatmap Page Styles */

/* Reset and Base Styles */
.causalfunnel-container * {
  box-sizing: border-box;
}

/* Loading Overlay */
/* Enhanced Loading Overlay */
.cf-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.cf-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: cf-spin 1s linear infinite;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

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

.cf-loading-overlay p {
  color: #4b5563;
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

/* Main Container */
.causalfunnel-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  background: #f8fafc;
  min-height: 100vh;
}

/* Header Styles */
/* Modern Glassy Header Styles - Replace the existing .cf-header section */

.cf-header {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 12px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Glassy background overlay */
.cf-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.8) 0%,
    rgba(118, 75, 162, 0.9) 50%,
    rgba(59, 130, 246, 0.8) 100%
  );
  z-index: -2;
}

/* Frosted glass effect */
.cf-header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      circle at 20% 80%,
      rgba(255, 255, 255, 0.2) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 40%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    );
  z-index: -1;
}

.cf-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.cf-title-section {
  flex: 1;
}

.cf-main-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
}

.cf-heat-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  animation: cf-heat-pulse 3s ease-in-out infinite;
}

@keyframes cf-heat-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(255, 100, 0, 0.3));
  }
}

.cf-subtitle {
  font-size: 1.1rem;
  color: white;
  margin: 0;
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.01em;
}

.cf-date-badge {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 16px 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-align: center;
  min-width: 160px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.cf-date-badge:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cf-date-label {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cf-date-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .cf-header {
    padding: 24px 20px;
    margin-bottom: 24px;
  }

  .cf-header-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .cf-main-title {
    font-size: 2rem;
    gap: 12px;
  }

  .cf-subtitle {
    font-size: 1rem;
  }

  .cf-date-badge {
    min-width: 140px;
    padding: 12px 20px;
  }
}

/* Additional glassy effects for modern browsers */
@supports (backdrop-filter: blur(20px)) {
  .cf-header {
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.2) 0%,
      rgba(255, 255, 255, 0.05) 100%
    );
  }
}

/* Safari specific adjustments */
@supports (-webkit-backdrop-filter: blur(20px)) {
  .cf-header {
    -webkit-backdrop-filter: blur(20px);
  }

  .cf-date-badge {
    -webkit-backdrop-filter: blur(10px);
  }
}

/* Info Cards */
.cf-info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.cf-info-card {
  background: white;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.cf-info-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cf-card-icon {
  font-size: 1.5rem;
  padding: 8px;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cf-card-content h4 {
  margin: 0 0 4px 0;
  color: #374151;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Main Content */
.cf-main-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.cf-content-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.cf-content-header h2 {
  margin: 0;
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 600;
}

.cf-metrics-summary {
  display: flex;
  gap: 24px;
}

.cf-metric {
  text-align: center;
}

.cf-metric-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #3b82f6;
  line-height: 1;
}

.cf-metric-label {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 4px;
}

/* Table Styles */
.cf-table-container {
  overflow-x: auto;
}

.cf-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.cf-data-table thead {
  background: #f8fafc;
}

.cf-data-table th {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
  color: #374151;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cf-th-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cf-th-icon {
  font-size: 1rem;
}

.cf-table-row {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  border-bottom: 1px solid #f3f4f6;
}

.cf-table-row:hover {
  background: #f8fafc;
}

.cf-data-table td {
  padding: 16px 20px;
  vertical-align: middle;
}

.cf-td-url {
  max-width: 300px;
}

.cf-url-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  word-break: break-all;
}

.cf-url-link:hover {
  text-decoration: underline;
}

.cf-metric-value {
  font-weight: 600;
  font-size: 1rem;
  padding: 6px 12px;
  border-radius: 8px;
  display: inline-block;
  min-width: 60px;
  text-align: center;
}

.cf-clicks {
  background: #dbeafe;
  color: #1e40af;
}

.cf-moves {
  background: #dcfce7;
  color: #166534;
}

/* Progress Bar for Scroll Depth */
.cf-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cf-progress-bar {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}

.cf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 4px;
  transition: width 0.8s ease;
}

.cf-progress-text {
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
  min-width: 40px;
}

/* Buttons */
.cf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.cf-btn-primary {
  background: #3b82f6;
  color: white;
}

.cf-btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.cf-btn-secondary {
  background: #6b7280;
  color: white;
}

.cf-btn-secondary:hover {
  background: #4b5563;
}

.cf-btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Beautiful Empty State Styles */
.cf-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 40px 20px;
}

.cf-empty-content {
  text-align: center;
}

.cf-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  padding: 12px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid rgba(102, 126, 234, 0.2);
  margin-bottom: 12px;
}

.cf-status-dot {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: cf-pulse 2s infinite;
}

.cf-empty-message {
  color: #718096;
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

@keyframes cf-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Analytics Summary Cards - Repositioned at Top */
.cf-analytics-summary {
  margin-bottom: 2rem;
  margin-top: 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.cf-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.cf-summary-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cf-summary-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
}

.cf-summary-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.875rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cf-summary-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #495057;
}

/* Responsive adjustments for summary cards */
@media (max-width: 768px) {
  .cf-summary-cards {
    grid-template-columns: 1fr;
  }
}
