/* components.css - Component-specific styles */

/* Button Variants */
.btn-success {
  background: linear-gradient(135deg, var(--earth), var(--quantum-green));
  color: var(--color-primary);
}

.btn-warning {
  background: linear-gradient(135deg, var(--fire), var(--gold-base));
  color: var(--color-primary);
}

.btn-danger {
  background: linear-gradient(135deg, var(--fire), #dc2626);
  color: white;
}

.btn-quantum {
  background: linear-gradient(135deg, var(--quantum-blue), var(--quantum-purple));
  color: white;
}

/* Card Variants */
.card-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-glow {
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.3);
  border: 1px solid rgba(0, 229, 255, 0.5);
}

.card-elevated {
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-elevated:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: rgba(212, 177, 146, 0.2);
  border: 1px solid var(--gold-base);
  color: var(--gold-base);
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid var(--earth);
  color: var(--earth);
}

.badge-warning {
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid var(--gold-base);
  color: var(--gold-base);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--fire);
  color: var(--fire);
}

.badge-quantum {
  background: rgba(0, 229, 255, 0.2);
  border: 1px solid var(--quantum-blue);
  color: var(--quantum-blue);
}

/* Tooltips */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: var(--color-primary);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: var(--z-modal);
}

.tooltip:hover::after {
  opacity: 1;
}

/* Progress Circles */
.progress-circle {
  position: relative;
  width: 80px;
  height: 80px;
}

.progress-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-circle-bg {
  fill: none;
  stroke: var(--ui-surface);
  stroke-width: 8;
}

.progress-circle-fill {
  fill: none;
  stroke: var(--gold-base);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset var(--transition-slow);
}

.progress-circle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--gold-base);
}

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

.tab {
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.tab.active {
  color: var(--gold-base);
  border-bottom-color: var(--gold-base);
}

/* Accordion */
.accordion {
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid var(--ui-border);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  padding: var(--space-4);
  background: var(--ui-surface);
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition-fast);
}

.accordion-header:hover {
  background: var(--ui-highlight);
}

.accordion-icon {
  transition: transform var(--transition-fast);
}

.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base), padding var(--transition-base);
}

.accordion-content.open {
  padding: var(--space-4);
  max-height: 1000px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  background: var(--ui-background);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  min-width: 300px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.3s ease-out;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.hiding {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-1);
  margin-left: auto;
  flex-shrink: 0;
}

.toast-success {
  border-color: var(--earth);
  background: rgba(34, 197, 94, 0.1);
}

.toast-warning {
  border-color: var(--gold-base);
  background: rgba(251, 191, 36, 0.1);
}

.toast-error {
  border-color: var(--fire);
  background: rgba(239, 68, 68, 0.1);
}

.toast-info {
  border-color: var(--quantum-blue);
  background: rgba(0, 229, 255, 0.1);
}

/* Loading Spinners */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--ui-surface);
  border-top-color: var(--gold-base);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.spinner-dot {
  width: 8px;
  height: 8px;
  background: var(--gold-base);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.spinner-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.spinner-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Range Slider Custom */
.custom-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--ui-surface);
  border-radius: var(--radius-full);
  outline: none;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--gold-base);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--color-primary);
  box-shadow: var(--shadow-md);
}

.custom-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--gold-base);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--color-primary);
  box-shadow: var(--shadow-md);
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 26px;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-full);
  transition: var(--transition-base);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: var(--transition-base);
}

.toggle-input:checked + .toggle-slider {
  background: var(--gold-base);
  border-color: var(--gold-base);
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(26px);
  background: var(--color-primary);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--gold-base);
  box-shadow: var(--shadow-glow);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d4b192' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.form-hint {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.form-error {
  color: var(--fire);
  font-size: var(--text-xs);
  margin-top: var(--space-2);
}

.form-input.error {
  border-color: var(--fire);
}

/* Color Picker */
.color-picker {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: var(--gold-base);
  box-shadow: var(--shadow-glow);
}

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--gold-base);
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: var(--text-sm);
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: var(--text-lg);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--ui-border);
  margin: var(--space-4) 0;
}

.divider-text {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--space-4) 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--ui-border);
}

.divider-text::before {
  margin-right: var(--space-3);
}

.divider-text::after {
  margin-left: var(--space-3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

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

.empty-state-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* Tags Input */
.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
  min-height: 44px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: rgba(212, 177, 146, 0.2);
  border: 1px solid var(--gold-base);
  border-radius: var(--radius-sm);
  color: var(--gold-base);
  font-size: var(--text-xs);
}

.tag-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.tags-input input {
  flex: 1;
  min-width: 100px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--space-1);
}

.tags-input input:focus {
  outline: none;
}

/* Code Block */
.code-block {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: monospace;
  font-size: var(--text-sm);
  overflow-x: auto;
  margin: var(--space-4) 0;
}

.code-block pre {
  margin: 0;
}

.code-block code {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Notification Bell */
.notification-bell {
  position: relative;
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--space-1);
  background: var(--fire);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}