/* ── Variables ──────────────────────────────────────────────────────────────── */

:root {
  --accent: #ff7024;
  --today-color: #f85149;

  /* Sizing (set via JS) */
  --chart-w: 1680px;
  --month-w: 20px;
  --row-h: 54px;
  --bar-h: 32px;
  --hdr-h: 44px;
  --grp-h: 28px;
  --sidebar-w: 230px;
}

[data-theme='dark'] {
  --bg: #111214;
  --surface: #1d2125;
  --surface2: #22272b;
  --border: #282e33;
  --border2: #3b4148;
  --text: #b6c2cf;
  --text-strong: #c7d1db;
  --text-head: #dee4ea;
  --muted: #738496;
  --row-alt: #161a1d;
  --row-hover: #1d2125;
  --sidebar-bg: #1d2125;
  --hdr-bg: #1d2125;
  --today-color: #f85149;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme='light'] {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface2: #f8f9fa;
  --border: #dde0e5;
  --border2: #c4cdd6;
  --text: #44546f;
  --text-strong: #172b4d;
  --text-head: #172b4d;
  --muted: #8590a2;
  --row-alt: #f8f9fa;
  --row-hover: #edf2f7;
  --sidebar-bg: #ffffff;
  --hdr-bg: #f4f6f8;
  --today-color: #de350b;
  --shadow: 0 1px 2px rgba(9, 30, 66, 0.08), 0 4px 12px rgba(9, 30, 66, 0.06);
  --accent: #e56319;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  display: block !important;
  align-items: initial !important;
  justify-content: initial !important;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Page wrapper ───────────────────────────────────────────────────────────── */

.gantt-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.gt-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}

.gt-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  color: var(--muted);
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}

.gt-back:hover {
  background: var(--surface2);
  color: var(--accent);
}

.gt-header-id {
  flex: 1;
  min-width: 0;
}

.gt-header-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-head);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gt-header-role {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 1px;
}

.gt-header-links {
  display: flex;
  gap: 16px;
  font-size: 0.73rem;
  flex-shrink: 0;
}

.gt-header-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.gt-header-links a:hover {
  color: var(--accent);
}

.gt-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.gt-icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s;
}

.gt-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-sq-icon {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 2px;
  border: 1.5px solid currentColor;
  position: relative;
  overflow: hidden;
}

.theme-sq-icon::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  background: currentColor;
}

.gt-header-actions #theme-toggle {
  font-size: 0.82rem;
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  border-radius: 4px;
  padding: 0;
  line-height: 1;
}

.gt-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
}

.gt-btn-hire {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.gt-btn-hire:hover {
  filter: brightness(1.1);
}
.gt-btn-book {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}
.gt-btn-book:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Main Gantt layout ───────────────────────────────────────────────────────── */

.gt-main {
  display: flex;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.gt-main::-webkit-scrollbar {
  height: 8px;
}
.gt-main::-webkit-scrollbar-track {
  background: transparent;
}
.gt-main::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
}

/* ── Sidebar (sticky left) ───────────────────────────────────────────────────── */

.gt-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 10;
  background: var(--sidebar-bg);
  border-right: 2px solid var(--border2);
}

.gt-sidebar-header {
  display: flex;
  align-items: flex-end;
  padding: 0 16px 10px;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--hdr-bg);
  border-bottom: 2px solid var(--border2);
}

/* Group label */
.gt-group-label {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--hdr-bg);
  border-bottom: 1px solid var(--border);
}

/* Row label */
.gt-row-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}

