/* ============================================
   PSYCHE AI Tracker — Components V2
   Reusable, premium UI components
   ============================================ */

/* === Input Components === */
.input-group {
  position: relative;
  margin-bottom: var(--space-5);
}

.input-field {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: all var(--transition-base);
  outline: none;
  backdrop-filter: blur(10px);
}

.input-field:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.input-field::placeholder {
  color: var(--text-tertiary);
}

.input-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* === Card Components === */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-xl);
}

.card-gradient {
  position: relative;
}

.card-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.card-gradient:hover::before {
  opacity: 1;
}

/* === Tooltip === */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  backdrop-filter: blur(20px);
  z-index: var(--z-tooltip);
}

.tooltip:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Tag / Chip === */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan-400);
  border: 1px solid rgba(6, 182, 212, 0.15);
}

.tag-purple {
  background: rgba(168, 85, 247, 0.1);
  color: var(--purple-400);
  border-color: rgba(168, 85, 247, 0.15);
}

.tag-green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald-400);
  border-color: rgba(16, 185, 129, 0.15);
}

/* === Alert / Banner === */
.alert {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  border: 1px solid;
}

.alert-info {
  background: rgba(6, 182, 212, 0.05);
  border-color: rgba(6, 182, 212, 0.15);
  color: var(--cyan-400);
}

.alert-success {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
}

/* === Divider === */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-6) 0;
}

.divider-gradient {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* === Avatar === */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group .avatar {
  margin-left: -10px;
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

/* === Toggle Switch === */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 12px;
  transition: var(--transition-base);
}

.toggle-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition-base);
}

.toggle input:checked + .toggle-track {
  background: var(--gradient-primary);
}

.toggle input:checked + .toggle-track::before {
  transform: translateX(20px);
}

/* === Progress Bar === */
.progress {
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === Pulse Dot === */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-400);
  position: relative;
}

.pulse-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--emerald-400);
  animation: pulseDot 2s ease-out infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* === Keyboard Shortcut Badge === */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

/* === Responsive Utilities === */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}
