/* ==========================================================================
   Globe Dashboard — Styles
   ========================================================================== */

/* ---------- Layout ---------- */
.globe-page {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Navigation bar */
.globe-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--side-padding);
  position: relative;
  z-index: 20;
}

.globe-nav__back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  transition: all var(--transition-base);
}

.globe-nav__back:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.globe-nav__back-arrow {
  font-size: 1.1rem;
  transition: transform var(--transition-fast);
}

.globe-nav__back:hover .globe-nav__back-arrow {
  transform: translateX(-3px);
}

.globe-nav__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 600;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.globe-nav__live {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.globe-nav__live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vote-up);
  animation: pulse 2s ease-in-out infinite;
}

/* ---------- Main Dashboard Layout ---------- */
.globe-dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 0;
  padding: 0 24px 24px;
  min-height: 0;
  overflow: hidden;
}

/* Side panels */
.globe-side-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0 8px;
  max-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.globe-side-panel::-webkit-scrollbar {
  width: 4px;
}

.globe-side-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.globe-side-panel__header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 14px 12px;
  border-radius: 6px 6px 0 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.globe-side-panel__header--applications { background: #ece9df; }
.globe-side-panel__header--github       { background: #f2d8d7; }
.globe-side-panel__header--websites     { background: #d7e5ea; }
.globe-side-panel__header--blogs        { background: #9aa5eb; }
.globe-side-panel__header--creation     { background: #dff1e5; }
.globe-side-panel__header--productivity { background: #e8e3f7; }

/* Space between category groups (not between header and its cards) */
.globe-side-panel__header ~ .globe-side-panel__header {
  margin-top: 16px;
}

.globe-side-panel__title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.2vw, 2.05rem);
  font-weight: 700;
  line-height: 1;
  color: #111827;
  text-align: center;
}

/* Mini cards for side panels — Twitter-style clean layout */
.globe-mini-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0;
  transition: all var(--transition-base);
  cursor: pointer;
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInFromSide 0.5s ease forwards;
  overflow: hidden;
}

.globe-side-panel--right .globe-mini-card {
  transform: translateX(20px);
}

.globe-mini-card:nth-child(2) { animation-delay: 0.05s; }
.globe-mini-card:nth-child(3) { animation-delay: 0.1s; }
.globe-mini-card:nth-child(4) { animation-delay: 0.15s; }
.globe-mini-card:nth-child(5) { animation-delay: 0.2s; }
.globe-mini-card:nth-child(6) { animation-delay: 0.25s; }

.globe-mini-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px) !important;
}

.globe-mini-card.active {
  border-color: rgba(102, 126, 234, 0.5);
  background: rgba(102, 126, 234, 0.06);
}

/* Card body — main content area */
.globe-mini-card__body {
  padding: 12px 14px;
  display: flex;
  gap: 10px;
}

/* 50x50 logo */
.globe-mini-card__logo {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  user-select: none;
}

.globe-mini-card__logo--websites   { background: rgba(96, 165, 250, 0.2); color: var(--cat-websites); }
.globe-mini-card__logo--blogs      { background: rgba(244, 114, 182, 0.2); color: var(--cat-blogs); }
.globe-mini-card__logo--github     { background: rgba(52, 211, 153, 0.2); color: var(--cat-github); }
.globe-mini-card__logo--applications { background: rgba(251, 191, 36, 0.2); color: var(--cat-applications); }
.globe-mini-card__logo--creation   { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
.globe-mini-card__logo--productivity { background: rgba(167, 139, 250, 0.2); color: #a78bfa; }

/* Content column */
.globe-mini-card__content {
  flex: 1;
  min-width: 0;
}

.globe-mini-card__title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.globe-mini-card__desc {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.45;
  max-height: 1.45em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  transition: max-height 0.25s ease, color 0.2s ease;
}

.globe-mini-card.is-expanded .globe-mini-card__desc {
  color: var(--text-secondary);
  max-height: 6.5em;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Vote arrows — right side */
.globe-mini-card__arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding-left: 6px;
}

.globe-mini-card__arrow {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.2s, transform 0.15s;
}

.globe-mini-card__arrow:hover {
  transform: scale(1.3);
}

.globe-mini-card__arrow--up:hover { color: var(--vote-up); }
.globe-mini-card__arrow--down:hover { color: var(--vote-down); }

/* Footer — location + meta */
.globe-mini-card__footer {
  padding: 6px 14px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.globe-mini-card__location {
  font-size: 0.62rem;
  color: var(--text-tertiary);
}

.globe-mini-card__votes {
  font-size: 0.62rem;
  font-weight: 600;
}

.globe-mini-card__votes--positive { color: var(--vote-up); }
.globe-mini-card__votes--negative { color: var(--vote-down); }

/* Preview drawer (collapsed) */
.globe-mini-card__preview {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-10px);
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.35s ease;
}

/* Preview drawer (expanded) */
.globe-mini-card.is-expanded .globe-mini-card__preview {
  max-height: 520px;
  opacity: 1;
  transform: translateY(0);
}

.globe-mini-card__preview-gif {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* ---------- Globe Container ---------- */
.globe-container {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 0;
  height: 100%;
}

.globe-canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

/* ---------- Bottom bar (legend + stats) ---------- */
.globe-bottom {
  flex-shrink: 0;
  padding: 8px 24px 16px;
}

#globe-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Info panel below globe ---------- */
.globe-info {
  display: flex;
  gap: 32px;
  justify-content: center;
  padding: 6px 0 0;
  flex-wrap: wrap;
}

.globe-info__stat {
  text-align: center;
}

.globe-info__stat-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.globe-info__stat-label {
  font-size: 0.6rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

/* ---------- Tooltip (hover on pin) ---------- */
.globe-tooltip {
  position: fixed;
  z-index: 100;
  background: rgba(10, 10, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 14px 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 260px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.globe-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.globe-tooltip__title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.globe-tooltip__meta {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.globe-tooltip__desc {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ---------- Animations ---------- */
@keyframes slideInFromSide {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---------- Responsive ---------- */

/* ---------- Legend ---------- */
.globe-legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}

.globe-legend__item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.globe-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.globe-legend__block {
  border-radius: 2px;
  background: var(--accent-1);
  flex-shrink: 0;
}

.globe-legend__block--sm {
  width: 6px;
  height: 6px;
}

.globe-legend__block--lg {
  width: 12px;
  height: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .globe-dashboard {
    grid-template-columns: 280px minmax(0, 1fr) 280px;
  }
}

@media (max-width: 1023px) {
  .globe-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 0 16px 24px;
    overflow: visible;
  }

  .globe-side-panel {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    padding: 0;
    gap: 10px;
  }

  .globe-mini-card {
    min-width: 220px;
    flex-shrink: 0;
  }

  .globe-canvas-wrap {
    height: min(54vh, 560px);
    min-height: 320px;
  }

  .globe-side-panel__header {
    position: static;
    min-width: 100px;
    flex-shrink: 0;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    padding: 0 4px;
  }
}

@media (max-width: 767px) {
  .globe-nav {
    padding: 16px;
  }

  .globe-nav__title {
    display: none;
  }

  .globe-dashboard {
    padding: 0 8px 16px;
  }

  .globe-mini-card {
    min-width: 180px;
    padding: 10px;
  }

  .globe-info {
    gap: 20px;
    padding-top: 10px;
  }

  .globe-canvas-wrap {
    height: min(42vh, 420px);
    min-height: 260px;
  }
}

/* ---------- Globe Nav Actions ---------- */

.globe-nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.globe-nav__billboard {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--text-secondary);
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.2);
  transition: all var(--transition-base);
  text-decoration: none;
  flex-shrink: 0;
}

.globe-nav__billboard:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.5);
  color: var(--text-primary);
  box-shadow: 0 0 24px rgba(102, 126, 234, 0.25);
  transform: scale(1.08);
}

/* ---------- Globe Light Mode Overrides ---------- */

html.light-mode .globe-nav__back {
  border-color: rgba(0, 0, 0, 0.1);
}

html.light-mode .globe-nav__back:hover {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

html.light-mode .globe-mini-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.1);
}

html.light-mode .globe-mini-card:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.18);
}

html.light-mode .globe-mini-card.active {
  border-color: rgba(102, 126, 234, 0.4);
  background: rgba(102, 126, 234, 0.06);
}

html.light-mode .globe-mini-card__title {
  color: var(--text-primary);
}

html.light-mode .globe-mini-card__footer {
  border-top-color: rgba(0, 0, 0, 0.06);
}

html.light-mode .globe-mini-card__arrow {
  color: rgba(15, 15, 30, 0.3);
}

html.light-mode .globe-tooltip {
  background: rgba(245, 245, 252, 0.97);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

html.light-mode .globe-tooltip__meta {
  color: var(--text-secondary);
}

html.light-mode .globe-tooltip__desc {
  color: var(--text-tertiary);
}
