/* ============================================
   Malevelon Creek Status Widget
   Auto-collapsing bottom-left indicator
   ============================================ */

.creek-widget {
  position: fixed;
  bottom: 20px;
  left: 0;
  z-index: 9997;
  display: flex;
  align-items: stretch;
  transition: transform 0.4s ease;
}

/* Expanded: full panel visible */
.creek-widget.creek-expanded {
  transform: translateX(0);
}

/* Collapsed: panel hidden, only tab visible */
.creek-widget.creek-collapsed {
  transform: translateX(calc(-100% + 28px));
}

/* --- Arrow tab (always visible) --- */
.creek-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 40px;
  cursor: pointer;
  font-size: 14px;
  background: var(--bg-color, #0a0a0a);
  border: 2px solid var(--accent-color, #00ff41);
  border-left: none;
  border-radius: 0 4px 4px 0;
  order: 2;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
  flex-shrink: 0;
}

.creek-widget.creek-collapsed .creek-tab {
  opacity: 0.8;
}

.creek-widget.creek-collapsed .creek-tab:hover {
  opacity: 1;
}

/* Tab colors by state */
.creek-widget.creek-free .creek-tab {
  color: #00ff41;
  border-color: #00ff41;
}

.creek-widget.creek-lost .creek-tab {
  color: #ff3333;
  border-color: #ff3333;
}

.creek-widget.creek-event .creek-tab {
  color: #ffaa00;
  border-color: #ffaa00;
}

.creek-widget.creek-error .creek-tab {
  color: var(--text-muted, #666);
  border-color: var(--text-muted, #555);
}

/* --- Content panel --- */
.creek-panel {
  background: var(--bg-color, #0a0a0a);
  border: 2px solid var(--accent-color, #00ff41);
  border-right: none;
  border-radius: 0;
  padding: 8px 10px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  min-width: 160px;
  cursor: default;
}

.creek-panel,
.creek-panel * {
  font-family: 'Courier New', monospace !important;
}

.creek-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--text-muted, #888);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.creek-icon {
  font-size: 10px;
}

.creek-status {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
}

.creek-status a {
  color: inherit;
  text-decoration: none;
  display: inline;
}

.creek-status a:hover {
  text-decoration: underline;
}

.creek-loading {
  color: var(--text-muted, #888);
  animation: creekBlink 1s step-end infinite;
}

/* Creek is FREE - Humans own it */
.creek-widget.creek-free .creek-panel {
  border-color: #00ff41;
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.2);
}

.creek-widget.creek-free .creek-status {
  color: #00ff41;
}

/* Creek is LOST - enemy controls it */
.creek-widget.creek-lost .creek-panel {
  border-color: #ff3333;
  box-shadow: 0 0 12px rgba(255, 51, 51, 0.3);
}

.creek-widget.creek-lost .creek-status {
  color: #ff3333;
  animation: creekPulse 1.5s ease-in-out infinite;
}

.creek-widget.creek-lost .creek-icon {
  animation: creekAlarm 0.6s ease-in-out infinite;
}

/* Active event on the planet */
.creek-widget.creek-event .creek-panel {
  border-color: #ffaa00;
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.3);
}

.creek-widget.creek-event .creek-status {
  color: #ffaa00;
  animation: creekPulse 1s ease-in-out infinite;
}

.creek-players {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted, #888);
}

.creek-updated {
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-muted, #666);
}

/* Error state */
.creek-widget.creek-error .creek-panel {
  border-color: var(--text-muted, #555);
  opacity: 0.5;
}

.creek-widget.creek-error .creek-status {
  color: var(--text-muted, #666);
  font-size: 11px;
}

@keyframes creekBlink {
  50% { opacity: 0; }
}

@keyframes creekPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes creekAlarm {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

/* Mobile: smaller, tighter */
@media (max-width: 768px) {
  .creek-widget {
    bottom: 15px;
  }

  .creek-panel {
    padding: 8px 10px;
    min-width: 150px;
    font-size: 11px;
  }

  .creek-status {
    font-size: 14px;
  }

  .creek-tab {
    width: 24px;
    font-size: 12px;
  }
}
