/* Customer Journey Page - Dark Theme (Joomla Style) */

/* Force dark theme on all elements */
* {
  color: #e2e8f0;
}

/* Loading Overlay */
.cj-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0f1523 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.cj-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(129, 140, 248, 0.2);
  border-top: 4px solid #818cf8;
  border-radius: 50%;
  animation: cj-spin 1s linear infinite;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.2);
}

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

.cj-loading-overlay p {
  color: #94a3b8;
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  text-align: center;
  background: rgba(15, 21, 35, 0.9);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Main Container */
.causalfunnel-customer-journey {
  max-width: 100%;
  margin: 0;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #0f1523 !important;
  color: #e2e8f0;
  min-height: 100vh;
}

.causalfunnel-customer-journey,
.causalfunnel-customer-journey * {
  background-color: transparent !important;
}

.causalfunnel-customer-journey a {
  color: #818cf8;
}

.causalfunnel-customer-journey a:hover {
  color: #a5b4fc;
}

/* Breadcrumb */
.cj-breadcrumb {
  color: #64748b;
  font-size: 0.9em;
  margin-bottom: 20px;
}

.cj-breadcrumb a {
  color: #64748b;
  text-decoration: none;
}

.cj-breadcrumb a:hover {
  color: #818cf8;
}

.cj-breadcrumb span {
  color: #818cf8;
}

/* Header */
.cj-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d1b4e 100%) !important;
  color: white;
  padding: 25px 30px;
  border-radius: 12px;
  margin-bottom: 25px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.cj-header h1 {
  margin: 0 0 8px 0;
  font-size: 1.5em;
  font-weight: 600;
  color: #818cf8;
}

.cj-header p {
  font-size: 0.95em;
  margin: 0;
  color: #94a3b8;
}

/* Filters Bar */
.cj-filters-bar {
  background: #1a2332 !important;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #2d3748;
  margin-bottom: 20px;
}

.cj-filters-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
  align-items: end;
}

@media (max-width: 900px) {
  .cj-filters-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .cj-filters-form {
    grid-template-columns: 1fr;
  }
}

.cj-filter-group {
  display: flex;
  flex-direction: column;
}

.cj-filter-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #94a3b8;
  font-size: 0.85em;
}

.cj-filter-group select,
.cj-filter-group input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #2d3748;
  border-radius: 6px;
  font-size: 14px;
  background: #0f1523 !important;
  color: #e2e8f0;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.cj-filter-group select option {
  background: #1a2332;
  color: #e2e8f0;
}

.cj-filter-group select:focus,
.cj-filter-group input[type="date"]:focus {
  border-color: #818cf8;
  outline: none;
}

.cj-btn-primary {
  padding: 10px 24px;
  background: #818cf8 !important;
  color: white !important;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  height: 42px;
}

.cj-btn-primary:hover {
  background: #6366f1 !important;
  transform: translateY(-1px);
}

/* Journey Stats */
.cj-journey-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

@media (max-width: 900px) {
  .cj-journey-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .cj-journey-stats {
    grid-template-columns: 1fr;
  }
}

.cj-stat-card {
  background: #1a2332 !important;
  padding: 25px 20px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid #2d3748;
  transition: all 0.3s ease;
}

.cj-stat-card:hover {
  background: #232d3f !important;
  border-color: #3d4a5c;
}

.cj-stat-card h3 {
  margin: 0 0 8px 0;
  font-size: 2.2em;
  color: #818cf8;
  font-weight: 600;
}

.cj-stat-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Section Cards */
.cj-section-card {
  background: #1a2332 !important;
  padding: 25px;
  border-radius: 10px;
  border: 1px solid #2d3748;
  margin-bottom: 25px;
}

.cj-section-card h3 {
  margin: 0 0 20px 0;
  color: #e2e8f0;
  font-size: 1.1em;
  font-weight: 600;
}

/* Path Selector */
.cj-path-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-start;
}

.cj-path-step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cj-path-step label {
  display: block;
  font-size: 0.75em;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cj-path-static {
  background: #0f1523 !important;
  padding: 10px 15px;
  border-radius: 6px;
  font-weight: 600;
  color: #e2e8f0;
  border: 1px solid #2d3748;
}

.cj-arrow {
  color: #64748b;
  font-size: 1.2em;
  padding-top: 15px;
}

.cj-route-dropdown {
  padding: 10px 15px;
  border: 1px solid #2d3748;
  border-radius: 6px;
  font-size: 14px;
  background: #0f1523 !important;
  color: #e2e8f0;
  cursor: pointer;
  min-width: 200px;
}

.cj-route-dropdown option {
  background: #1a2332;
  color: #e2e8f0;
}

.cj-route-dropdown:focus {
  border-color: #818cf8;
  outline: none;
}

/* Path Details */
.cj-path-details {
  display: grid;
  gap: 15px;
  margin-bottom: 25px;
}

.cj-route-level {
  background: #1a2332 !important;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #818cf8;
  border-top: 1px solid #2d3748;
  border-right: 1px solid #2d3748;
  border-bottom: 1px solid #2d3748;
}

.cj-route-level h4 {
  margin: 0 0 15px 0;
  color: #e2e8f0;
  font-weight: 600;
}

.cj-route-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
}

