@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #090c0a; /* Tannengrün-Schwarz */
  --panel-bg: rgba(18, 25, 21, 0.7); /* Holzfäller-Grün getönt */
  --panel-border: rgba(255, 255, 255, 0.06);
  --text-color: #f3f4f6;
  --text-muted: #8b9c92;
  --accent-color: #2b7a4b; /* Carpenter Green */
  --accent-glow: rgba(43, 122, 75, 0.4);
  --success-color: #2b7a4b; /* Grün */
  --warning-color: #e67e22; /* Amber */
  --transition-speed: 1000ms;
  --border-radius-custom: 0px; /* Keine runden Karten (Zimmermanns-Balken-Stil) */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
  -webkit-user-select: none;
}

/* Base slideshow container */
#slideshow-container {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.slide-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

/* Fit modes */
.fit-cover {
  object-fit: cover;
}

.fit-contain {
  object-fit: contain;
}

/* Transition: Fade */
.t-fade {
  transition: opacity var(--transition-speed) ease-in-out;
}
.t-fade.active {
  opacity: 1;
  z-index: 3;
}
.t-fade.inactive {
  opacity: 0;
  z-index: 2;
}

/* Transition: Slide */
.t-slide {
  transition: transform var(--transition-speed) cubic-bezier(0.25, 1, 0.5, 1), opacity var(--transition-speed) ease-in-out;
}
.t-slide.active {
  opacity: 1;
  transform: translateX(0);
  z-index: 3;
}
.t-slide.inactive-prev {
  opacity: 0;
  transform: translateX(-100%);
  z-index: 2;
}
.t-slide.inactive-next {
  opacity: 0;
  transform: translateX(100%);
  z-index: 2;
}

/* Transition: Zoom */
.t-zoom {
  transition: transform var(--transition-speed) cubic-bezier(0.25, 1, 0.5, 1), opacity var(--transition-speed) ease-in-out;
}
.t-zoom.active {
  opacity: 1;
  transform: scale(1);
  z-index: 3;
}
.t-zoom.inactive {
  opacity: 0;
  transform: scale(1.08);
  z-index: 2;
}

/* Transition: None */
.t-none {
  transition: none;
}
.t-none.active {
  opacity: 1;
  z-index: 3;
}
.t-none.inactive {
  opacity: 0;
  z-index: 2;
}

/* UI Overlay - Glassmorphism */
.ui-overlay {
  position: absolute;
  z-index: 10;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
  opacity: 1;
  visibility: visible;
}

.ui-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  cursor: none;
}

/* Header overlay */
#header-bar {
  top: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-custom);
  padding: 12px 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  pointer-events: auto;
}

.app-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.status-dot.online {
  background-color: var(--success-color);
  box-shadow: 0 0 10px var(--success-color);
}

.status-dot.offline {
  background-color: var(--warning-color);
  box-shadow: 0 0 10px var(--warning-color);
}

/* Control Panel */
#control-panel {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 90%;
  max-width: 680px;
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.btn-group {
  display: flex;
  gap: 8px;
}

/* Button Styling */
button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  border: 1px solid var(--panel-border);
  padding: 10px 16px;
  border-radius: var(--border-radius-custom);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.primary {
  background: var(--accent-color);
  border-color: transparent;
  box-shadow: 0 0 15px var(--accent-glow);
}

button.primary:hover {
  background: #b55fe6;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

/* Settings Controls */
.settings-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: 0.85rem;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-item label {
  color: var(--text-muted);
  font-weight: 500;
}

select, input[type="number"] {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  color: var(--text-color);
  padding: 6px 12px;
  border-radius: var(--border-radius-custom);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

select:focus, input[type="number"]:focus {
  border-color: var(--accent-color);
}

/* File Picker Box / Welcome Screen */
#welcome-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 5;
  text-align: center;
  padding: 40px;
  transition: opacity 0.5s ease, visibility 0.5s;
}

#welcome-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.welcome-content {
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.welcome-logo {
  width: 100px;
  height: 100px;
  border-radius: var(--border-radius-custom);
  box-shadow: 0 10px 40px rgba(43, 122, 75, 0.25);
  margin-bottom: 10px;
  background-image: url('icon-512.png');
  background-size: cover;
  background-position: center;
}

.welcome-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.welcome-text {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* File counter / info */
.file-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* SVG Icon styles */
.icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Custom Alert Banner */
#alert-banner {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  padding: 10px 20px;
  border-radius: var(--border-radius-custom);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#alert-banner.visible {
  opacity: 1;
  visibility: visible;
}

#alert-banner.alert-error {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

#alert-banner.alert-success {
  background: rgba(43, 122, 75, 0.3);
  border: 1px solid rgba(43, 122, 75, 0.65);
  color: #a3e635; /* Light green */
}

/* Interactive custom slider or progress tracker */
#progress-bar-container {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-color);
  transition: width 0.1s linear;
}

/* Keyboard Hints */
.shortcuts-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

/* Hide UI elements during active presentation */
body.hide-cursor {
  cursor: none;
}

/* --- Planner Dashboard Styles --- */
#dashboard-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 8;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px;
  box-sizing: border-box;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
  flex-shrink: 0;
  box-sizing: border-box;
}

#thumbnail-grid-container {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  box-sizing: border-box;
  padding-right: 4px;
}

/* Grid Layout */
#thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  padding-bottom: 24px;
}

/* Card Styling */
.grid-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-custom);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: grab;
  position: relative;
  aspect-ratio: 1 / 1.22;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.grid-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.grid-card:active {
  cursor: grabbing;
}

.grid-card.dragging {
  opacity: 0.3;
  transform: scale(0.95);
  border: 1px dashed var(--accent-color);
}

.grid-card-placeholder {
  border: 2px dashed var(--accent-color);
  background: rgba(43, 122, 75, 0.05);
  box-shadow: inset 0 0 20px rgba(43, 122, 75, 0.15), 0 0 15px var(--accent-glow);
  border-radius: var(--border-radius-custom);
  aspect-ratio: 1 / 1.22;
  box-sizing: border-box;
  pointer-events: none; /* Let dragenter/dragover fall through */
}

.grid-card-img-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-card-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.grid-card-label {
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
}

/* Card Overlays */
.grid-card-duration {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--border-radius-custom);
  display: flex;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}

.grid-card-index {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* Custom Scrollbar for Grid Container */
#thumbnail-grid-container::-webkit-scrollbar {
  width: 8px;
}
#thumbnail-grid-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
#thumbnail-grid-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
#thumbnail-grid-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Modal Overlay & Dialog Styles --- */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.25s ease;
}

.modal-content {
  width: 90%;
  max-width: 380px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  border-radius: var(--border-radius-custom);
}

.hidden {
  display: none !important;
}