.gt-row-label:hover {
  background: var(--row-hover);
}
.gt-row-label.is-active {
  background: var(--row-hover);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

.gt-row-draggable {
  cursor: grab;
}
.gt-row-draggable.gt-drag-active {
  opacity: 0.35;
  cursor: grabbing;
}
.gt-row-draggable.gt-drag-over {
  border-left: 3px solid var(--gantt-accent, #0c66e4);
  background: var(--row-hover);
}
.gt-row-track.gt-drag-over {
  outline: 2px solid var(--gantt-accent, #0c66e4);
  outline-offset: -2px;
}

.gt-job-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gt-job-company {
  font-size: 0.71rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.gt-job-period {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 2px;
  opacity: 0.75;
}

/* ── Tracks (scrollable right) ────────────────────────────────────────────────── */

.gt-tracks {
  position: relative;
  width: var(--chart-w);
  flex-shrink: 0;
}

/* Time axis header */
.gt-time-axis {
  background: var(--hdr-bg);
  border-bottom: 2px solid var(--border2);
  position: relative;
  user-select: none;
}

.gt-years,
.gt-quarters {
  display: flex;
  position: absolute;
  left: 0;
}

.gt-years {
  top: 0;
  height: 55%;
}
.gt-quarters {
  top: 55%;
  height: 45%;
  border-top: 1px solid var(--border);
}

.gt-year {
  flex-shrink: 0;
  border-right: 1px solid var(--border2);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-head);
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.gt-quarter {
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Group track */
.gt-group-track {
  background: var(--hdr-bg);
  border-bottom: 1px solid var(--border);
}

/* Row track */
.gt-row-track {
  position: relative;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}

.gt-row-track.gt-alt {
  background: var(--row-alt);
}
.gt-row-track:hover {
  background: var(--row-hover);
}
.gt-row-track.is-active {
  background: var(--row-hover);
}

/* Subtle quarterly grid lines */
.gt-row-track::before,
.gt-group-track::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent calc(var(--month-w) * 3 - 1px),
    var(--border) calc(var(--month-w) * 3 - 1px),
    var(--border) calc(var(--month-w) * 3)
  );
  opacity: 0.25;
  pointer-events: none;
}

/* ── Bar ────────────────────────────────────────────────────────────────────── */

.gt-bar {
  position: absolute;
  top: calc((var(--row-h) - var(--bar-h)) / 2);
  height: var(--bar-h);
  border-radius: 6px;
  display: flex;
  align-items: center;
  overflow: visible;
  transition:
    filter 0.15s,
    box-shadow 0.15s;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  min-width: 8px;
}

.gt-bar:hover {
  filter: brightness(1.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gt-bar-label {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  padding: 0 10px;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* "Live" pulse at the right end of the current bar */
.gt-bar.is-current::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
  animation: live-blink 1.8s ease-in-out infinite;
}

@keyframes live-blink {
  0%,
  100% {
    opacity: 0.3;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.15);
  }
}

/* ── Milestone markers ────────────────────────────────────────────────────────── */

.gt-ms {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  cursor: default;
}

.gt-ms-dot {
  display: block;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}

.gt-ms:hover .gt-ms-dot {
  transform: scale(1.5);
}

.gt-ms-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 0.69rem;
  color: var(--text-strong);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
  z-index: 20;
}

.gt-ms-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border2);
}

.gt-ms:hover .gt-ms-tip {
  display: block;
}

/* ── Today line ───────────────────────────────────────────────────────────────── */

.gt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--today-color);
  pointer-events: none;
  z-index: 4;
}

.gt-today-line::before {
  content: 'TODAY';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--today-color);
  letter-spacing: 0.08em;
  white-space: nowrap;
  background: var(--hdr-bg);
  padding: 0 4px;
  border-radius: 2px;
}

/* ── Detail panel ─────────────────────────────────────────────────────────────── */

.gt-detail {
  max-height: 0;
  overflow: hidden;
  background: var(--surface);
  border-top: 2px solid var(--accent);
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gt-detail.open {
  max-height: 520px;
  overflow-y: auto;
}

.gt-detail-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 28px;
}

.gt-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.gt-detail-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 4px;
  background: var(--surface2);
  flex-shrink: 0;
}

.gt-detail-meta {
  flex: 1;
}

