/**
 * MeteoNav Info Panel Styles
 * Module: Info Panel CSS
 * Version: 1.0.0
 * Date: 2025-01-07
 * Author: Alex Moustris
 * Description: Styles for the map Info Panel including sun events display.
 *              Extracted from nautical-map.css for modularity.
 * Status: STABLE
 */

/* ===== Info Panel Base ===== */

.map-info-panel {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 260px;
  padding: 12px;
  padding-top: 24px;
  border-radius: 12px;
  background: rgba(19, 37, 76, 0.92);
  color: rgb(255, 255, 255);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1300;
  display: none;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.map-info-panel.visible {
  display: block;
}

/* ===== Panel Title ===== */

.info-panel-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(74, 144, 226, 0.5);
  cursor: move;
  cursor: -webkit-grab;
  cursor: grab;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: none;
}

.info-panel-title:active {
  cursor: -webkit-grabbing;
  cursor: grabbing;
}

/* Drag handle indicator */
.info-panel-drag-handle {
  width: 32px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin: 0 auto 8px;
}

/* ===== Close Button ===== */

.info-panel-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 150ms ease, background 150ms ease;
}

.info-panel-close:hover {
  color: rgb(255, 255, 255);
  background: rgba(255, 255, 255, 0.15);
}

/* ===== Info Lines ===== */

.info-line {
  margin: 6px 0;
  white-space: nowrap;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.info-line:first-of-type {
  margin-top: 0;
}

.info-label {
  margin-right: 6px;
  color: rgba(255, 255, 255, 0.7);
}

.info-scale-bar {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: rgb(19, 37, 76);
  font-weight: 500;
  min-width: 60px;
  text-align: center;
  font-size: 12px;
}

/* ===== Separator ===== */

.info-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 10px 0;
}

/* ===== Main Title for Sun Events ===== */

.info-sun-main-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== Sun Events Section ===== */

.info-sun-section {
  margin: 6px 0;
}

/* ===== Your Position Button ===== */

.info-position-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 150ms ease, color 150ms ease;
  width: 100%;
  text-align: left;
}

.info-position-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.info-position-button:active {
  background: rgba(255, 255, 255, 0.15);
}

/* Position available - Green */
.info-position-available {
  color: #4CAF50 !important;
}

.info-position-available i {
  color: #4CAF50;
}

/* Position not available - Red */
.info-position-unavailable {
  color: #f44336 !important;
}

.info-position-unavailable i {
  color: #f44336;
}

.info-sun-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-sun-title i {
  font-size: 10px;
  width: 12px;
  text-align: center;
}

.info-sun-events {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.info-sun-event {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.sun-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sunrise-icon {
  color: #FFD700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

.sunset-icon {
  color: #A0A0C0;
  text-shadow: 0 0 6px rgba(160, 160, 192, 0.4);
}

.sun-time {
  font-size: 13px;
  font-weight: 500;
  color: rgb(255, 255, 255);
  font-variant-numeric: tabular-nums;
}

/* ===== Mobile Responsive ===== */

@media (max-width: 768px) {
  .map-info-panel {
    width: 240px;
    bottom: calc(75px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    font-size: 13px;
    padding: 10px;
    padding-top: 22px;
  }

  .info-line {
    font-size: 12px;
    margin: 5px 0;
  }

  .info-sun-events {
    gap: 8px;
  }

  .info-sun-event {
    padding: 5px 6px;
  }

  .sun-icon {
    font-size: 14px;
    width: 16px;
  }

  .sun-time {
    font-size: 12px;
  }

  .info-sun-title {
    font-size: 10px;
  }
}

/* ===== Moon Info Section ===== */

.info-moon-main-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.info-moon-global {
  margin-bottom: 8px;
}

.info-moon-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  margin-bottom: 4px;
}

.info-moon-row:last-child {
  margin-bottom: 0;
}

.moon-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.moon-phase-name {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  flex: 1;
}

.moon-value {
  font-size: 12px;
  font-weight: 600;
  color: rgba(200, 210, 240, 1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.moon-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  flex: 1;
}

.moonrise-icon {
  color: #C0C8E0;
  text-shadow: 0 0 5px rgba(192, 200, 224, 0.4);
}

.moonset-icon {
  color: #7080A0;
  text-shadow: 0 0 4px rgba(112, 128, 160, 0.3);
}

.moon-time {
  font-size: 13px;
  font-weight: 500;
  color: rgb(255, 255, 255);
  font-variant-numeric: tabular-nums;
}

/* ===== Mobile Responsive — Moon ===== */

@media (max-width: 375px) {
  .map-info-panel {
    width: 220px;
  }

  .info-sun-events {
    flex-direction: column;
    gap: 4px;
  }

  .info-sun-event {
    justify-content: flex-start;
  }

  .info-moon-events {
    flex-direction: column;
    gap: 4px;
  }

  .info-moon-row {
    padding: 3px 6px;
  }

  .moon-icon {
    font-size: 14px;
    width: 16px;
  }

  .moon-phase-name,
  .moon-value,
  .moon-label {
    font-size: 10px;
  }

  .moon-time {
    font-size: 12px;
  }
}
