/* CSS Design System for Fußball Trainingsplaner & Taktikboard */

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Color Palette */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-dark: #0f172a;
  --bg-header: #1e293b;
  
  --primary: #10b981; /* Grass Green */
  --primary-hover: #059669;
  --primary-light: #d1fae5;
  --primary-dark: #047857;
  
  --pitch-green: #2d6a4f;
  --pitch-grass: #1b4332;
  
  --secondary: #3b82f6; /* Tactical Blue */
  --secondary-hover: #2563eb;
  --secondary-light: #dbeafe;
  
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-orange: #f97316;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-color: #e2e8f0;
  --border-radius: 12px;
  --border-radius-sm: 6px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: var(--bg-header);
  color: #ffffff;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 2.2rem;
  background: linear-gradient(135deg, #10b981, #059669);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Navigation Tabs */
.main-nav {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.35rem;
  border-radius: 10px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

#session-count-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-size: 0.75rem;
}

/* Main Content Area */
.app-content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

/* Tab Panes */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Common Card & Buttons */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-danger {
  background: #fee2e2;
  color: var(--accent-red);
}

.btn-danger:hover {
  background: #fca5a5;
  color: #7f1d1d;
}

/* TAB 1: ÜBUNGSKATALOG */
.toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-sort-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.7rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.filter-group select {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  background: #ffffff;
  cursor: pointer;
}

/* Category Pills */
.category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.pill {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.pill:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.pill.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
}

/* Drills Grid */
.drills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.drill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.drill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.drill-preview-img {
  width: 100%;
  height: 190px;
  background-color: var(--pitch-green);
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.drill-card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.drill-card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-cat {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-dur {
  background: #f1f5f9;
  color: var(--text-muted);
}

.drill-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.drill-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

.drill-card-desc {
  font-size: 0.85rem;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.drill-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.drill-card-actions .btn {
  flex: 1;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
}

/* TAB 2: EDITOR & CANVAS */
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.editor-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Rich Text WYSIWYG Editor */
.wysiwyg-toolbar {
  display: flex;
  gap: 0.35rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0.4rem;
}

.wysiwyg-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.wysiwyg-btn:hover {
  background: #e2e8f0;
}

.wysiwyg-editor {
  min-height: 110px;
  border: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
  padding: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  background: #ffffff;
  outline: none;
}

.wysiwyg-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.wysiwyg-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--text-light);
}

/* Canvas Toolbar */
.canvas-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.canvas-control-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 0.85rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.tool-section {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tool-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 90px;
  text-transform: uppercase;
}

.tool-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.tool-btn:hover {
  background: #e2e8f0;
}

.tool-btn.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
}

.tool-btn.danger {
  color: var(--accent-red);
}

.tool-btn.warning {
  color: var(--accent-orange);
}

#element-color {
  width: 36px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
  background: #ffffff;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0f172a;
  padding: 10px;
  border-radius: 12px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
  overflow: hidden;
  transition: var(--transition);
}

/* Fullscreen Presentation Mode for Monitors & Tablets */
.canvas-wrapper:fullscreen,
.canvas-wrapper:-webkit-full-screen,
.canvas-wrapper.is-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  padding: 1rem !important;
  background: #090d16 !important;
  box-shadow: none !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.canvas-wrapper:fullscreen #tactics-canvas,
