/**
 * 100x Life Planning System - Layout Styles
 * Header, container, grid systems, and structural elements
 */

/* ===== HEADER ===== */
.header {
  background: var(--navy-primary);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--teal-accent);
  box-shadow: 0 2px 8px rgba(26, 43, 74, 0.15);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.header-actions .btn-ghost {
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.4);
  background: transparent;
}

.header-actions .btn-ghost:hover {
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

/* ===== MAIN CONTAINER ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-xl);
}

/* ===== OVERVIEW MODE ===== */
.overview-container {
  position: relative;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
  overflow: hidden; /* Clip the SVG here instead of on container */
}

.hero-background .hero-path {
  width: 100%;
  height: 100%;
}

.hero-background .hero-x {
  position: absolute;
  right: 5%;
  top: 85px;
}

/* Floating particles background */
.floaters-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.floaters-container::before,
.floaters-container::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(74, 155, 181, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(74, 155, 181, 0.2), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(74, 155, 181, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 130px 80px, rgba(26, 43, 74, 0.3), transparent),
    radial-gradient(2px 2px at 160px 120px, rgba(74, 155, 181, 0.25), transparent),
    radial-gradient(1px 1px at 200px 50px, rgba(26, 43, 74, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 250px 150px, rgba(74, 155, 181, 0.2), transparent),
    radial-gradient(2px 2px at 300px 90px, rgba(74, 155, 181, 0.3), transparent),
    radial-gradient(1px 1px at 350px 180px, rgba(26, 43, 74, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 400px 60px, rgba(74, 155, 181, 0.35), transparent),
    radial-gradient(2px 2px at 450px 130px, rgba(74, 155, 181, 0.2), transparent),
    radial-gradient(1px 1px at 500px 200px, rgba(26, 43, 74, 0.3), transparent),
    radial-gradient(2px 2px at 550px 40px, rgba(74, 155, 181, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 600px 170px, rgba(74, 155, 181, 0.3), transparent);
  background-size: 650px 650px;
  animation: float 120s linear infinite;
}

.floaters-container::after {
  background-image:
    radial-gradient(1.5px 1.5px at 80px 100px, rgba(74, 155, 181, 0.25), transparent),
    radial-gradient(2px 2px at 120px 180px, rgba(26, 43, 74, 0.3), transparent),
    radial-gradient(1px 1px at 180px 60px, rgba(74, 155, 181, 0.35), transparent),
    radial-gradient(2px 2px at 220px 140px, rgba(74, 155, 181, 0.2), transparent),
    radial-gradient(1.5px 1.5px at 280px 200px, rgba(26, 43, 74, 0.25), transparent),
    radial-gradient(1px 1px at 340px 80px, rgba(74, 155, 181, 0.3), transparent),
    radial-gradient(2px 2px at 380px 160px, rgba(74, 155, 181, 0.2), transparent),
    radial-gradient(1.5px 1.5px at 440px 40px, rgba(26, 43, 74, 0.35), transparent),
    radial-gradient(1px 1px at 500px 120px, rgba(74, 155, 181, 0.25), transparent),
    radial-gradient(2px 2px at 560px 190px, rgba(74, 155, 181, 0.3), transparent);
  background-size: 580px 580px;
  animation: float 100s linear infinite reverse;
  animation-delay: -30s;
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0.6;
  }
  25% {
    opacity: 0.8;
  }
  50% {
    transform: translateY(-25%) translateX(-10%);
    opacity: 0.5;
  }
  75% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-50%) translateX(-20%);
    opacity: 0.6;
  }
}

.overview-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.overview-header h1 {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  color: var(--navy-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.overview-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.overview-header .progress-bar {
  margin: 1.5rem auto;
  max-width: 400px;
}

/* ===== AI SUGGESTION ===== */
.ai-suggestion {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--teal-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: var(--spacing-xl);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.ai-icon {
  width: 44px;
  height: 44px;
  background: var(--teal-light);
  color: var(--teal-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-suggestion-content {
  flex: 1;
}

.ai-suggestion-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--navy-primary);
}

.ai-suggestion-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.ai-suggestion .btn {
  flex-shrink: 0;
}

/* ===== ROADMAP GRID ===== */
.roadmap-grid {
  display: grid;
  gap: 1rem;
}

.section-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.foundation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: var(--spacing-xl);
  padding: 15px; /* Allow space for glow effect */
  margin: -15px; /* Compensate for padding */
  margin-bottom: calc(var(--spacing-xl) - 15px);
}

/* ===== ACTION PLANNING GRID ===== */
.action-section {
  margin-top: var(--spacing-xl);
}

.action-grid {
  display: grid;
  grid-template-columns: 180px repeat(5, 1fr);
  gap: 2px;
  background: var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.action-header {
  background: var(--navy-primary);
  padding: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-light);
  border-bottom: 2px solid var(--teal-accent);
}

.action-row-label {
  background: var(--navy-primary);
  color: var(--text-light);
  padding: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.action-cell {
  background: var(--bg-primary);
  padding: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 60px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-cell:hover {
  background: var(--bg-tertiary);
}

.action-cell.has-content {
  color: var(--text-dark);
}

.action-cell.active-cell {
  border: 2px solid var(--teal-accent);
  box-shadow: 0 0 10px rgba(74, 155, 181, 0.2);
}

/* ===== INTERVIEW MODE ===== */
.interview-container {
  display: none;
  max-width: 800px;
  margin: 0 auto;
}

.interview-container.active {
  display: block;
}

.interview-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: var(--spacing-xl);
}

.back-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  color: var(--navy-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1.25rem;
}

.back-btn:hover {
  border-color: var(--navy-primary);
  background: var(--bg-tertiary);
}

.interview-title {
  flex: 1;
}

.interview-title h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--navy-primary);
  font-weight: 600;
}

.interview-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.interview-actions {
  display: flex;
  gap: 1rem;
  margin-top: var(--spacing-lg);
  justify-content: flex-end;
}

/* ===== ACTION INTERVIEW MODE ===== */
.action-interview-container {
  display: none;
  max-width: 900px;
  margin: 0 auto;
}

.action-interview-container.active {
  display: block;
}

.action-context {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--navy-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
}

.action-context-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.action-context-icon {
  width: 36px;
  height: 36px;
  background: var(--navy-primary);
  color: var(--text-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-context-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--navy-primary);
  font-weight: 600;
}

.action-context-content {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  padding-left: 2.75rem;
}

.action-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.action-nav-btn {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.action-nav-btn:hover {
  border-color: var(--navy-primary);
  color: var(--navy-primary);
}

.action-nav-btn.active {
  background: var(--navy-primary);
  border-color: var(--navy-primary);
  color: var(--text-light);
}

.action-nav-btn.completed {
  border-color: var(--teal-accent);
  color: var(--teal-accent);
}

/* ===== MODE TOGGLE ===== */
.mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mode-toggle-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-toggle-btn:hover {
  border-color: var(--navy-primary);
}

.mode-toggle-btn.active {
  background: var(--navy-primary);
  border-color: var(--navy-primary);
  color: var(--text-light);
}

/* AI Mode Toggle */
.ai-mode-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.ai-mode-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  width: 140px;
  height: 36px;
  background: var(--bg-tertiary);
  border-radius: 18px;
  padding: 3px;
  cursor: pointer;
  border: 1px solid var(--border-light);
}

.toggle-switch-inner {
  display: flex;
  height: 100%;
}

.toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  z-index: 1;
  transition: color var(--transition-fast);
  gap: 0.25rem;
}

.toggle-option.active {
  color: var(--text-light);
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--navy-primary);
  border-radius: 15px;
  transition: transform var(--transition-fast);
}

