body {
background-color: #1e1e1e;
color: #e0e0e0;
margin: 0;
font-family: system-ui, sans-serif;
}
* {
box-sizing: border-box;
}

#app {
display: flex;
height: 100vh;
}

/* LINKE SEITE */
#left {
flex: 0 0 50%;
display: flex;
flex-direction: column;
}
/* RECHTE SEITE */
#right {
	flex: 0 0 50%;
	display: flex;
}

#main {
	height: 45vh;
	padding: 20px 0 20px 20px; /* top right bottom left */
	overflow: hidden;
}
/* MAIN LAYOUT */
.main-layout {
	display: flex;
	gap: 24px;
	align-items: stretch;
	height: 100%;
}

.main-left,
.main-right {
	display: flex;
	flex-direction: column;
	gap: 12px;
	height: 100%;   /* volle Höhe des Containers */
	min-height: 0;  /* wichtig für Scroll oder Overflow in Column */
}
.main-left {
	flex: 0 0 auto; /* natürliche Höhe, kein Shrink */
}
.main-right {
	border-left: 1px solid #333;
	padding-left: 12px;
	flex: 1 1 0; /* nimmt den Rest der Höhe */
}

.title-row .active 	 { background: #309900; }
.title-row .outdated { background: #ffae00; }
.title-row .deactive { background: #ff0000; }
.title-row {
	display: flex;
	align-items: center; /* vertikal zentrieren */
	gap: 12px;
	height: 48px;        /* feste Höhe für konsistente Avatare */
}

.userIcon {
    height: 100%;          /* passt genau zur Zeilenhöhe */
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #333;
    background-color: #222;
    max-height: 75px;
    cursor: pointer;
}
/* INPUTS */
input {
	margin-left: auto;
	padding: 8px 10px;
	border-radius: 6px;
	border: none;
	background: #2a2a2a;
	color: #fff;
	flex: 1 auto;
}
.input-row {
	display: flex;
	gap: 10px;
	align-items: center;
	padding-right: 20px;
	min-height: 40px; /* verhindert Stauchen */
}

/* BUTTONS */
button {
	padding: 8px 8px;
	border-radius: 6px;
	border: none;
	background: #3a3a3a;
	color: #fff;
	cursor: pointer;
/* margin-bottom: 10px;  */
}
button:hover {
background: #505050;
}
.input-row button.active { background: #309900; }
.button-row {
padding-right: 20px;
}

/* PLAYLIST CONTAINER */
.playlist-container {
	display: flex;
	flex-direction: column;
	border-left: 1px solid #333;
	padding-left: 12px;
	min-width: 400px;
	overflow: visible;
}
.playlist-container .header-title,
.playlist-container .header-text {
 	flex: 0 0 auto;
}
.playlist-container .header-title {
	display: flex;
	align-items: center;      /* vertikal mittig */
	justify-content: space-between; /* links Titel, rechts Button */
	gap: 10px;
}
.playlist-container .header-text {
	border-bottom: 3px solid #333;
}
.playlist-container .header-title .header-actions {
	margin-left: auto;
	padding-right: 10px;
	display: flex;
	gap: 2px;
}
.playlist-container .header-title .header-actions .active { background: #309900; }
.playlist-item-list {
	overflow-y: auto;
	min-height: 0;
	max-height: none; /* 🔑 ab hier wird gescrollt */
	padding-right: 10px;
}
#playlist-wrapper {
	display: flex;
	flex-direction: column;
	gap: 10px;              /* Abstand zwischen Containern */
	max-height: 100vh;      /* Parent maximal so hoch wie Viewport */
	overflow: hidden;       /* Parent scrollt nicht */
	border-left: 3px solid #333;
	width: 100%;
}
#padding-left {
	flex: 0 1 auto;
}
#editorList {
	flex: 1 /*Soll die gesamte mögliche Breite immer einnehmen*/
}
#internalPlaylists, #externalPlaylists {
	max-width: 400px;
}

#currentList, #queueList, #selectedList {
	padding-left: 0px;
	border-left: none;
}

#search-playlist-container {
	width: 100%;
	min-height: 0;
}

/* alle Kinder gleich breit */
#search-playlist-container .playlist-container {
    display: none;
	width: 100%;
	min-width: 0;
	border-left: none;
	padding-left: 0px;
}
#search-playlist-container .playlist-container.active {
    display: block;
}
#search-playlist-container .playlist-item-duration {
    margin-right: 0px;
}

.playlist-container h2 {
	margin-top: 1;
}


