/**
 * DB-Startpage - Reusable Components
 * Consolidated, DRY component definitions
 * Extends base.css with specific component variants
 */

/* ===== Buttons ===== */

/* Primary Button */
.btn-primary {
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Icon Button (wiederverwendbar für alle Icon-Buttons) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--border-radius);
  color: var(--text-dark-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--text-dark);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.theme-day .icon-btn:hover {
  background: rgba(0, 0, 0, .05);
  color: var(--text-light);
}

/* Action Button (für Edit/Delete Actions) */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: rgba(255, 255, 255, .08);
  border: none;
  border-radius: 4px;
  color: var(--text-dark-muted);
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: rgba(255, 255, 255, .15);
  color: var(--text-dark);
}

/* Show on parent hover */
*:hover > .action-btn,
*:hover .action-btn {
  opacity: 1;
}

.action-btn--delete:hover {
  background: #ff6b6b;
  color: white;
}

.theme-day .action-btn {
  background: rgba(0, 0, 0, .05);
}

.theme-day .action-btn:hover {
  background: rgba(0, 0, 0, .1);
}

/* Small Button Variant */
.btn-sm {
  padding: 4px 12px;
  font-size: 13px;
}

/* ===== Inputs & Forms ===== */

.input-field {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius);
  color: var(--text-dark);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, .08);
}

.input-field::placeholder {
  color: var(--text-dark-muted);
}

.theme-day .input-field {
  background: rgba(0, 0, 0, .03);
  border-color: var(--border-light);
  color: var(--text-light);
}

.theme-day .input-field::placeholder {
  color: var(--text-light-muted);
}

/* Select Field */
.select-field {
  padding: 8px 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius);
  color: var(--text-dark);
  font-size: 14px;
  cursor: pointer;
}

.theme-day .select-field {
  background: rgba(0, 0, 0, .03);
  border-color: var(--border-light);
  color: var(--text-light);
}

/* ===== Cards ===== */

.card {
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
}

.card__body {
  color: var(--text-dark-muted);
}

.card__footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-dark);
}

.theme-day .card {
  background: var(--bg-card-light);
  border-color: var(--border-light);
}

.theme-day .card__title {
  color: var(--text-light);
}

.theme-day .card__footer {
  border-top-color: var(--border-light);
}

/* ===== Tabs (Unified Tab Component) ===== */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-dark);
}

.tab {
  padding: 7px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dark-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--text-dark);
  background: rgba(255, 255, 255, .03);
}

.tab.active {
  color: var(--text-dark);
  border-bottom-color: var(--accent);
}

.theme-day .tabs {
  border-bottom-color: var(--border-light);
}

.theme-day .tab {
  color: var(--text-light-muted);
}

.theme-day .tab:hover {
  color: var(--text-light);
  background: rgba(0, 0, 0, .02);
}

.theme-day .tab.active {
  color: var(--text-light);
}

/* ===== Badges ===== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

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

.badge--success {
  background: #43d9ad;
  color: white;
}

.badge--warning {
  background: #f7c948;
  color: #0a1019;
}

.badge--danger {
  background: #ff6b6b;
  color: white;
}

.badge--secondary {
  background: rgba(255, 255, 255, .1);
  color: var(--text-dark);
}

.theme-day .badge--secondary {
  background: rgba(0, 0, 0, .08);
  color: var(--text-light);
}

/* ===== List Groups ===== */

.list-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.list-group-item {
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  padding: 12px 16px;
  transition: background var(--transition-fast);
}

.list-group-item:first-child {
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
}

.list-group-item:last-child {
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
}

.list-group-item:hover {
  background: var(--bg-card-dark-hover);
}

.theme-day .list-group-item {
  background: var(--bg-card-light);
  border-color: var(--border-light);
}

.theme-day .list-group-item:hover {
  background: var(--bg-card-light-hover);
}

/* ===== Tables ===== */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead th {
  font-weight: 600;
  text-align: left;
  padding: 12px;
  border-bottom: 2px solid var(--border-dark);
  color: var(--text-dark);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.table tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  color: var(--text-dark-muted);
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, .02);
}

.theme-day .table thead th {
  border-bottom-color: var(--border-light);
  color: var(--text-light);
}

.theme-day .table tbody td {
  border-bottom-color: rgba(0, 0, 0, .04);
  color: var(--text-light-muted);
}

.theme-day .table tbody tr:hover {
  background: rgba(0, 0, 0, .01);
}

/* ===== Status Indicators ===== */

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot--success {
  background: #43d9ad;
}

.status-dot--warning {
  background: #f7c948;
}

.status-dot--danger {
  background: #ff6b6b;
}

.status-dot--info {
  background: var(--accent);
}

/* ===== Loading States ===== */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-dark);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, .04) 0%,
    rgba(255, 255, 255, .08) 50%,
    rgba(255, 255, 255, .04) 100%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--border-radius);
}

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

.theme-day .loading-skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, .04) 0%,
    rgba(0, 0, 0, .08) 50%,
    rgba(0, 0, 0, .04) 100%
  );
}