.cj-info-item {
  text-align: center;
  padding: 10px;
  background: #0f1523 !important;
  border-radius: 8px;
  border: 1px solid #2d3748;
}

.cj-info-value {
  font-size: 1.2em;
  font-weight: bold;
  color: #818cf8;
}

.cj-info-label {
  font-size: 0.8em;
  color: #64748b;
  margin-top: 4px;
}

/* Charts Grid */
.cj-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

@media (max-width: 768px) {
  .cj-charts-grid {
    grid-template-columns: 1fr;
  }
}

.cj-chart-container {
  background: #1a2332 !important;
  padding: 25px;
  border-radius: 10px;
  border: 1px solid #2d3748;
}

.cj-chart-container h3 {
  margin: 0 0 20px 0;
  color: #e2e8f0;
  font-size: 1.1em;
  font-weight: 600;
}

/* Timer Badge */
.cj-timer-badge {
  background: rgba(255, 255, 255, 0.1) !important;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cj-timer-section {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

/* Stats Bar */
.cj-stats-bar-container {
  margin-top: 15px;
}

.cj-stats-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-weight: 600;
  color: #94a3b8;
}

.cj-progress-bg {
  background-color: #2d3748 !important;
  border-radius: 8px;
  height: 12px;
  width: 100%;
  overflow: hidden;
  display: flex;
}

.cj-progress-bar {
  height: 100%;
  transition: width 0.6s ease;
}

/* Legend */
.cj-legend {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  justify-content: center;
  font-size: 0.9em;
  color: #94a3b8;
}

.cj-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cj-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.bg-desktop {
  background-color: #818cf8 !important;
}

.bg-mobile {
  background-color: #a78bfa !important;
}

.bg-organic {
  background-color: #10b981 !important;
}

.bg-paid {
  background-color: #0ea5e9 !important;
}

/* Empty State */
.cj-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
  background: #1a2332 !important;
}

.cj-empty-state-title {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e2e8f0;
}

/* Error Message */
.cj-error-message,
.cj-message-content {
  background: #1a2332 !important;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 4px solid #ef4444;
  color: #fca5a5;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.cj-message-content h3 {
  margin: 0 0 10px 0;
  color: #ef4444;
}

.cj-message-content p {
  margin: 0 0 10px 0;
  color: #fca5a5;
}

/* Responsive */
@media (max-width: 768px) {
  .causalfunnel-customer-journey {
    padding: 16px;
  }

  .cj-header {
    padding: 20px;
    margin-bottom: 20px;
  }

  .cj-header h1 {
    font-size: 1.3em;
  }

  .cj-header p {
    font-size: 0.9em;
  }

  .cj-filters-form {
    grid-template-columns: repeat(2, 1fr);
  }

  .cj-journey-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .cj-charts-grid {
    grid-template-columns: 1fr;
  }
}


/* Breadcrumb */
.cj-breadcrumb {
  color: #64748b;
  font-size: 0.9em;
  margin-bottom: 20px;
}

.cj-breadcrumb a {
  color: #64748b;
  text-decoration: none;
}

.cj-breadcrumb a:hover {
  color: #818cf8;
}

.cj-breadcrumb span {
  color: #818cf8;
}

/* Header */
.cj-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d1b4e 100%);
  color: white;
  padding: 25px 30px;
  border-radius: 12px;
  margin-bottom: 25px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.cj-header h1 {
  margin: 0 0 8px 0;
  font-size: 1.5em;
  font-weight: 600;
  color: #818cf8;
}

.cj-header p {
  font-size: 0.95em;
  margin: 0;
  color: #94a3b8;
}

/* Filters Bar */
.cj-filters-bar {
  background: #1a2332;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #2d3748;
  margin-bottom: 20px;
}

.cj-filters-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
  align-items: end;
}

@media (max-width: 900px) {
  .cj-filters-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .cj-filters-form {
    grid-template-columns: 1fr;
  }
}

.cj-filter-group {
  display: flex;
  flex-direction: column;
}

.cj-filter-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #94a3b8;
  font-size: 0.85em;
}

.cj-filter-group select,
.cj-filter-group input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #2d3748;
  border-radius: 6px;
  font-size: 14px;
  background: #0f1523;
  color: #e2e8f0;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.cj-filter-group select:focus,
