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

body {
  overflow: hidden;
  background: #060612;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #e0e4f0;
  -webkit-user-select: none;
  user-select: none;
}

#scene-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Globe Mode Toggle */
#globe-mode-toggle {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  gap: 2px;
  background: rgba(10, 12, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 180, 255, 0.12);
  border-radius: 28px;
  padding: 3px;
}

.mode-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 24px;
  background: transparent;
  color: rgba(200, 210, 230, 0.55);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.mode-btn:hover {
  color: #e0e4f0;
  background: rgba(0, 180, 255, 0.08);
}

.mode-btn.active {
  background: rgba(0, 180, 255, 0.2);
  color: #00b4ff;
  box-shadow: 0 0 12px rgba(0, 180, 255, 0.15);
}

/* Country Tooltip */
#country-tooltip {
  position: fixed;
  z-index: 200;
  background: rgba(10, 12, 30, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 180, 255, 0.25);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #e0e4f0;
  pointer-events: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}

#country-tooltip.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Country 3D View Overlay */
#country-3d-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #060612;
  transition: opacity 0.5s, transform 0.5s;
}

#country-3d-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

#country-3d-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 510;
  padding: 20px 28px;
  background: linear-gradient(to bottom, rgba(6, 6, 18, 0.95), transparent);
  display: flex;
  align-items: center;
  gap: 20px;
}

#country-3d-back {
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(0, 180, 255, 0.15);
  border: 1px solid rgba(0, 180, 255, 0.3);
  color: #00b4ff;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

#country-3d-back:hover {
  background: rgba(0, 180, 255, 0.25);
}

#country-3d-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

#country-3d-info {
  font-size: 13px;
  color: rgba(200, 210, 230, 0.5);
  font-family: 'IBM Plex Mono', monospace;
}

#country-3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 3D View Button in Info Panel */
#info-3d-view {
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(0, 180, 255, 0.3);
  border-radius: 12px;
  background: rgba(0, 180, 255, 0.1);
  color: #00b4ff;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#info-3d-view:hover {
  background: rgba(0, 180, 255, 0.2);
  box-shadow: 0 0 20px rgba(0, 180, 255, 0.15);
}

#info-3d-view.hidden {
  display: none;
}

/* Glassmorphism base */
.glass {
  background: rgba(10, 12, 30, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 180, 255, 0.12);
  border-radius: 16px;
}

/* Search */
#search-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 90%;
  max-width: 520px;
}

#search-bar {
  display: flex;
  align-items: center;
  background: rgba(10, 12, 30, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 180, 255, 0.15);
  border-radius: 40px;
  padding: 0 20px;
  height: 52px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#search-bar:focus-within {
  border-color: rgba(0, 180, 255, 0.5);
  box-shadow: 0 0 30px rgba(0, 180, 255, 0.12);
}

.search-icon {
  font-size: 18px;
  margin-right: 12px;
  opacity: 0.6;
}

#search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e0e4f0;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

#search-input::placeholder {
  color: rgba(200, 210, 230, 0.35);
}

#search-clear {
  background: none;
  border: none;
  color: rgba(200, 210, 230, 0.5);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
}

#search-clear:hover { color: #00b4ff; }

#autocomplete-dropdown {
  margin-top: 8px;
  background: rgba(10, 12, 30, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 180, 255, 0.12);
  border-radius: 16px;
  max-height: 280px;
  overflow-y: auto;
  transition: opacity 0.2s, transform 0.2s;
}

#autocomplete-dropdown.hidden {
  display: none;
}

.ac-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ac-item:last-child { border-bottom: none; }

.ac-item:hover {
  background: rgba(0, 180, 255, 0.1);
}

.ac-item .ac-main {
  font-weight: 600;
  color: #e0e4f0;
}

.ac-item .ac-sub {
  font-size: 12px;
  color: rgba(200, 210, 230, 0.45);
  margin-top: 2px;
}

/* Recent Chips */
#recent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding: 0 4px;
}

.chip {
  background: rgba(0, 180, 255, 0.1);
  border: 1px solid rgba(0, 180, 255, 0.2);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'IBM Plex Sans', sans-serif;
  color: rgba(200, 210, 230, 0.7);
}

