/* Component styles - cards, buttons, forms, etc. */

/* Cards */
.card {
  background: var(--surface-1);
  border-radius: var(--card-border-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-normal);
}

.card--elevated {
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card--compact {
  padding: var(--space-3);
}

.card--interactive {
  cursor: pointer;
  transition: all var(--transition-normal);
}

.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

/* Stat cards */
.stat-card {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-normal);
}

.stat-card:hover {
  background: var(--surface-3);
  transform: translateY(-1px);
}

.stat-card__label {
  font-size: var(--font-size-sm);
  color: var(--app-hint);
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card__value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--accent);
  line-height: var(--line-height-tight);
}

.stat-card__meta {
  font-size: var(--font-size-xs);
  color: var(--app-hint);
  margin-top: var(--space-1);
}

/* Action cards */
.action-card {
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.action-card:active {
  transform: translateY(0);
}

.action-card--ready {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--surface-1) 0%, var(--success-bg) 100%);
}

.action-card--active {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface-1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

.action-card--locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.action-card--locked:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: rgba(255, 255, 255, 0.1);
}

.action-card__icon {
  font-size: 32px;
  margin-bottom: var(--space-3);
  display: block;
}

.action-card__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--app-text);
  margin-bottom: var(--space-1);
}

.action-card__description {
  font-size: var(--font-size-sm);
  color: var(--app-hint);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-3);
}

.action-card__status {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  display: inline-block;
}

.action-card__status--ready {
  background: var(--success-bg);
  color: var(--success-text);
}

.action-card__status--active {
  background: var(--info-bg);
  color: var(--info-text);
}

.action-card__status--locked {
  background: var(--surface-3);
  color: var(--app-hint);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--button-padding-y) var(--button-padding-x);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  height: var(--button-height);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn--secondary {
  background: var(--surface-2);
  color: var(--app-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--surface-3);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--app-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn--danger {
  background: var(--danger);
  color: white;
}

.btn--danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn--sm {
  height: var(--button-height-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
}

.btn--lg {
  height: var(--button-height-lg);
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-lg);
}

.btn--block {
  width: 100%;
  display: flex;
}

.btn--icon {
  padding: var(--space-3);
  width: var(--button-height);
  height: var(--button-height);
}

.btn--icon.btn--sm {
  width: var(--button-height-sm);
  height: var(--button-height-sm);
  padding: var(--space-2);
}

.btn--icon.btn--lg {
  width: var(--button-height-lg);
  height: var(--button-height-lg);
  padding: var(--space-4);
}

/* Badges */
.badge {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.badge--success {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge--warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge--danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge--info {
  background: var(--info-bg);
  color: var(--info-text);
}

.badge--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.badge--outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* Progress bars */
.progress {
  width: 100%;
  background: var(--surface-3);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.progress__bar {
  height: 8px;
  background: var(--accent);
  border-radius: var(--radius-md);
  transition: width var(--transition-normal);
  position: relative;
}

.progress__bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress__bar--success {
  background: var(--success);
}

.progress__bar--warning {
  background: var(--warning);
}

.progress__bar--danger {
  background: var(--danger);
}

.progress--lg .progress__bar {
  height: 12px;
}

.progress--sm .progress__bar {
  height: 4px;
}

.progress__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}

.progress__label-text {
  color: var(--app-text);
  font-weight: var(--font-weight-medium);
}

.progress__label-value {
  color: var(--app-hint);
  font-weight: var(--font-weight-normal);
}

/* Banners */
.banner {
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
  transition: var(--transition-normal);
}

.banner--info {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: var(--info-border);
}

.banner--success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-border);
}

.banner--warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.banner--danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

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

.empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--app-text);
  margin-bottom: var(--space-2);
}

.empty-state__description {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-4);
}

.empty-state__action {
  margin-top: var(--space-4);
}

/* Loading states */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  color: var(--app-hint);
}

.loading__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--surface-3);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: var(--space-3);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton--text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton--title {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton--card {
  height: 80px;
  margin-bottom: var(--space-3);
}

.skeleton--button {
  height: var(--button-height);
  width: 120px;
  border-radius: var(--radius-md);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--surface-3);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabs__item {
  flex-shrink: 0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--app-hint);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.tabs__item:hover {
  color: var(--app-text);
}

.tabs__item--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Modals and overlays */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--app-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
}

.modal__content {
  background: var(--surface-1);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
}

.modal__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--app-text);
  margin-bottom: var(--space-3);
}

.modal__description {
  font-size: var(--font-size-sm);
  color: var(--app-hint);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-4);
}

.modal__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* Form elements */
.input {
  width: 100%;
  height: var(--input-height);
  padding: 0 var(--input-padding-x);
  border: 1px solid var(--surface-3);
  border-radius: var(--input-border-radius);
  background: var(--surface-1);
  color: var(--app-text);
  font-size: var(--font-size-base);
  transition: all var(--transition-normal);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input::placeholder {
  color: var(--app-hint);
}

/* Tooltips */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip__content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-3);
  color: var(--app-text);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  z-index: var(--z-tooltip);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-1);
}

.tooltip:hover .tooltip__content {
  opacity: 1;
  visibility: visible;
}

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

.divider--vertical {
  width: 1px;
  height: 100%;
  background: var(--surface-3);
  margin: 0 var(--space-4);
}

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--app-text);
  font-weight: var(--font-weight-medium);
  overflow: hidden;
}

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

.avatar--md {
  width: 40px;
  height: 40px;
  font-size: var(--font-size-base);
}

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

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .btn--lg {
    height: var(--button-height);
    padding: var(--button-padding-y) var(--button-padding-x);
    font-size: var(--font-size-base);
  }
  
  .card {
    padding: var(--space-3);
  }
  
  .modal__content {
    padding: var(--space-4);
    margin: var(--space-2);
  }
}