.gt-detail-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.2;
}

.gt-detail-company {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.gt-detail-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gt-period-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
}

.gt-live-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  animation: live-blink 1.8s ease-in-out infinite;
}

.gt-close-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  align-self: flex-start;
}

.gt-close-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gt-detail-desc {
  font-size: 0.83rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 14px;
}

.gt-detail-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.gt-detail-bullets li {
  font-size: 0.81rem;
  line-height: 1.55;
  color: var(--text);
  padding: 3px 0 3px 16px;
  position: relative;
}

.gt-detail-bullets li::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.gt-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.gt-detail-refs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.gt-detail-refs a {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
}

.gt-detail-refs a:hover {
  text-decoration: underline;
}

/* ── Chips (skill tags) ───────────────────────────────────────────────────────── */

.gt-chip {
  font-size: 0.71rem;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}

.gt-chip-note {
  opacity: 0.65;
  font-style: italic;
  border-style: dashed;
}

/* ── Legend ───────────────────────────────────────────────────────────────────── */

.gt-legend {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.gt-legend-heading {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-right: 4px;
}

.gt-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text);
  white-space: nowrap;
}

.gt-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Skills section ───────────────────────────────────────────────────────────── */

.gt-skills-section {
  padding: 22px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.gt-section-title {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 14px;
}

.gt-skill-groups {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 960px) {
  .gt-skill-groups {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .gt-skill-groups {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gt-skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  cursor: grab;
  user-select: none;
  transition:
    opacity 0.15s,
    box-shadow 0.15s,
    border-color 0.15s;
}

.gt-skill-group.gt-drag-active {
  opacity: 0.4;
  cursor: grabbing;
}

.gt-skill-group.gt-drag-over {
  border-color: var(--gantt-accent, #0c66e4);
  box-shadow: 0 0 0 2px var(--gantt-accent, #0c66e4);
}

.gt-skill-group-name {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.gt-skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Footer ────────────────────────────────────────────────────────────────────── */

.gt-footer {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding: 22px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.gt-footer-col {
  flex: 1;
  min-width: 240px;
}

.gt-footer-title {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
}

.gt-footer-text {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}

.gt-edu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gt-edu-list li {
  font-size: 0.79rem;
  color: var(--text);
  padding: 3px 0 3px 14px;
  position: relative;
}

.gt-edu-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.gt-edu-list em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.73rem;
  margin-left: 6px;
}

/* ── Contacts popup (mobile) ─────────────────────────────────────────────────── */

.gt-contacts-wrap {
  position: relative;
  display: none;
}

.gt-contacts-popup {
  display: none;
  flex-direction: column;
  gap: 10px;
  position: absolute;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  z-index: 200;
  min-width: 220px;
}

.gt-contacts-popup.open {
  display: flex;
}

.gt-contacts-popup-heading {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 2px;
}

.gt-contacts-popup a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.84rem;
  transition: color 0.15s;
}

.gt-contacts-popup a:hover {
  color: var(--accent);
}

@media (max-width: 1200px) {
  .gt-header-links {
    display: none;
  }
  .gt-contacts-wrap {
    display: block;
  }
}

@media (max-width: 720px) {
  .gt-pm-view {
    display: none;
  }
}

@media (max-width: 600px) {
  .gt-btn-label {
    display: none;
  }
}

@media (max-width: 500px) {
  .gt-header-role {
    display: none;
  }
  .gt-header-name {
    white-space: normal;
  }
}

@media (max-width: 400px) {
  .gt-header-name {
    display: none;
  }
}

/* ── Override cv-index.css card/btn/body leftovers ──────────────────────────── */

.gantt-page .card {
  display: none;
}
.gantt-page .btn {
  display: none;
}
#index-booking-btn {
  display: none !important;
}
#hire-index-btn {
  display: none !important;
}

/* hide the floating toggle — opened from the Music header button */
#music-toggle {
  display: none !important;
}