.cj-filter-group input[type="date"]:focus {
  border-color: #818cf8;
  outline: none;
}

.cj-btn-primary {
  padding: 10px 24px;
  background: #818cf8;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  height: 42px;
}

.cj-btn-primary:hover {
  background: #6366f1;
  transform: translateY(-1px);
}

/* Journey Stats */
.cj-journey-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

@media (max-width: 900px) {
  .cj-journey-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .cj-journey-stats {
    grid-template-columns: 1fr;
  }
}

.cj-stat-card {
  background: #1a2332;
  padding: 25px 20px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid #2d3748;
}

.cj-stat-card h3 {
  margin: 0 0 8px 0;
  font-size: 2.2em;
  color: #818cf8;
  font-weight: 600;
}

.cj-stat-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Section Cards */
.cj-section-card {
  background: #1a2332;
  padding: 25px;
  border-radius: 10px;
  border: 1px solid #2d3748;
  margin-bottom: 25px;
}

.cj-section-card h3 {
  margin: 0 0 20px 0;
  color: #e2e8f0;
  font-size: 1.1em;
  font-weight: 600;
}

/* Path Selector */
.cj-path-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-start;
}

.cj-path-step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cj-path-step label {
  display: block;
  font-size: 0.75em;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cj-path-static {
  background: #0f1523;
  padding: 10px 15px;
  border-radius: 6px;
  font-weight: 600;
  color: #e2e8f0;
  border: 1px solid #2d3748;
}

.cj-arrow {
  color: #64748b;
  font-size: 1.2em;
  padding-top: 15px;
}

.cj-route-dropdown {
  padding: 10px 15px;
  border: 1px solid #2d3748;
  border-radius: 6px;
  font-size: 14px;
  background: #0f1523;
  color: #e2e8f0;
  cursor: pointer;
  min-width: 200px;
}

.cj-route-dropdown:focus {
  border-color: #818cf8;
  outline: none;
}

/* Path Details */
.cj-path-details {
  display: grid;
  gap: 15px;
  margin-bottom: 25px;
}

.cj-route-level {
  background: #1a2332;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #818cf8;
  border-top: 1px solid #2d3748;
  border-right: 1px solid #2d3748;
  border-bottom: 1px solid #2d3748;
}

.cj-route-level h4 {
  margin: 0 0 15px 0;
  color: #e2e8f0;
  font-weight: 600;
}

.cj-route-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
}

.cj-info-item {
  text-align: center;
  padding: 10px;
  background: #0f1523;
  border-radius: 8px;
  border: 1px solid #2d3748;
}

.cj-info-value {
  font-size: 1.2em;
  font-weight: bold;
  color: #818cf8;
}

.cj-info-label {
  font-size: 0.8em;
  color: #64748b;
  margin-top: 4px;
}

/* Charts Grid */
.cj-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

@media (max-width: 768px) {
  .cj-charts-grid {
    grid-template-columns: 1fr;
  }
}

.cj-chart-container {
  background: #1a2332;
  padding: 25px;
  border-radius: 10px;
  border: 1px solid #2d3748;
}

.cj-chart-container h3 {
  margin: 0 0 20px 0;
  color: #e2e8f0;
  font-size: 1.1em;
  font-weight: 600;
}

/* Timer Badge */
.cj-timer-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cj-timer-section {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

/* Stats Bar */
.cj-stats-bar-container {
  margin-top: 15px;
}

.cj-stats-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-weight: 600;
  color: #94a3b8;
}

.cj-progress-bg {
  background-color: #2d3748;
  border-radius: 8px;
  height: 12px;
  width: 100%;
  overflow: hidden;
  display: flex;
}

.cj-progress-bar {
  height: 100%;
  transition: width 0.6s ease;
}

/* Legend */
.cj-legend {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  justify-content: center;
  font-size: 0.9em;
  color: #94a3b8;
}

.cj-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cj-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.bg-desktop {
  background-color: #818cf8;
}

.bg-mobile {
  background-color: #a78bfa;
}

.bg-organic {
  background-color: #10b981;
}

.bg-paid {
  background-color: #0ea5e9;
}

/* Empty State */
.cj-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.cj-empty-state-title {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e2e8f0;
}

/* Error Message */
.cj-error-message {
  background: #1a2332;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 4px solid #ef4444;
  color: #fca5a5;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .causalfunnel-customer-journey {
    padding: 16px;
  }

  .cj-header {
    padding: 20px;
    margin-bottom: 20px;
  }

  .cj-header h1 {
    font-size: 1.3em;
  }

  .cj-header p {
    font-size: 0.9em;
  }

  .cj-filters-form {
    grid-template-columns: repeat(2, 1fr);
  }

  .cj-journey-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .cj-charts-grid {
    grid-template-columns: 1fr;
  }
}
