/* Custom Design System for AI & Agent Team Timeline */

:root {
  /* Colors */
  --bg-color: #0b0f17;
  --bg-panel: rgba(17, 24, 39, 0.65);
  --bg-dialog: rgba(15, 23, 42, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.2);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Accent Colors (HSL tailored) */
  --color-ai: hsl(38, 92%, 50%);         /* Amber */
  --color-ai-soft: hsla(38, 92%, 50%, 0.15);
  
  --color-agent: #10b981;      /* Emerald */
  --color-agent-soft: rgba(16, 185, 129, 0.15);
  
  --color-tool: #8b5cf6;       /* Violet */
  --color-tool-soft: rgba(139, 92, 246, 0.15);

  --color-danger: #ef4444;
  --color-danger-soft: rgba(239, 68, 68, 0.15);
  
  --color-star: #fbbf24;        /* Gold/Amber */
  --color-star-soft: rgba(251, 191, 36, 0.25);
  
  /* Layout */
  --container-max-width: 1000px;
  --header-height: 120px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

h1, h2, h3, h4, .stat-num {
  font-family: 'Outfit', sans-serif;
}

/* Ambient Background Glow */
.ambient-glow {
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(120px);
  opacity: 0.15;
}

.glow-1 {
  top: -10vw;
  right: -10vw;
  background: radial-gradient(circle, var(--color-agent) 0%, transparent 70%);
}

.glow-2 {
  bottom: -10vw;
  left: -10vw;
  background: radial-gradient(circle, var(--color-tool) 0%, transparent 70%);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Container */
.container {
  width: 90%;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

/* Header */
.app-header {
  padding: 2.5rem 0 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  background: rgba(11, 15, 23, 0.7);
  backdrop-filter: blur(8px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

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

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.logo-icon i {
  width: 24px;
  height: 24px;
}

.logo-text h1 {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(to right, #ffffff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.logo-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Stats */
.header-stats {
  display: flex;
  gap: 1rem;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  min-width: 100px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card.border-agent:hover {
  border-color: var(--color-agent);
}

.stat-card.border-tool-stat:hover,
.stat-card.border-tool:hover {
  border-color: var(--color-tool);
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.stat-lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* Controls & Filter Bar */
.controls-bar {
  padding: 1.25rem 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.controls-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.filter-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.filter-btn i {
  width: 16px;
  height: 16px;
}

.filter-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.04);
}

.filter-btn.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-ai { background-color: var(--color-ai); }
.dot-agent { background-color: var(--color-agent); }
.dot-tool { background-color: var(--color-tool); }

/* Buttons */
.btn {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Timeline Layout */
.timeline-main {
  padding: 4rem 0;
}

.timeline-wrapper {
  position: relative;
  padding-left: 0;
}

/* Vertical line segments per item */
.timeline-item::after {
  content: '';
  position: absolute;
  top: 26px; /* Center of dot */
  bottom: -4.5rem; /* Extends past current card, down past bottom margin to next item's dot */
  left: 160px; /* Centered with dot (162px - 2px) */
  width: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.timeline-item.team-ai::after {
  background: rgba(245, 158, 11, 0.25);
}

.timeline-item.team-agent::after {
  background: rgba(16, 185, 129, 0.25);
}

.timeline-item.highlighted::after {
  background: var(--color-star-soft) !important;
}

.timeline-item.last-in-month::after {
  display: none !important;
}

/* Timeline Item containing Date, Dot and Card */
.timeline-item {
  position: relative;
  margin-bottom: 3.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.4s forwards ease-out;
  
  display: grid;
  grid-template-columns: 140px 44px 1fr;
  align-items: start;
}

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

/* Date Left Column */
.timeline-date-side {
  grid-column: 1;
  text-align: right;
  padding-right: 1.25rem;
  padding-top: 12px;
}

.timeline-date-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: inline-block;
  text-align: center;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Dot on line */
.timeline-dot {
  grid-column: 2;
  position: relative;
  justify-self: center;
  top: 16px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #111827;
  border: 4px solid var(--text-muted);
  z-index: 2;
  box-shadow: 0 0 0 4px rgba(11, 15, 23, 1);
  transition: all 0.3s ease;
}

.timeline-item.team-ai .timeline-dot {
  border-color: var(--color-ai);
  box-shadow: 0 0 12px var(--color-ai-soft);
}

.timeline-item.team-agent .timeline-dot {
  border-color: var(--color-agent);
  box-shadow: 0 0 12px var(--color-agent-soft);
}

.timeline-item.team-tool .timeline-dot {
  border-color: var(--color-tool);
  box-shadow: 0 0 12px var(--color-tool-soft);
}

/* Hovering timeline card increases dot size slightly */
.timeline-item:hover .timeline-dot {
  transform: scale(1.2);
}

/* Card */
.timeline-card {
  grid-column: 3;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 
              0 8px 10px -6px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.3s ease, 
              box-shadow 0.3s ease;
}

.timeline-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 
              0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

.timeline-item.team-ai .timeline-card:hover {
  border-color: var(--color-ai);
  box-shadow: 0 10px 30px -10px var(--color-ai-soft);
}

.timeline-item.team-agent .timeline-card:hover {
  border-color: var(--color-agent);
  box-shadow: 0 10px 30px -10px var(--color-agent-soft);
}

.timeline-item.team-tool .timeline-card:hover {
  border-color: var(--color-tool);
  box-shadow: 0 10px 30px -10px var(--color-tool-soft);
}

/* Highlighted Item styles */
.timeline-card.highlighted {
  border-color: var(--color-star) !important;
  box-shadow: 0 10px 30px -5px var(--color-star-soft), 
              0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, #1e293b 100%) !important;
}

.timeline-item.highlighted .timeline-dot {
  border-color: var(--color-star) !important;
  box-shadow: 0 0 16px var(--color-star) !important;
  background-color: var(--color-star) !important;
}

/* Card Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-meta-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-star {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-star:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-star);
  transform: scale(1.1);
}

.btn-star.active {
  color: var(--color-star);
  filter: drop-shadow(0 0 4px var(--color-star));
}

.btn-star.active svg {
  fill: var(--color-star);
}


.card-date-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  letter-spacing: -0.01em;
}

.team-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-badge.team-ai {
  background-color: var(--color-ai-soft);
  color: var(--color-ai);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.team-badge.team-agent {
  background-color: var(--color-agent-soft);
  color: var(--color-agent);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.team-badge.team-tool {
  background-color: var(--color-tool-soft);
  color: var(--color-tool);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Card Body */
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: white;
  letter-spacing: -0.01em;
}

.card-content {
  color: var(--text-secondary);
  font-size: 0.95rem;
  white-space: pre-wrap; /* Preserves newlines and spaces */
  line-height: 1.6;
}

/* Card Actions */
.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon i {
  width: 15px;
  height: 15px;
}

/* Edit icon - Blue */
.btn-icon.btn-edit {
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

.btn-icon.btn-edit:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.45);
  color: #60a5fa;
  transform: translateY(-1px);
}

/* Delete icon - Red */
.btn-icon.btn-delete {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-icon.btn-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
  transform: translateY(-1px);
}

/* Loading & Empty States */
.loading-state, .empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--color-agent);
  border-radius: 50%;
  margin: 0 auto 1rem auto;
  animation: spin 0.8s linear infinite;
}

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

.empty-state i {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Dialog / Modal Styling (Glassmorphism Modal) */
.glass-dialog {
  margin: auto; /* Centers dialog in viewport */
  background: var(--bg-dialog);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 2rem;
  max-width: 650px;
  width: 90%;
  color: var(--text-primary);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(24px);
  outline: none;
}

.glass-dialog::backdrop {
  background: rgba(4, 7, 13, 0.8);
  backdrop-filter: blur(8px);
}

/* Dialog animation */
.glass-dialog[open] {
  animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dialog-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dialog-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  transition: all 0.2s ease;
}

.dialog-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.form-row {
  display: flex;
  gap: 1.25rem;
}

.flex-1 {
  flex: 1;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: white;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-agent);
  box-shadow: 0 0 0 2px var(--color-agent-soft);
}

.form-help {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Delete dialog custom items */
.delete-confirm-dialog {
  max-width: 420px;
}

.delete-item-preview {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 3px solid var(--color-danger);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Footer styling */
.app-footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-sub {
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

/* Month Divider Headers */
.timeline-month-header {
  display: block;
  margin-bottom: 2rem;
  margin-top: 2.5rem;
  position: relative;
  z-index: 3;
}

.timeline-month-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: white;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.5rem 1.5rem;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  text-align: center;
  width: 100%;
  backdrop-filter: blur(8px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-stats {
    width: 100%;
    justify-content: space-between;
  }
  
  .controls-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-tabs {
    flex-wrap: wrap;
  }
  
  .filter-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  
  .action-buttons {
    width: 100%;
  }
  
  .btn-primary {
    width: 100%;
  }
  
  .timeline-wrapper {
    padding-left: 2rem;
  }
  
  .timeline-item::after {
    left: -22px;
    top: 12px;
    bottom: -3.5rem;
    width: 4px;
  }
  
  .timeline-item {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    align-items: stretch;
    margin-bottom: 2.5rem;
  }

  .timeline-date-side {
    text-align: left;
    padding-right: 0;
    padding-top: 0;
    margin-bottom: 0.5rem;
  }

  .timeline-date-text {
    font-size: 0.95rem;
    padding: 0.15rem 0.5rem;
  }
  
  .timeline-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    margin: 0;
    width: 16px;
    height: 16px;
    border-width: 3px;
  }
  
  .card-actions {
    opacity: 1; /* Always visible on mobile */
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .timeline-month-header {
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
  }
  
  .timeline-month-title {
    font-size: 1.15rem;
    padding: 0.3rem 1rem;
  }
}

/* Language Switcher styling */
.lang-switcher {
  display: inline-flex;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-left: 1.5rem;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.lang-btn:hover {
  color: white;
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Read-Only Mode */
body.read-only-mode .action-buttons {
  display: none !important;
}

body.read-only-mode .card-actions {
  display: none !important;
}

.read-only-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
  cursor: default;
  pointer-events: none;
  width: 28px;
  height: 28px;
}

.read-only-star i {
  width: 16px;
  height: 16px;
  fill: #fbbf24;
}

