/* Moderne UI-Komponenten für TrainingsTagebuch */

/* Alert-Komponenten */
.alert {
  padding: 0.75rem 1.25rem;
  margin: 0.75rem 0;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

.alert-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin: 0 0 0.125rem 0;
  font-size: 0.9rem;
}

.alert-message {
  margin: 0;
  line-height: 1.4;
}

.alert-success {
  background-color: rgba(47, 122, 95, 0.1);
  border-color: rgba(47, 122, 95, 0.2);
  color: var(--primary-strong);
}

.alert-info {
  background-color: rgba(51, 111, 168, 0.08);
  border-color: rgba(51, 111, 168, 0.18);
  color: #204a78;
}

.alert-warning {
  background-color: rgba(181, 110, 65, 0.1);
  border-color: rgba(181, 110, 65, 0.18);
  color: #7a4a2c;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.08);
  border-color: rgba(220, 53, 69, 0.25);
  color: #721c24;
}

/* Badge-Komponenten */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 9999px;
  border: 1px solid transparent;
  background-color: rgba(51, 51, 51, 0.08);
  color: var(--text-primary);
}

.badge-primary {
  background-color: var(--primary-soft);
  border-color: rgba(47, 122, 95, 0.14);
  color: var(--primary-strong);
}

.badge-secondary {
  background-color: var(--secondary-soft);
  border-color: rgba(181, 110, 65, 0.14);
  color: #7a4a2c;
}

.badge-success {
  background-color: rgba(47, 122, 95, 0.1);
  border-color: rgba(47, 122, 95, 0.16);
  color: var(--primary-strong);
}

.badge-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.18);
  color: #962d2d;
}

.badge-warning {
  background-color: rgba(181, 110, 65, 0.1);
  border-color: rgba(181, 110, 65, 0.18);
  color: #7a4a2c;
}

.badge-info {
  background-color: rgba(51, 111, 168, 0.1);
  border-color: rgba(51, 111, 168, 0.18);
  color: #204a78;
}

.badge-light {
  background-color: var(--surface-muted);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.badge-dark {
  background-color: rgba(24, 70, 54, 0.12);
  border-color: rgba(24, 70, 54, 0.2);
  color: var(--primary-strong);
}

/* Progress-Bar */
.progress {
  height: 0.625rem;
  background-color: rgba(24, 70, 54, 0.08);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin: 0.75rem 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-primary);
  font-size: 0.7rem;
  font-weight: 500;
}

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

.tooltip .tooltip-text {
  visibility: hidden;
  width: 180px;
  background-color: rgba(24, 70, 54, 0.96);
  color: var(--text-on-primary);
  text-align: center;
  border-radius: var(--border-radius);
  padding: 0.375rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -90px;
  opacity: 0;
  transition: opacity 0.25s;
  font-size: 0.8rem;
  line-height: 1.3;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border-width: 4px;
  border-style: solid;
  border-color: rgba(24, 70, 54, 0.96) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Modal-ähnliche Overlays */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(19, 33, 28, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

.overlay-content {
  background: var(--surface-color);
  border-radius: var(--border-radius-large);
  padding: 1.5rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 48px rgba(19, 33, 28, 0.2);
  transform: scale(0.9);
  transition: transform 0.25s ease;
}

.overlay.active .overlay-content {
  transform: scale(1);
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--border-radius);
}

.skeleton-text {
  height: 0.875rem;
  margin-bottom: 0.375rem;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

.skeleton-button {
  height: 2.25rem;
  width: 7rem;
}

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

/* Tabs */
.tabs {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.375rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-strong);
}

.filter-select,
.filter-input {
  background: var(--surface-color);
  border: 1px solid rgba(24, 70, 54, 0.12);
  border-radius: 10px;
  color: var(--text-primary);
  min-height: 2.35rem;
}

.filter-select:focus,
.filter-input:focus {
  border-color: rgba(47, 122, 95, 0.45);
  box-shadow: 0 0 0 3px rgba(47, 122, 95, 0.1);
}

.dialog-content {
  background: linear-gradient(180deg, var(--surface-color), var(--surface-muted));
}

.table-container,
.logs-table-container,
.participants-table-container {
  background: var(--surface-color);
  border: 1px solid rgba(24, 70, 54, 0.08);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(24, 70, 54, 0.05);
  overflow: hidden;
}

.tab-item {
  margin: 0;
}

.tab-button {
  background: none;
  border: none;
  padding: 0.625rem 1.25rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  font-weight: 500;
  min-height: auto;
  margin: 0;
  box-shadow: none;
}

.tab-button:hover {
  color: var(--primary-color);
  transform: none;
  box-shadow: none;
}

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

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

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

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

.accordion-header {
  background: none;
  border: none;
  width: 100%;
  padding: 0.875rem 1.25rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
  min-height: auto;
  margin: 0;
  box-shadow: none;
}

.accordion-header:hover {
  background-color: rgba(76, 175, 80, 0.04);
  transform: none;
  box-shadow: none;
}

.accordion-icon {
  transition: transform 0.25s ease;
  font-size: 1.125rem;
  color: var(--text-light);
}

.accordion-header.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.accordion-content.active {
  max-height: 400px;
}

.accordion-body {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0.75rem 0;
  font-size: 0.8rem;
  color: var(--text-light);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-separator {
  margin: 0 0.375rem;
  color: var(--text-light);
}

.breadcrumb-link {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  margin: 1.5rem 0;
}

.page-item {
  list-style: none;
  margin: 0;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-weight: 500;
}

.page-link:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}

.page-link.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.page-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Responsive Design für Komponenten */
@media (max-width: 768px) {
  .overlay-content {
    margin: 0.75rem;
    padding: 1.25rem;
  }
  
  .tab-list {
    flex-wrap: wrap;
  }
  
  .tab-button {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
  }
  
  .accordion-header {
    padding: 0.75rem 1rem;
  }
  
  .accordion-body {
    padding: 0 1rem 1rem;
  }
  
  .pagination {
    gap: 0.125rem;
  }
  
  .page-link {
    width: 2rem;
    height: 2rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .alert {
    padding: 0.625rem 0.875rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }
  
  .tooltip .tooltip-text {
    width: 140px;
    margin-left: -70px;
  }
  
  .overlay-content {
    margin: 0.375rem;
    padding: 0.875rem;
  }
}

/* Login und Registrierungslinks */
.login-link,
.register-link {
  margin-top: 1.5rem;
  text-align: center;
  padding: 1rem;
  background-color: var(--background-light);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.login-link p,
.register-link p {
  margin: 0;
  color: var(--text-muted);
}

.login-link a,
.register-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.login-link a:hover,
.register-link a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
