/* Enhanced color system with better contrast and modern palette */
:root {
  --bg: #0a0b0f;
  --bg-secondary: #12131a;
  --card: #1a1b26;
  --card-hover: #1f2030;
  --text: #e8e9f0;
  --text-secondary: #9ca3af;
  --muted: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.1);
  --accent-2: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --line: #2a2b3a;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
  --gradient-1: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-2: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
}

:root.light {
  --bg: #f8f9fc;
  --bg-secondary: #f1f3f9;
  --card: #ffffff;
  --card-hover: #f8f9fc;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.08);
  --accent-2: #7c3aed;
  --success: #059669;
  --warning: #d97706;
  --line: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

/* Enhanced background with animated gradient */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(1400px 700px at 100% -10%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(1000px 600px at -10% 20%, rgba(59, 130, 246, 0.1), transparent 50%), var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.5s ease, color 0.3s ease;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Enhanced header with better glassmorphism effect */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 15, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px var(--shadow);
  animation: slideDown 0.4s ease;
}

:root.light .header {
  background: rgba(255, 255, 255, 0.85);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.header-inner {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.5rem;
}

.brand .year {
  color: var(--accent);
  font-weight: 700;
}

.brand .subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 2px;
}

/* Animated logo with gradient and pulse effect */
.logo-blob {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--gradient-1);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
  animation: pulse 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.logo-blob::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2));
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.5);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%);
  }
  100% {
    transform: translateX(100%) translateY(100%);
  }
}

/* Enhanced navigation buttons with icons and animations */
.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tab-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-light);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab-btn:hover {
  background: var(--card);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
}

.tab-btn:hover::before {
  opacity: 1;
}

.tab-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.tab-btn svg {
  position: relative;
  z-index: 1;
}

/* Enhanced action buttons */
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
  border-color: var(--accent);
  background: var(--card-hover);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-secondary);
}

/* Enhanced theme toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--muted);
  border-radius: 28px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider:before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#theme-toggle:checked + .slider {
  background: var(--accent);
}

#theme-toggle:checked + .slider:before {
  transform: translateX(24px);
}

main {
  padding: 32px 0 100px;
}

/* Enhanced card design with better shadows and animations */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 24px var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.5s ease both;
}

.card:hover {
  box-shadow: 0 8px 32px var(--shadow-lg);
  transform: translateY(-2px);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* New objective card design with icon and better layout */
.objective-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 4px 24px var(--shadow);
  animation: fadeInUp 0.5s ease both;
  position: relative;
  overflow: hidden;
}

.objective-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-1);
}

.objective-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.objective-content h2 {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 800;
}

.objective-content p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1rem;
}

/* New dashboard grid layout with better organization */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.metrics-primary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.metrics-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

/* Enhanced metric card designs */
.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-card:hover {
  transform: translateY(-4px);
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.metric-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.metric-info {
  flex: 1;
}

.metric-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.metric-footer {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 12px;
}

.progress-container {
  margin-top: 16px;
}

.progress {
  height: 12px;
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 12px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Smaller metric cards for secondary metrics */
.metric-icon-small {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.metric-value-small {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 12px 0;
  line-height: 1;
}

.metric-footer-small {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 8px;
}

/* Enhanced chart cards */
.chart-card {
  padding: 28px;
}

.chart-card h3 {
  margin-bottom: 20px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.chart-wrapper {
  position: relative;
  height: 240px;
}

.chart-wrapper canvas {
  max-height: 100%;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* New card-based journal layout instead of table */
.journal-entries {
  display: grid;
  gap: 20px;
}

.journal-entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.4s ease both;
  position: relative;
  overflow: hidden;
}

.journal-entry::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-1);
}

.journal-entry:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow-lg);
  border-color: var(--accent);
}

.journal-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.journal-entry-title {
  flex: 1;
  min-width: 250px;
}

.journal-entry-title h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.4;
}

