/* ============================================================================
   Connection Banner — Phase 1: First Success Acceleration
   Shows EA connection status at top of dashboard.
   Colors align with dark dashboard theme.
   ============================================================================ */

#connection-banner-root {
  position: relative;
  width: 100%;
  z-index: 100;
}

.conn-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  border-bottom: 1px solid transparent;
  animation: connBannerSlideDown 0.35s ease-out;
}

@keyframes connBannerSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.conn-banner[data-status="never"] {
  background: linear-gradient(90deg, rgba(251,146,60,0.18) 0%, rgba(251,146,60,0.08) 100%);
  border-bottom-color: rgba(251,146,60,0.35);
  color: #fdba74;
}

.conn-banner[data-status="disconnected"] {
  background: linear-gradient(90deg, rgba(239,68,68,0.20) 0%, rgba(239,68,68,0.08) 100%);
  border-bottom-color: rgba(239,68,68,0.40);
  color: #fca5a5;
}

.conn-banner__icon {
  font-size: 18px;
  flex-shrink: 0;
  animation: connBannerPulse 2s ease-in-out infinite;
}

@keyframes connBannerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.92); }
}

.conn-banner__text {
  flex: 1;
  min-width: 0;
}

.conn-banner__title {
  font-weight: 600;
  margin-bottom: 2px;
}

.conn-banner__subtitle {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 400;
}

.conn-banner__cta {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.conn-banner__cta:hover {
  background: currentColor;
  color: #0f172a;
}

.conn-banner__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: currentColor;
  opacity: 0.6;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.conn-banner__close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.08);
}

/* Celebration Toast (first connection) */
.conn-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 9999;
  padding: 16px 24px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(16,185,129,0.45), 0 0 0 1px rgba(255,255,255,0.1);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90vw;
}

.conn-toast.visible {
  transform: translateX(-50%) translateY(0);
}

.conn-toast__icon {
  font-size: 24px;
  animation: connToastBounce 0.6s ease-out;
}

@keyframes connToastBounce {
  0%   { transform: scale(0.3) rotate(-20deg); }
  50%  { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Mobile */
@media (max-width: 640px) {
  .conn-banner { padding: 10px 14px; font-size: 13px; gap: 8px; }
  .conn-banner__subtitle { display: none; }
  .conn-banner__cta { padding: 5px 10px; font-size: 12px; }
  .conn-toast { top: 12px; padding: 12px 18px; font-size: 14px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .conn-banner, .conn-banner__icon, .conn-toast, .conn-toast__icon {
    animation: none !important;
    transition: opacity 0.15s !important;
  }
}

/* ============================================================================
   LIGHT MODE OVERRIDE (added 2026-05-14)
   Dark-themed colors (#fdba74, #fca5a5) are invisible on light backgrounds.
   ============================================================================ */
[data-theme="light"] .conn-banner[data-status="never"] {
  background: linear-gradient(90deg, rgba(251,146,60,0.20) 0%, rgba(251,146,60,0.10) 100%);
  border-bottom-color: rgba(194,65,12,0.50);
  color: #9a3412;
}
[data-theme="light"] .conn-banner[data-status="disconnected"] {
  background: linear-gradient(90deg, rgba(239,68,68,0.22) 0%, rgba(239,68,68,0.10) 100%);
  border-bottom-color: rgba(153,27,27,0.55);
  color: #991b1b;
}
[data-theme="light"] .conn-banner__subtitle {
  opacity: 0.85;
}
[data-theme="light"] .conn-banner__cta {
  border-color: currentColor;
  font-weight: 600;
}
[data-theme="light"] .conn-banner__cta:hover {
  background: rgba(0,0,0,0.05);
}