/* PLAYLIST HEADER */
.playlist-header {
	display: flex;
	gap: 12px;
	padding: 8px;
	margin-top: 8px;
    margin-bottom: 8px;
	margin-right: 10px;
	background-color: #2a2a2a;
	border-radius: 6px;
	align-items: center;
}
.playlist-header-thumb {
	width: 100px;
	aspect-ratio: 16 / 9;
	border-radius: 4px;
	flex-shrink: 0;
	background-color: transparent;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
}
.playlist-header-thumb img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
}
.playlist-header-title {
	color: #fff;
	word-break:  break-word;
}
.playlist-header-description {
color: #ccc;
}
.playlist-header-meta {
white-space: nowrap;
}
.playlist-header-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 14px;

	min-width: 0;
	flex: 1 1 auto;
}
.playlist-header:hover {
background-color: #3a3a3a;
transform: translateY(-1px);
}
.playlist-header-ownership {
    display: flex;
    gap: 4px;            /* Abstand zwischen den Icons */
    margin-left: auto;    /* Schiebt die Icons ganz nach rechts */
    align-items: center;

	flex-shrink: 0;
}
.playlist-header-ownership img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #3a3a3a;
    background: #111;
}
.playlist-header.active { outline: 2px solid #44f63b; outline-offset: -2px; }

/* PLAYLIST ITEMS */
.playlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin: 8px 10px 8px 0;
    background: #2a2a2a;
    border-radius: 6px;
    transition: background 0.15s;
}
.playlist-item-index {
    min-width: 24px;      /* mindestens 24px */
    padding: 0 4px;       /* optional horizontalen Abstand */
    text-align: right;
    font-weight: bold;
    color: #ccc;
    flex-shrink: 0;
}
.playlist-item-thumb {
	width: 80px;
	aspect-ratio: 16 / 9;
	flex-shrink: 0;
	background-color: transparent;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
}
.playlist-item-thumb img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
}
.playlist-item-text {
	display: flex;
	flex-direction: column;
	font-size: 14px;
	flex: 1 1 auto;
	min-width: 0;
}
.playlist-item-title {
	font-weight: 600;
	word-break: break-word;
}
.playlist-item-author {
font-size: 12px;
color: #999;
}
.playlist-item-right {
    display: flex;
    align-items: center;
    margin-left: auto; /* schiebt den Wrapper nach rechts */
    gap: 16px;         /* Abstand zwischen Duration und AddedBy */

	flex-shrink: 0;
}
.playlist-item-duration {
    min-width: 50px;
    text-align: right;
    font-family: monospace;
    font-size: 13px;
    color: #aaa;
    flex-shrink: 0;
	margin-right: 40px; /*Abstand zu addedAt*/
}
.playlist-item-addedat {
    min-width: 50px;
    text-align: right;
    font-family: monospace;
    font-size: 13px;
    color: #aaa;
    flex-shrink: 0;
}

.playlist-item-addedby {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.playlist-item-addedby img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #3a3a3a;
    background: #111;
}

/* Active / Selected / Copy */
.playlist-item:hover {
background: #3a3a3a;
transform: translateY(-1px);
}
.playlist-item.active { outline: 2px solid #44f63b; outline-offset: -2px; }
.playlist-item.selected { outline: 2px solid #3b82f6; outline-offset: -2px; }
.playlist-item.copy,
.playlist-item.dragging { outline: 2px dashed #f59e0b; outline-offset: -2px; }

#internalPlaylists-container {
display: flex;             /* nebeneinander */
gap: 12px;                 /* Abstand zwischen den Spalten */
height: 100%;              /* nimmt den Rest des linken Bereichs */
overflow: hidden;          /* verhindert Scrollüberschneidung */
border-top: 1px solid #333;
}
#search-playlists {
border-left: none;
padding-left: 0;
height: 400px;
}


/* Standard für alle Elemente mit Scrollbar */
* {
scrollbar-width: thin;       /* Firefox: dünne Scrollbar */
scrollbar-color: #444 #1e1e1e; /* Firefox: thumb | track */
}
/* Webkit-Browser: Chrome, Edge, Safari */
*::-webkit-scrollbar {
width: 8px;                 /* Breite der Scrollbar */
height: 8px;                /* Höhe für horizontale Scrollbar */
}
*::-webkit-scrollbar-track {
background: #1e1e1e;        /* Track Hintergrund */
}
*::-webkit-scrollbar-thumb {
background-color: #444;     /* Scroll-Daumen */
border-radius: 4px;         /* abgerundet */
border: 2px solid #1e1e1e; /* Abstand zum Track */
}
*::-webkit-scrollbar-thumb:hover {
background-color: #666;     /* Hover Effekt */
}
* {
overflow-x: hidden; /* Keine Horizontale Scrolls */
}

#player-wrapper {
position: relative;
width: 560px;
aspect-ratio: 16 / 9;
border-radius: 8px;
overflow: hidden;
}
#main_player {
	position: relative;
	width: 100%;
	height: 100%;
}

