@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-main: #f8fafc;
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #f59e0b; /* Warm orange */
  --accent-hover: #d97706;
  --border: #e2e8f0;
  --danger: #ef4444;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary);
}

.brand i {
  font-size: 1.8rem;
  color: var(--accent);
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  padding: 0.8rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.nav-item:hover, .nav-item.active {
  background: #eff6ff;
  color: var(--primary);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem 3rem;
  min-height: 100vh;
}

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

.header-title h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.header-title p {
  color: var(--text-muted);
  font-size: 1rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-main);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  border: 1px solid var(--border);
  cursor: pointer;
}

.user-profile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg-main);
  border-color: var(--text-muted);
}

/* Views */
.view {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}
.view.active {
  display: block;
}

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

/* Dashboard Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.03);
  position: relative;
}

.project-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

.project-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.project-info {
  padding: 1.5rem;
}

.project-options-container {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
}

.project-options {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.project-options:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.05);
}

.project-menu {
  position: absolute;
  top: 40px;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  width: 160px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}

.project-menu.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-item {
  padding: 12px 15px;
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}

.menu-item:hover {
  background: var(--bg-main);
}

.menu-item-danger {
  color: #ef4444;
}

.project-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.project-members {
  display: flex;
  align-items: center;
}

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--bg-panel);
  margin-left: -10px;
  background: #e2e8f0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}
.member-avatar:first-child { margin-left: 0; }

/* Project Detail View */
.project-header {
  background: #ffffff;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.project-tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.tab {
  padding: 0.8rem 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--text-main);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-control, .form-select {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.datetime-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-panel);
  border-radius: 1rem;
  width: 95%;
  max-width: 600px;
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Panels & Cards */
.panel {
  background: var(--bg-panel);
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.panel-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

/* Flight Leg styling */
.flight-leg {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
}

.remove-leg-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.2rem;
}

.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  height: 100%;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}
.timeline-dot {
  position: absolute;
  left: -2.4rem;
  top: 0;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary);
  z-index: 2;
}
.timeline-content {
  background: var(--bg-panel);
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.info-alert {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-weight: 500;
}

/* Unified Timeline specific */
.unified-item {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.5rem;
}
.unified-item::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  height: 100%;
  width: 2px;
  background: var(--border);
  z-index: 0;
}
.unified-item:last-child::before {
  display: none;
}
.unified-icon {
  position: absolute;
  left: -0.3rem;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  font-size: 0.8rem;
  box-shadow: 0 0 0 4px var(--bg-panel);
}
.icon-flight { background: var(--primary); }
.icon-stop { background: var(--accent); }
.icon-activity { background: #10b981; }

.unified-content {
  background: var(--bg-main);
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  margin-top: 0.5rem;
}
.unified-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}
.unified-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}
.unified-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}