.chip:hover {
  background: rgba(0, 180, 255, 0.2);
  color: #e0e4f0;
}

/* Info Panel */
#info-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 320px;
  background: rgba(10, 12, 30, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 180, 255, 0.12);
  border-radius: 20px;
  padding: 28px 24px;
  z-index: 90;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
  transform: translateX(0);
  opacity: 1;
}

#info-panel.hidden {
  transform: translateX(380px);
  opacity: 0;
  pointer-events: none;
}

#info-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(200, 210, 230, 0.5);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#info-close:hover { color: #00b4ff; }

#info-name {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
  padding-right: 30px;
}

.info-sub {
  font-size: 13px;
  color: rgba(200, 210, 230, 0.45);
  margin-bottom: 2px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
}

.info-divider {
  height: 1px;
  background: rgba(0, 180, 255, 0.12);
  margin: 18px 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.info-label {
  font-size: 14px;
  color: rgba(200, 210, 230, 0.55);
}

.info-value {
  font-size: 15px;
  font-weight: 600;
  color: #e0e4f0;
  font-family: 'IBM Plex Mono', monospace;
  text-align: right;
}

/* Controls Panel */
#controls-panel {
  position: fixed;
  bottom: 80px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
}

.ctrl-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(10, 12, 30, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 180, 255, 0.1);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e0e4f0;
}

.ctrl-btn:hover {
  background: rgba(0, 180, 255, 0.15);
  border-color: rgba(0, 180, 255, 0.3);
}

.ctrl-btn.active {
  border-color: rgba(0, 180, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 180, 255, 0.15);
}

/* Clock Strip */
#clock-strip {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(10, 12, 30, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 180, 255, 0.1);
  border-radius: 14px;
  padding: 10px 16px;
  z-index: 80;
}

.clock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.clock-row + .clock-row { margin-top: 4px; }

.clock-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: rgba(0, 180, 255, 0.6);
}

.clock-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #e0e4f0;
}

/* Zoom Controls */
#zoom-controls {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 80;
}

.zoom-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(10, 12, 30, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 180, 255, 0.1);
  font-size: 22px;
  font-weight: 200;
  color: #e0e4f0;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Sans', sans-serif;
}

.zoom-btn:hover {
  background: rgba(0, 180, 255, 0.15);
  border-color: rgba(0, 180, 255, 0.3);
}

/* Footer */
#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 10px;
  font-size: 11px;
  color: rgba(200, 210, 230, 0.3);
  z-index: 80;
  background: linear-gradient(transparent, rgba(6, 6, 18, 0.6));
}

#footer a {
  color: rgba(0, 180, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}

#footer a:hover { color: #00b4ff; }

/* Loading Screen */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #060612;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
}

.loading-globe {
  font-size: 60px;
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-content p {
  margin-top: 16px;
  font-size: 14px;
  color: rgba(200, 210, 230, 0.5);
  letter-spacing: 1px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}

.hidden { }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 180, 255, 0.2); border-radius: 4px; }

/* HD Mode cursor */
body.hd-mode #scene-container canvas {
  cursor: pointer;
}

/* Mobile */
@media (max-width: 768px) {
  #info-panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 50vh;
    overflow-y: auto;
  }

  #info-panel.hidden {
    transform: translateY(110%);
  }

  #clock-strip {
    top: auto;
    bottom: 56px;
    right: 12px;
    padding: 6px 12px;
  }

  .clock-label { font-size: 9px; }
  .clock-val { font-size: 11px; }

  #zoom-controls {
    right: 12px;
    top: auto;
    bottom: 120px;
    transform: none;
  }

  #controls-panel {
    bottom: 56px;
    left: 12px;
  }

  .ctrl-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  #search-container {
    top: 12px;
    width: 94%;
  }

  #search-bar {
    height: 46px;
    padding: 0 16px;
  }

  #globe-mode-toggle {
    top: 68px;
  }

  .mode-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  #country-3d-header {
    flex-wrap: wrap;
    padding: 14px 16px;
    gap: 10px;
  }

  #country-3d-title {
    font-size: 18px;
  }
}