/* ── Component Styles ── */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  gap: var(--space-2);
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  box-shadow: 0 0 12px var(--accent-light);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-hover);
  border-color: var(--border-light);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
}

.btn-ghost {
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}
.btn-icon:hover:not(:disabled) {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Card */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Inputs, Textareas, Selects */
.input, .textarea, .select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.input::placeholder, .textarea::placeholder {
  color: var(--text-muted);
}

/* Input Group with Labels */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.input-group label {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Floating Label Inputs */
.floating-group {
  position: relative;
  margin-bottom: var(--space-4);
}

.floating-group input {
  width: 100%;
  padding: 1.25rem 0.875rem 0.5rem;
  font-size: var(--text-sm);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.floating-group label {
  position: absolute;
  left: 0.875rem;
  top: 0.875rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  pointer-events: none;
}

.floating-group input:focus ~ label,
.floating-group input:not(:placeholder-shown) ~ label {
  top: 0.25rem;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  color: var(--accent-primary);
}

.floating-group input:focus {
  border-color: var(--accent-primary);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-low { background-color: rgba(16, 185, 129, 0.15); color: var(--priority-low); }
.badge-medium { background-color: rgba(245, 158, 11, 0.15); color: var(--priority-medium); }
.badge-high { background-color: rgba(249, 115, 22, 0.15); color: var(--priority-high); }
.badge-urgent { background-color: rgba(239, 68, 68, 0.15); color: var(--priority-urgent); }

/* Avatar */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
  overflow: hidden;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar.sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar.md { width: 40px; height: 40px; font-size: var(--text-sm); }
.avatar.lg { width: 56px; height: 56px; font-size: var(--text-lg); }

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  min-width: 180px;
  z-index: var(--z-overlay);
  display: none;
  animation: scaleIn var(--transition-fast) forwards;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.5rem var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: var(--space-2) 0;
}

/* Custom Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  font-size: var(--text-sm);
  padding-left: 28px;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 20px;
  width: 20px;
  border-radius: 5px;
  border: 2px solid var(--text-muted);
  background-color: transparent;
  transition: all var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
  border-color: var(--accent-primary);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.checkmark::after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

/* Toggle Switch */
.toggle-container {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.toggle-input {
  display: none;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  position: relative;
  transition: background-color var(--transition-base);
}

.toggle-thumb {
  width: 18px;
  height: 18px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--transition-base), background-color var(--transition-base);
}

.toggle-input:checked + .toggle-track {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
  background-color: #ffffff;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) 0;
  max-width: 400px;
  margin: 0 auto;
}

.empty-state-icon {
  font-size: var(--text-5xl);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

/* Skeleton Loading */
.skeleton {
  background-color: var(--bg-tertiary);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0)
  );
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-title {
  height: 24px;
  margin-bottom: 12px;
  width: 60%;
}

/* Floating Action Button (FAB) */
.fab {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: var(--accent-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-header);
}

.fab:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px) scale(1.05);
}

/* Stat Card */
.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
}

/* Chips/Filter Pills */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.chip.active, .chip:hover {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Tabs */
.tabs-container {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-6);
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Tags Cloud Page */
.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  gap: var(--space-2);
  transition: all var(--transition-base);
}
.tag-badge:hover {
  border-color: var(--accent-primary);
  background: var(--accent-light);
}
.tag-badge .tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