.journal-entry-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.meta-badge.date {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.meta-badge.horizon {
  color: var(--accent-2);
  border-color: var(--accent-2);
  background: rgba(139, 92, 246, 0.1);
}

.journal-entry-content {
  margin-bottom: 16px;
}

.journal-entry-resume {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.journal-entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.link-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.link-badge:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.link-badge svg {
  width: 14px;
  height: 14px;
}

.journal-entry-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

/* Added styles for empty and future journal slots */
.journal-entry.empty-slot {
  opacity: 0.6;
  border-style: dashed;
  border-width: 2px;
}

.journal-entry.empty-slot:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

.journal-entry.future-slot {
  opacity: 0.4;
}

.journal-entry.future-slot:hover {
  opacity: 0.6;
}

.empty-title {
  color: var(--muted) !important;
  font-weight: 600 !important;
}

.empty-text {
  color: var(--muted) !important;
  font-style: italic;
}

/* Added styles for tools section */
.journal-entry-tools {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.tools-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.3s ease;
}

.tool-badge:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Added styles for signal tracking section */
.signal-tracking {
  margin-top: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 2px solid var(--accent);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.signal-tracking::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-1);
}

.signal-tracking-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.signal-tracking-header svg {
  width: 20px;
  height: 20px;
  animation: pulse 2s ease-in-out infinite;
}

.signal-tracking-text {
  color: var(--text);
  line-height: 1.7;
  font-size: 0.95rem;
  margin: 0;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  color: var(--muted);
  text-align: center;
  background: var(--bg-secondary);
}

/* Enhanced responsive design */
@media (max-width: 1024px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .brand {
    flex-direction: row;
    gap: 12px;
    align-items: center;
  }

  .brand h1 {
    font-size: 1.15rem;
  }

  .brand .subtitle {
    font-size: 0.8rem;
  }

  .nav {
    width: 100%;
  }

  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 12px 16px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .objective-card {
    flex-direction: column;
    padding: 24px;
  }

  .objective-icon {
    width: 56px;
    height: 56px;
  }

  .objective-content h2 {
    font-size: 1.5rem;
  }

  .metrics-primary {
    grid-template-columns: 1fr;
  }

  .metrics-secondary {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-value {
    font-size: 2rem;
  }

  .journal-entry {
    padding: 20px;
  }

  .journal-entry-header {
    flex-direction: column;
  }

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

@media print {
  .header,
  .footer,
  .tab-btn,
  .header-actions {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}

/* Added styles for schedule planning view */
.schedule-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
  padding: 4px;
}

.schedule-container::-webkit-scrollbar {
  width: 8px;
}

.schedule-container::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.schedule-container::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 4px;
}

.schedule-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.4s ease both;
}

.schedule-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 16px var(--shadow);
}

.schedule-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-secondary);
}

.schedule-content {
  flex: 1;
  min-width: 0;
}

.schedule-date {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.schedule-title {
  color: var(--text-secondary);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-status {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.status-icon svg {
  width: 18px;
  height: 18px;
}

.status-text {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Status variants */
.schedule-item.status-completed {
  border-left: 4px solid var(--success);
}

.schedule-item.status-completed .schedule-number {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.schedule-item.status-completed .status-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.schedule-item.status-completed .status-text {
  color: var(--success);
}

.schedule-item.status-pending {
  border-left: 4px solid var(--warning);
}

.schedule-item.status-pending .schedule-number {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
}

.schedule-item.status-pending .status-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.schedule-item.status-pending .status-text {
  color: var(--warning);
}

.schedule-item.status-future {
  opacity: 0.6;
  border-left: 4px solid var(--muted);
}

.schedule-item.status-future .schedule-number {
  border-color: var(--muted);
}

.schedule-item.status-future .status-icon {
  background: rgba(107, 114, 128, 0.15);
  color: var(--muted);
}

.schedule-item.status-future .status-text {
  color: var(--muted);
}

@media (max-width: 768px) {
  .schedule-item {
    flex-wrap: wrap;
    gap: 12px;
  }

  .schedule-status {
    width: 100%;
    justify-content: flex-end;
  }
}