.toggle-switch.ai-off .toggle-slider {
  transform: translateX(100%);
}

.ai-mode-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
}

.toggle-group {
  display: flex;
  background: var(--navy-medium);
  border-radius: var(--radius-md);
  padding: 4px;
}

.toggle-btn {
  padding: 0.5rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.toggle-btn:hover {
  color: var(--text-light);
}

.toggle-btn.active {
  background: var(--teal-accent);
  color: var(--text-light);
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
  /* Header */
  .header {
    padding: 0.75rem 1rem;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
  }

  .header-actions {
    gap: 0.5rem;
  }

  /* Hide button text on mobile, show icons only */
  .header-actions .btn-ghost {
    padding: 0.5rem;
    border: none;
    gap: 0;
  }

  .header-actions .btn-ghost span,
  .header-actions .btn-ghost:not(:has(i))::after {
    display: none;
  }

  /* Target the text nodes after icons */
  .header-actions .btn-ghost {
    font-size: 0;
  }

  .header-actions .btn-ghost i {
    font-size: 1.25rem;
  }

  /* Main container */
  .container {
    padding: 1rem;
  }

  /* Hero section */
  .hero-title {
    font-size: 1.75rem;
  }

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

  /* Progress text */
  .progress-summary {
    font-size: 0.9rem;
  }

  /* AI Suggestion box */
  .ai-suggestion {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .ai-suggestion .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0.5rem 0.75rem;
  }

  .logo-text {
    font-size: 1rem;
  }

  .logo-icon {
    width: 28px;
    height: 28px;
  }

  .logo {
    gap: 0.5rem;
  }

  .header-actions .btn-ghost i {
    font-size: 1.1rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }
}

/* AI Mode Toggle - Mobile */
@media (max-width: 768px) {
  .ai-mode-toggle {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .ai-mode-label {
    display: none;
  }

  .toggle-switch {
    width: 100%;
    height: 40px;
  }

  .toggle-option {
    font-size: 0.85rem;
  }

  .ai-mode-description {
    text-align: center;
    font-size: 0.75rem;
  }

  /* Interview action buttons */
  .interview-actions {
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .interview-actions .btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    justify-content: center;
    white-space: nowrap;
  }

  /* Guided nav buttons */
  .guided-nav {
    gap: 0.5rem;
  }

  .guided-nav .btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    justify-content: center;
    white-space: nowrap;
  }

  /* Show short text, hide long text on mobile */
  .btn-text-long {
    display: none;
  }

  .btn-text-short {
    display: inline;
  }
}
