/* Import der Komponenten */
@use './components.scss' as *;

/* Modernes, frisches Design für TrainingsTagebuch */
:root {
  /* Zentrale Farbpalette */
  --primary-color: #2f7a5f;
  --primary-hover: #245f49;
  --primary-soft: #e8f2ed;
  --primary-strong: #184636;
  --secondary-color: #b56e41;
  --secondary-hover: #915734;
  --secondary-soft: #f6ebe2;
  --danger-color: #dc3545;
  --danger-hover: #c82333;
  --nav-bg: #edf4f0;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --text-muted: #888;
  --text-on-primary: #ffffff;
  --text-on-secondary: #ffffff;
  --bg-light: #f8f9fa;
  --bg-canvas: #f4f6f3;
  --surface-color: #ffffff;
  --surface-muted: #f7faf8;
  --border-color: #e9ecef;
  --primary-light: #e8f2ed;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-heavy: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-small: var(--shadow-light);
  --border-radius: 6px;
  --border-radius-small: 6px;
  --border-radius-large: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.18s ease;
}

html, body {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
}

h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 0.375rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 1px;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.25rem 0 0.5rem 0;
}

#app {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Kompaktere Button-Styles */
button {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: var(--text-on-primary);
  border: none;
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  margin: 0.125rem;
  position: relative;
  overflow: hidden;
  min-height: 2.25rem;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.4s;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-light);
}

button.cancel-action {
  background: white;
  color: var(--primary-color);
  border: 1.5px solid var(--primary-color);
  box-shadow: var(--shadow-light);
}

button.cancel-action:hover {
  background: var(--primary-color);
  color: var(--text-on-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

/* Mülleimer-Buttons (Delete-Buttons) */
button.delete-btn, 
button[onclick*="delete"],
button[onclick*="remove"] {
  background: white;
  color: var(--danger-color);
  border: 1.5px solid var(--danger-color);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
}

button.delete-btn:hover,
button[onclick*="delete"]:hover,
button[onclick*="remove"]:hover {
  background: var(--danger-color);
  color: var(--text-on-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

/* Spezielle Styles für Mülleimer-Symbol */
button.trash-btn {
  background: white !important;
  color: var(--danger-color) !important;
  border: 1.5px solid var(--danger-color) !important;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  min-width: 2rem;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

button.trash-btn:hover {
  background: var(--danger-color) !important;
  color: var(--text-on-primary) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

/* Sekundäre Buttons */
button.secondary {
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
  color: var(--text-on-secondary);
}

button.secondary:hover {
  box-shadow: var(--shadow-medium);
}

/* Kleine Buttons */
button.small {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  min-height: 1.875rem;
}

/* Große Buttons */
button.large {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  min-height: 2.75rem;
}

/* Icon-Buttons */
button.icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Kompaktere Form-Elemente */
input, select, textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  transition: var(--transition);
  background: white;
  color: var(--text-primary);
  box-sizing: border-box;
}

/* Spezielle Styles für Checkboxen */
input[type="checkbox"] {
  width: auto;
  min-width: 1rem;
  height: 1rem;
  margin: 0 0.5rem 0 0;
  padding: 0;
  border: 1.5px solid var(--border-color);
  border-radius: 3px;
  background: white;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
}

input[type="checkbox"]:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
  position: relative;
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

/* Label-Styles für Checkboxen */
label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
  vertical-align: middle;
}

label span {
  margin-right: 0.5rem;
}

/* Checkbox-Container für bessere Ausrichtung */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.checkbox-item {
  display: inline-flex;
  align-items: center;
  margin: 0.25rem 0;
  vertical-align: middle;
}

/* Spezielle Anpassungen für Listen mit Checkboxen */
ul li.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

ul li.checkbox-item label {
  margin: 0;
  flex: 1;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(47, 122, 95, 0.14);
}

input:hover, select:hover, textarea:hover {
  border-color: var(--primary-color);
}

/* Kompaktere Karten */
.card {
  background: white;
  border-radius: var(--border-radius-large);
  padding: 1rem;
  margin: 0.75rem 0;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

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

.card-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-body {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Kompaktere Tabellen */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  margin: 0.75rem 0;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: var(--text-on-primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.4px;
}

tr:hover {
  background-color: rgba(47, 122, 95, 0.04);
}

/* Kompaktere Listen */
ul, ol {
  padding-left: 1.25rem;
}

li {
  margin: 0.375rem 0;
  color: var(--text-secondary);
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

a:hover {
  color: var(--primary-hover);
}

a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary-color);
  transition: width 0.25s ease;
}

a:hover::after {
  width: 100%;
}

/* Utility-Klassen */
.pointer {
  cursor: pointer;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mb-1 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.75rem; }
.mb-3 { margin-bottom: 1.125rem; }
.mb-4 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.375rem; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1.125rem; }
.mt-4 { margin-top: 1.5rem; }

.p-1 { padding: 0.375rem; }
.p-2 { padding: 0.75rem; }
.p-3 { padding: 1.125rem; }
.p-4 { padding: 1.5rem; }

/* Responsive Design */
@media (max-width: 768px) {
  html {
    font-size: 13px;
  }
  
  button {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .card {
    padding: 0.75rem;
    margin: 0.5rem 0;
  }
  
  h1 {
    height: 2.75rem;
    font-size: 1.125rem;
  }
  
  h2 {
    font-size: 1.375rem;
  }
}

/* Animationen */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

/* Loading-States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--primary-color);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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