.canvas-wrapper:fullscreen #generator-canvas,
.canvas-wrapper:-webkit-full-screen #tactics-canvas,
.canvas-wrapper:-webkit-full-screen #generator-canvas,
.canvas-wrapper.is-fullscreen canvas {
  max-width: 96vw !important;
  max-height: 92vh !important;
  width: auto !important;
  height: auto !important;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

/* Fullscreen Presentation Toolbar for Teambesprechungen */
.fullscreen-toolbar {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.5rem 0.85rem;
  border-radius: 40px;
  display: none;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 100000;
  max-width: 95vw;
  overflow-x: auto;
}

.canvas-wrapper:fullscreen .fullscreen-toolbar,
.canvas-wrapper:-webkit-full-screen .fullscreen-toolbar,
.canvas-wrapper.is-fullscreen .fullscreen-toolbar {
  display: flex;
}

.fullscreen-toolbar .tool-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.55rem 0.95rem;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.fullscreen-toolbar .tool-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.fullscreen-toolbar .tool-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

#tactics-canvas,
#generator-canvas {
  background-color: var(--pitch-grass);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  cursor: crosshair;
  max-width: 100%;
  height: auto;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Mobile & Tablet Responsive Media Queries */
@media (max-width: 900px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .brand {
    justify-content: center;
  }

  .main-nav {
    overflow-x: auto;
    width: 100%;
    padding: 0.4rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .nav-btn {
    white-space: nowrap;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    scroll-snap-align: start;
  }

  .app-content {
    padding: 0.85rem;
  }

  .drills-grid {
    grid-template-columns: 1fr;
  }

  .editor-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .canvas-control-bar {
    padding: 0.6rem;
  }

  .tool-section {
    overflow-x: auto;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  .tool-section-label {
    min-width: 75px;
  }

  .tool-btn, .btn {
    min-height: 42px;
    padding: 0.55rem 0.85rem;
  }

  .search-sort-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    justify-content: space-between;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .session-item {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .session-item-img {
    width: 100%;
    height: 140px;
  }

  .session-item-actions {
    margin-top: 0.5rem;
  }

  .modal-card {
    padding: 1.25rem;
  }
}

.canvas-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* TAB 3: SESSION BUILDER */
.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.session-stats {
  display: flex;
  gap: 1rem;
}

.stat-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.stat-box.highlight {
  background: var(--primary-light);
  border-color: var(--primary);

}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-box.highlight .stat-value {
  color: var(--primary-dark);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.session-drills-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
  min-height: 150px;
}

.session-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.session-item.dragging {
  opacity: 0.45;
  border: 2px dashed #0284c7;
  background: #f0f9ff;
  transform: scale(0.98);
}

.session-item.drag-over {
  border-top: 3px solid #0284c7 !important;
  background: #f8fafc;
  transform: translateY(2px);
}

.session-item-drag-handle {
  cursor: grab;
  font-size: 1.35rem;
  color: #94a3b8;
  padding: 0.25rem 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.session-item-drag-handle:hover {
  color: #0f172a;
}

.session-item:active .session-item-drag-handle {
  cursor: grabbing;
}

.session-item-order-controls {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-order-move {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  width: 26px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.btn-order-move:hover:not(:disabled) {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.btn-order-move:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.session-item-number {
  background: var(--bg-dark);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.session-item-img {
  width: 90px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.session-item-info {
  flex: 1;
}

.session-item-title {
  font-size: 1rem;
  font-weight: 700;
}

.session-item-actions {
  display: flex;
  gap: 0.4rem;
}

.session-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* TAB 4: INTEGRATION & JSON */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.integration-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.json-preview-container {
  margin-top: 1.5rem;
}

#json-preview-code {
  background: var(--bg-dark);
  color: #38bdf8;
  padding: 1.25rem;
  border-radius: 10px;
  max-height: 300px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.85rem;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-in-out;
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 850px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: #f1f5f9;
  border: none;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #e2e8f0;
}

.print-only {
  display: none;
}

/* Print Stylesheet for A4 Trainer Plan & Single Drill Cards */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 8mm 8mm 8mm;
  }

  *, *::before, *::after {
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    overflow: visible !important;
    width: 100% !important;
  }

  /* Universal hide for all non-print elements */
  body > * {
    display: none !important;
    visibility: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* ONLY show the active printable container anchored at the top of the page in normal flow */
  body.printing-single-drill > #single-drill-print-view,
  body.printing-session-handout > #session-handout-print-view,
  body:not(.printing-single-drill):not(.printing-session-handout) > #session-handout-print-view:not(:empty),
  body:not(.printing-single-drill):not(.printing-session-handout) > #single-drill-print-view:not(:empty) {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  body.printing-single-drill > #session-handout-print-view {
    display: none !important;
  }

  body.printing-session-handout > #single-drill-print-view {
    display: none !important;
  }

  #single-drill-print-view:empty,
  #session-handout-print-view:empty {
    display: none !important;
  }

  .print-drill-card {
    display: block !important;
    width: 100% !important;
    page-break-inside: avoid;
    break-inside: avoid;
    padding: 0 !important;
    margin: 0 !important;
    font-family: var(--font-family);
    color: #0f172a;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .print-brand {
    font-size: 1.1rem;
    font-weight: 800;
    color: #10b981;
  }

  .print-meta-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }

  .print-drill-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 0.2rem 0;
    line-height: 1.2;
  }

  .print-author {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.75rem;
  }

  .print-grid {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr !important;
    gap: 1rem !important;
    margin-bottom: 0.75rem !important;
    align-items: start !important;
    align-content: start !important;
    width: 100% !important;
  }

  .print-sketch-img {
    width: 100%;
    max-height: 320px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background-color: #1b4332;
    object-fit: contain;
    display: block;
    margin-top: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-box {
    border: 1px solid #cbd5e1;
    background: #f8fafc !important;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.6rem;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-box h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #0f172a;
  }

  .print-desc-content {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #1e293b;
  }

  /* Session Handout Print Mode */
  .handout-container {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: var(--font-family);
    color: #0f172a;
  }

  .handout-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    border-bottom: 3px solid #0f172a;
    padding-bottom: 0.6rem;
    margin-bottom: 0.85rem;
  }

  .handout-header-logo {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .handout-header-logo img {
    width: 70px !important;
    height: 70px !important;
    max-width: 70px !important;
    max-height: 70px !important;
    object-fit: contain !important;
    display: block !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .handout-header-info {
    flex: 1;
  }

  .handout-club-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .handout-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0.1rem 0 0.3rem 0;
  }

  .handout-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: #334155;
  }

  .handout-drills-list {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .handout-drill-item {
    display: grid !important;
    grid-template-columns: 1.25fr 1fr !important;
    gap: 0.85rem !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    background: #ffffff !important;
    align-items: start !important;
    align-content: start !important;
    width: 100% !important;
  }

  .handout-drill-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
  }

  .handout-drill-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
  }

  .handout-drill-num {
    background: #0f172a !important;
    color: #ffffff !important;
    font-weight: 800;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .handout-drill-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    flex: 1;
  }

  .handout-box {
    border: 1px solid #e2e8f0;
    background: #f8fafc !important;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    margin-bottom: 0.35rem;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .handout-box h4 {
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0 0 0.15rem 0;
    color: #0f172a;
  }

  .handout-box p, .handout-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    color: #1e293b;
    margin: 0;
  }

  .handout-drill-sketch {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  .handout-drill-sketch img {
    width: 100% !important;
    max-height: 220px !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    background-color: #1b4332 !important;
    object-fit: contain !important;
    display: block !important;
    margin-top: 0 !important;
    align-self: flex-start !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


/* Category-specific Badges & Pills */
.badge-cat.badge-torwart, .pill[data-category="Torwart"] {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.badge-cat.badge-torwart {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
  border: 1px solid #059669;
}

.pill[data-category="Torwart"].active {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #047857 !important;
}

.badge-cat.badge-spielform { background: #e0f2fe; color: #0369a1; }
.badge-cat.badge-uebungsform { background: #f3e8ff; color: #6b21a8; }
.badge-cat.badge-aufwaermen { background: #fef3c7; color: #92400e; }
.badge-cat.badge-passspiel { background: #cff4fc; color: #055160; }
.badge-cat.badge-torschuss { background: #ffe4e6; color: #9f1239; }
.badge-cat.badge-taktik { background: #e0e7ff; color: #3730a3; }
.badge-cat.badge-athletik { background: #fce7f3; color: #9d174d; }

.tool-btn-gk {
  border-color: #10b981 !important;
  color: #047857 !important;
  background: #ecfdf5 !important;
  font-weight: 700 !important;
}
.tool-btn-gk:hover {
  background: #10b981 !important;
  color: #ffffff !important;
}

/* --- Vereinswappen & Vorlagen Management --- */
.logo-management-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.current-logo-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}

.current-logo-preview-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.current-logo-preview-container img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.badge-default-indicator {
  display: none;
  margin-top: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  white-space: nowrap;
}

.current-logo-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.logo-actions-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-upload-logo {
  cursor: pointer;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.logo-helper-text {
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.25;
}

.saved-logos-section {
  margin-top: 0.35rem;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}

.saved-logos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.saved-logos-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

.saved-logos-hint {
  font-size: 0.72rem;
  color: #64748b;
}

.saved-logos-grid {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-height: 48px;
}

.saved-logo-card {
  position: relative;
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transition: all 0.18s ease-in-out;
}

.saved-logo-card:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.saved-logo-card.active {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
}

.saved-logo-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.saved-logo-card .badge-star-corner {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.62rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  pointer-events: none;
}

.saved-logo-card .card-actions {
  display: none;
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  gap: 0.35rem;
  z-index: 10;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.saved-logo-card:hover .card-actions {
  display: flex;
}

.saved-logo-card .card-action-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0 0.2rem;
  font-size: 0.8rem;
  line-height: 1;
  transition: transform 0.15s;
}

.saved-logo-card .card-action-btn:hover {
  transform: scale(1.2);
  color: #facc15;
}