#yt-player,
#spotify-player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-color: black;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
}





/* MAIN */
.custom-player-overlay {
	position: absolute;
	inset: 0;              /* deckt main_player komplett ab */
	z-index: 10;
	background: transparent;
	pointer-events: auto;  /* fängt ALLE Mouse/Touch Events ab */
	display: flex;
	flex-direction: column;
	height: 100%;
	opacity: 0;
	transition: opacity 0.3s ease;
}
.custom-player-overlay:hover {
opacity: 1;           /* voll sichtbar beim Hover */
}
/*Aufteilung Oben und Unten*/
.custom-player-overlay .top,
.custom-player-overlay .bottom {
	position: relative;
	flex: 7;
	display: flex;
	flex-direction: row;
	justify-content: space-between; /* unten bündig */
	align-items: flex-end;
}
.custom-player-overlay .top {
	flex: 3;
	padding: 10px;
	align-items: flex-start; /* oben bündig */
}
/*Meta -> Teilt bottom/Top in zwei Hälfte*/
.custom-player-overlay .meta {
	display: flex;
	flex-direction: column;
	padding: 10px;
	gap: 2px;
	z-index: 1;
	background: rgba(0, 0, 0, 0.4); /* Schwarz mit 40% Deckkraft */
    backdrop-filter: blur(8px);    /* Erzeugt einen Milchglas-Effekt */
    border-radius: 8px;            /* Optional: rundet die Ecken ab */
    color: white;                  /* Stellt sicher, dass der Text weiß ist */
}
.custom-player-overlay .bottom .meta {
	width: 100%;
}
.custom-player-overlay .top .meta .title {
	font-size: 16px;
	font-weight: 600;
}
.custom-player-overlay .top .meta .author {
	font-size: 12px;
}
.custom-player-overlay .bottom .meta .time_display {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;           /* Abstand zwischen Elementen */
	width: 100%;        /* volle Breite */
}
.custom-player-overlay .bottom .meta .controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;           /* Abstand zwischen Elementen */
	width: 100%;        /* volle Breite */
}
.controls .active { background: #309900; }
#current_time,
#total_time {
color: white;
font-size: 12px;
flex-shrink: 0;     /* nicht kleiner ziehen */
width: 50px;        /* feste Breite für Konsistenz */
text-align: center;
}

#timeline { flex: 1; }
.metaVolume {
    position: absolute;
	right: 0;
	bottom: 40px;
	top: 0;
	width: 60px;
	padding-right: 10px;
	z-index: 2; 
    display: flex;
    justify-content: center;
    align-items: center;    
    pointer-events: auto; 
}
.slider-vertical {
    -webkit-appearance: none;
    appearance: none;
    
    
    width: 160px;
    height: 4px; 
    
    background: #d3d3d3;
    outline: none;
    border-radius: 5px;

    /* Rotation und Positionierung */
    transform: rotate(-90deg);
    transform-origin: center;
    position: absolute; 
}
.slider-vertical::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 50%;
    cursor: pointer;
}
.slider-horizontal {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 0px;
	background: #d3d3d3;
	outline: none;
}
.slider-horizontal::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 50%;
    cursor: pointer;
}

#context-menu {
    position: absolute;     /* wird per JS positioniert */
    background-color: #2a2a2a; /* wie deine Inputs */
    color: #fff;
    border: 1px solid #505050;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    padding: 6px 0;
    display: none;          /* standardmäßig versteckt */
    z-index: 1000;          /* über allen Elementen */
    min-width: 180px;
}
.context-submenu {
    position: absolute;            /* wie #context-menu, nicht fixed */
    background-color: #2a2a2a;     /* gleiche Farbe wie Hauptmenu */
    color: #fff;
    border: 1px solid #505050;
    border-radius: 6px;
    padding: 6px 0;
    min-width: 180px;              /* gleiche Breite wie #context-menu */
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: none;
    z-index: 1000;                 /* sollte über dem Main-Menu liegen */
}
.context-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.context-item:hover { background-color: #505050; }
.context-separator {
    height: 1px;
    margin: 6px 0;
    background: rgba(255,255,255,.15);
}




@keyframes loading-bg {
  0%   { opacity: 0; }
  50%  { opacity: 0.5; }
  100% { opacity: 0; }
}

.loading {
  position: relative;
  overflow: hidden;
}

/* Overlay */
.loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgb(0, 200, 255);
  opacity: 0;
  pointer-events: none;

  animation: loading-bg 0.5s ease-in-out infinite;
  animation-delay: 0.2s; /* verhindert Aufblitzen */
}
