/* Disable WebView browser UI overlays (resize hints, drag-select, etc.) */
* {
    -webkit-user-select: none;
    user-select: none;
}
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

:root {
    --primary-color: #ff8000;
    --secondary-color: #414141;
    --primary-color-light: #ffaa33;
    --primary-color-dark: #cc6600;
    --bg-dark: #0f0f0f;
    --container-bg: #1a1a1a;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --accent-neon: #D9FF3D;
}

/* Global Navigation */
:root {
    --nav-bg: rgba(15, 15, 15, 0.8);
    --nav-text: #ffffff;
    --nav-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

nav {
    position: fixed; top: 0; left: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem 5%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: var(--nav-shadow);
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav.scrolled {
    padding: 0.5rem 5%;
    background: rgba(15, 15, 15, 0.95);
}

.nav-logo { 
    font-size: 1.8rem; 
    font-weight: 900; 
    color: #ffffff; 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    letter-spacing: -1px;
}

.logo-text {
    display: flex;
    align-items: baseline;
}

.nav-logo span { 
    color: var(--primary); 
    text-shadow: 0 0 15px rgba(255, 128, 0, 0.3);
}

.nav-logo img { 
    height: 42px; 
    transition: var(--transition);
}

.nav-logo:hover img {
    transform: rotate(-5deg) scale(1.05);
}

.nav-links { display: flex; gap: 2.5rem; align-items: center; }
.nav-links a { 
    text-decoration: none; 
    color: var(--nav-text); 
    font-weight: 600; 
    font-size: 0.9rem; 
    transition: var(--transition);
    opacity: 0.7;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active { 
    opacity: 1; 
    color: white; 
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.nav-links a.nav-cta {
	background: #ff8000;
	color: white;
	padding: 0.6rem 1.4rem;
	border-radius: 5px;
	opacity: 1;
	box-shadow: 0 4px 15px rgba(255, 128, 0, 0.2);
	border: 1px gold;
}


.nav-links a.nav-cta::after {
    content: '';
    position: absolute;
    left: -2px;
    top: -2px;
    border-radius: 10px;
    background: linear-gradient(45deg, #fb0094, #0000ff, #00ff00, #ffff00, #ff0000, #fb0094,
            #0000ff, #00ff00, #ffff00, #ff0000);
    background-size: 400%;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    z-index: -1;
    animation: move_142 20s linear infinite;
}

@keyframes move_142 {
	0% {
		background-position: 0 0;
	}

	50% {
		background-position: 400% 0;
	}

	100% {
		background-position: 0 0;
	}
}

.nav-links a.nav-cta::after {
	filter: blur(50px);
}

.nav-links a.nav-cta:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 128, 0, 0.4);
}

/* Grouping Actions (Lang + User) */
.nav-actions { display: flex; align-items: center; gap: 1.5rem; }

.lang-switch { display: flex; gap: 4px; background: rgba(255,255,255,0.05); padding: 4px; border-radius: 8px; }
.lang-btn { 
    background: transparent;
    color: rgba(255,255,255,0.6);
    border: none;
    padding: 4px 8px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 0.7rem; 
    transition: 0.3s;
    font-weight: 800;
}
.lang-btn:hover { color: white; }
.lang-btn.active { background: rgba(255,255,255,0.1); color: white; }

.nav-user { position: relative; }
.profile-link {
    width: 40px; height: 40px; border-radius: 12px;
    border: 2px solid rgba(255, 128, 0, 0.3);
    overflow: hidden; transition: var(--transition);
    display: block;
    cursor: pointer;
}

.profile-link:hover { 
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 128, 0, 0.2);
}

.profile-link img { width: 100%; height: 100%; object-fit: cover; }

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 220px;
    background: var(--container-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.5rem;
}

.dropdown-header span {
    display: block;
}

.dropdown-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
}

.dropdown-username {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.8rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0.5rem 0;
}

.dropdown-item.logout {
    color: var(--pink);
}

.dropdown-item.logout:hover {
    background: rgba(255, 142, 171, 0.1);
    color: var(--pink);
}

.dropdown-item.logout i {
    color: var(--pink);
}

/* Global Body Style Adjustments for Nav */
body.with-nav {
    padding-top: 80px;
}

html, body {
    margin: 0; padding: 0;
    min-height: 100%;
    background-color: var(--primary-color);
    color: var(--text-main);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../media/img/bubbles.png');
    background-size: cover;
    background-position: center;
    opacity: 0.25;
    z-index: 1;
    pointer-events: none;
    filter: brightness(0); /* Charcoal/Dark Bubbles */
}


.theme-green {
    --primary-color: #63B22F;
    --secondary-color: #63B22F;
    --primary-color-light: #8BC34A;
    --primary-color-dark: #388E3C;
    --bubble-color: rgba(99, 178, 47, 0.1);
    --primary-color-alpha: rgba(99, 178, 47, 0.82);
}

.theme-dark {
    --primary-color: #414141;
    --secondary-color: #414141;
    --primary-color-light: #616161;
    --primary-color-dark: #212121;
    --bubble-color: rgba(255, 255, 255, 0.1);
    --primary-color-alpha: rgba(65, 65, 65, 0.82);
}

.theme-pink {
    --primary-color: #FF8EAB;
    --secondary-color: #FF8EAB;
    --primary-color-light: #FFC1D1;
    --primary-color-dark: #C2185B;
    --bubble-color: rgba(255, 142, 171, 0.1);
    --primary-color-alpha: rgba(255, 142, 171, 0.82);
}

.theme-neon {
    --primary-color: #D9FF3D;
    --secondary-color: #D9FF3D;
    --primary-color-light: #E6FF80;
    --primary-color-dark: #A6CC00;
    --bubble-color: rgba(217, 255, 61, 0.1);
    --primary-color-alpha: rgba(217, 255, 61, 0.82);
}

.theme-blue {
    --primary-color: #4A90E2;
    --secondary-color: #4A90E2;
    --primary-color-light: #7AB3FF;
    --primary-color-dark: #2563EB;
    --bubble-color: rgba(74, 144, 226, 0.1);
    --primary-color-alpha: rgba(74, 144, 226, 0.82);
}
/*Keyframes Anweisungen für Animation und UX-Experience*/
@keyframes markerPop {
    0% {
        transform: translateX(-50%) scale(0.5); /* Startet klein */
        opacity: 0; /* Und unsichtbar */
    }
    50% {
        transform: translateX(-50%) scale(1.2); /* Kurzzeitig größer als Normalgröße */
        opacity: 1; /* Volle Deckkraft */
    }
    100% {
        transform: translateX(-50%) scale(1); /* Endet bei Normalgröße */
        opacity: 1; /* Bleibt sichtbar */
    }
}

/* Globale Definition für den Funkenflug (Optional, für mehr Kontrolle) */
:root {
  --spark-color-start: #ffcc00; /* Helles Gelb für Funken */
  --spark-color-end: #ff6600;   /* Orange für Funken */
  --spark-size: 3px;            /* Größe der Funken */
  --spark-travel: 1px;         /* Wie weit die Funken fliegen */
  --spark-duration: 0.8s;       /* Geschwindigkeit des Funkenflugs */
}

/* -------------------------------------------------------- */
/* ---------- HOVER-EFFEKTE: REGENBOGEN & FUNKEN ---------- */
/* -------------------------------------------------------- */

/* Wenn über den grauen Container gehovert wird: */
.w3-light-grey:hover > .w3-blue {
    transform: scale(1.02, 1.4); /* Der leichte Puls-Effekt bleibt */
    
    /* 🌟 REGENBOGEN-FLAMME: Animierter linear-gradient */
    background: linear-gradient(
        90deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3 /* Regenbogenfarben */
    );
    background-size: 400% 100%; /* Wichtig für die Animation */
    animation: rainbowFlow 4s linear infinite; /* Animation starten */

    /* 🌟 ZÜNDSCHNUR-FUNKENFLUG: Pseudoelement am Ende des Balkens */
    &::after {
        content: ''; /* Inhalt muss gesetzt sein, um es sichtbar zu machen */
        display: block;
        width: var(--spark-size);
        height: var(--spark-size);
        border-radius: 50%; /* Runde Funken */
        background-color: var(--spark-color-start); /* Startfarbe */
        position: absolute;
        top: calc(50% - (var(--spark-size) / 2)); /* Zentriert vertikal */
        right: calc(0px - (var(--spark-size) / 2)); /* Am rechten Rand des Balkens */
        
        /* Box-Shadow für Stern-ähnliche Funken oder zusätzliche Glows */
        box-shadow: 
            0 0 2px 1px var(--spark-color-start),
            0 0 4px 2px var(--spark-color-end);
            
        animation: sparkFlight var(--spark-duration) linear infinite alternate; /* Funkenanimation */
        animation-delay: 0.1s; /* Kleine Verzögerung für den Start */
        z-index: 10; /* Stellen Sie sicher, dass die Funken sichtbar sind */
    }
}


/* -------------------------------------------------------- */
/* ---------- KEYFRAME-ANIMATIONEN ------------------------ */
/* -------------------------------------------------------- */

/* Animation für den Regenbogen-Flow */
@keyframes rainbowFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Animation für den Funkenflug (von rechts nach rechts fliegen, verblassen) */
@keyframes sparkFlight {
    0% {
        transform: translateX(0) scale(1) rotate(0deg);
        opacity: 1;
        background-color: var(--spark-color-start);
    }
    50% {
        transform: translateX(var(--spark-travel)) scale(1.2) rotate(45deg); /* Fliegt nach rechts, wird größer */
        opacity: 0.8;
        background-color: var(--spark-color-end);
    }
    100% {
        transform: translateX(calc(var(--spark-travel) * 2)) scale(0.5) rotate(90deg); /* Fliegt weiter, wird kleiner und transparenter */
        opacity: 0;
        background-color: var(--spark-color-end);
    }
}


/* Stil für das Profilbild */
html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

body{
    height: 95%;
    width: 100%;
    margin: auto;
    padding: 0;
    background-color: var(--primary-color);
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.5s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(26,26,26,0.8) 0%, rgba(15,15,15,0.9) 100%), url('../media/img/bubbles.png');
    background-size: auto, auto;
    background-size: cover;
    opacity: 0.15;
    z-index: 1;
}

a{
    color: black;
}

tr{
    cursor: pointer;
}
tr.selected {
    background-color: lightgray; /* Hintergrundfarbe für die ausgewählte Zeile */
}
.selected-row {
    background-color: lightgray;
}
logintxt{
    font-size: 0.6em;
}

#profileInfo {
    display: flex; /* Aktiviere Flexbox */
    align-items: center; /* Vertikal zentrieren */
    padding-left: 0.3em;
    padding-top: 0.3em;
    position: relative; /* ⬅️ WICHTIG für Kindelemente */
    height: 100%; /* Oder eine feste Höhe, damit relative funktioniert */
    width: 250px;
}

.profileContainer{
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    /*grid-template-areas: ". . . " ". . . " ;*/
    grid-column-gap: 0;
    grid-row-gap: 0;
    justify-items: stretch;
    align-items: center;
    height:4em;
    flex-shrink: 0;
}

.fa-solid, .fas {
    font-weight: 900;
    font-size: x-large;
    margin-top: 0.2em;
}

#profileImage {
    margin-left: 0.3em;
    margin-right: 0.5em;
    width: 4em;
    height: 4em;
    border-radius: 50%;
    margin-top: 0;
    flex-shrink: 0;
}

#profileText {
    font-size: 1em;
    font-weight: bold;
    font-family: "Arial";
    margin-top: -0.8em;
    margin-left: 0.5em; /*sollte 0 sein laut GPT */
}
.hamburgerBar {
    width: 15px;
    height: 3px;
    background-color: black;
    margin: 2px 0;
}
.currencyBox {
    background-color: rgba(200, 200, 200, 0.8);
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 0.6em;
    font-weight: bold;
    font-family: Arial, sans-serif;
    color: #333;
    text-align: center;
    height: fit-content;
    width: 74px;
    position: absolute; 
    top: 4.5em; 
    left: 9em;
    margin: 0;
}

.currencyBox:hover{
    cursor:pointer;
}

#txtUsername{
    width: 150px;
    font-family: "Arial";
}
#txtPassword{
    width: 150px;
    font-family: "Arial";
}

.loginContainer{
    text-align: center;
    width: 100%;
    margin: auto;
    font-family: "Arial";
    background-color: white;
    border-radius: 5px;
    margin-top: 5em;
}

label{
    font-family: "Arial";
    font-weight: bold;
    text-align: left;
    margin-left: -5.5em;
    font-size: 0.8em;
}

.topBar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    height: 35px;
    position: relative;
    box-sizing: border-box;
    z-index: 1000;
}

.topBar-item {
    display: flex;
    align-items: center;
    height: 100%;
}

#menuButtonContainer {
    width: 25px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
}

.hamburgerBar {
    width: 18px;
    height: 2px;
    background-color: black;
    margin: 2px 0;
}

#contextMenu {
    display: none;
    position: absolute;
    top: 35px;
    left: 10px;
    z-index: 2000;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    min-width: 160px;
    font-family: Arial, sans-serif;
    font-size: 0.9em;
}

#contextMenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#contextMenu ul li {
    padding: 8px 12px;
    cursor: pointer;
    position: relative;
    color: #333;
}

#contextMenu ul li:hover {
    background-color: #f0f0f0;
}

#colorSubMenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    min-width: 120px;
    z-index: 2001;
}

#colorSubMenu ul li {
    display: flex;
    align-items: center;
}

#colorSubMenu ul li span:first-of-type {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.topBar-left-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

#tierLevel {
    font-weight: bold;
    font-size: 0.6em;
    padding: 2px 6px;
    background: #2ecc71;
    border-radius: 3px;
    color: white;
    margin-left: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.topBar-status-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.statusDropdown {
    display: flex;
    align-items: center;
    cursor: pointer;
    height: 100%;
    position: relative;
    padding-right: 15px;
    margin-left: 10px;
}

.statusDropdown::after {
    content: '▼';
    font-size: 0.7em;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.statusDisplay {
    font-size: 13px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: normal;
    margin-left: 8px;
    color: #000;
}

#customDropdownMenu {
    display: none;
    position: absolute;
    top: 35px;
    right: 0;
    z-index: 2000;
    background-color: white;
    width: 270px;
    border-radius: 4px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid #ccc;
    overflow: hidden;
}

.dropdownItem {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    color: #000;
    font-weight: normal;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
}

.dropdownItem:hover {
    background-color: #f5f5f5;
}

.statusCircle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 9px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: bold;
    flex-shrink: 0;
}

.statusCircle span {
    display: none;
    line-height: 1;
}

#statusDropdown.privacy-active .statusCircle span,
.dropdownItem.privacy-active .statusCircle span {
    display: block;
}

.dropdownItem.active,
.dropdownItem.active-checkbox,
#privacyItem.active {
    font-weight: bold;
}

.statusCircle.online { background-color: #26d357; }
.statusCircle.away { background-color: #ffc107; }
.statusCircle.busy { background-color: #f86b6b; }
.statusCircle.invisible { background-color: #8e8e8e; }
.statusCircle.offline { background-color: #bdc3c7; }

.dropdownSeparator {
    height: 1px;
    background-color: #ddd;
    margin: 2px 0;
}

.dropdownItem.no-hover:hover {
    background-color: transparent;
    cursor: default;
}

.privacyIcon {
    width: 20px;
    height: 20px;
    border: 2px solid #5d78ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #5d78ff;
    margin-right: 10px;
    font-family: 'Segoe UI', Arial, sans-serif;
    flex-shrink: 0;
}

#privacyItem.active {
    background-color: transparent !important;
    color: #000 !important;
}

#privacyItem.active .privacyIcon {
    background-color: #5d78ff;
    color: white;
}

/* Custom Checkbox */
.custom-checkbox {
    width: 20px;
    height: 20px;
    position: relative;
    margin-left: 0 !important;
    margin-right: 10px;
    margin-left: 0 !important; /* Force reset of margin-left for alignment */
    flex-shrink: 0;
}

.custom-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 4px;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #26d357;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

#statusText {
    width: 95%;
    margin: 10px auto 0 auto;
    flex-shrink: 0;
}

#statusSelect {
    /* Dropdown-Pfeil und Standard-Look des Browsers entfernen */
    -webkit-appearance: none; /* Für Chrome/Safari */
    -moz-appearance: none;    /* Für Firefox */
    appearance: none;         /* Standard */
    
    /* Farbe und Schrift anpassen */
    background: transparent; /* Wichtig, um den Hintergrund des Dropdown-Felds zu entfernen */
    border: none;
    color: white; /* Textfarbe anpassen an Top Bar */
    font-size: 0.8em;
    font-weight: bold;
    padding-right: 20px; /* Platz für den benutzerdefinierten Pfeil/Indikator lassen */
    cursor: pointer;
}

input[type="text" i] {
    width: 99%;
    background-color: rgba(200, 200, 200, 0.8);
    border-radius: 5px;
    border: 0;
    font-size: 0.7em;
}
input[type="password" i] {
    width: 99%;
    background-color: rgba(200, 200, 200, 0.8);
    border-radius: 5px;
    border: 0;
    font-size: 0.7em;
}

#ExperienceBar{
    font-size: 0.7em;
    font-family: "Arial";
    margin-left: 0.4em;
    margin-top: 0.8em;
    background-color: var(--primary-color);
    width: 97%;
    border-radius: 5px;
    height: 40px;
    position: relative;
}

#ExperienceText{
    position: relative;
    margin-top: 0.3em;
    margin-left: auto;
    font-size: 1em;
    font-weight: 600;
    transition: color 0.2s;
    margin-right: auto;
    align-self: center;
    display: table;
}

#ExperienceBar:hover #ExperienceText {
    color: #000; /* Ändere die Textfarbe auf Rot */
    font-weight: bold;
}

.messengerMain {
    background-color: rgb(255, 255, 255);
    border-radius: 5px;
    margin-top: 0.4em;
    height: 97%; /* Stays relative to body for now */
    
    /* ADDED: Set to flex container with column direction */
    display: flex;
    flex-direction: column;
}

.messengerMain > div:first-child {
    /* This is the div with height: 100% inside messengerMain. 
       Make it a column flex container as well to manage its children's heights. */
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Die äußere Leiste (der graue Hintergrund) */
.w3-light-grey {
    height: 5px;
    margin-top: 1em;
    margin-left: 0.5em;
    width: 96%;
    background-color: #f1f1f1 !important;
    position: relative; /* Muss relativ sein, damit .w3-blue absolut darin positioniert wird */
    border-radius: 5px;
    overflow: hidden; /* Wichtig, damit die Funken am Ende abgeschnitten werden, wenn sie zu weit gehen */
}

/* Der blaue Fortschrittsbalken, der zum Regenbogen wird */
.w3-blue {
    height: 5px;
    background-color: #2196F3 !important; /* Standard-Hintergrund, falls kein Hover */
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 5px;
    transform-origin: left;
    
    /* Sanfter Übergang für alle Änderungen */
    transition: background-color 0.4s ease-in-out, transform 0.2s ease-out;
    
    /* Initial unsichtbar für Funken-Pseudoelement */
    &::after {
        content: none; /* Standardmäßig keine Funken */
    }
}

/* 🌟 NEUE REGEL: Ändere die Hintergrundfarbe des blauen Balkens, 
   WENN über das ELTERN-ELEMENT (.w3-light-grey) gehovert wird. */
.w3-light-grey:hover > .w3-blue {
    background-color: #ff0000 !important; /* Wird ROT, wenn über den grauen Container gehovert wird */
    /* 🌟 NEUER UX-EFFEKT: Leichte Skalierung */
    transform: scale(1.02, 1.4); 
    /* Skaliert den Balken um 2% in die Breite (X) und um 40% in die Höhe (Y) */
    /* Dadurch "quillt" der Balken sichtbar aus seiner Hülle hervor */
}

/* Stil für die Registerreiter */
.tab {
    width: 100%;
    background-color: white;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Settings Page Styling */
body.settings-page {
    background-color: #2e2e2e; /* Darker background */
    color: #e0e0e0; /* Light text */
}

.settings-section {
    background-color: #3a3a3a; /* Slightly lighter than body background */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    margin-bottom: 20px;
}

.settings-section h1, .settings-section h2 {
    color: #ffffff; /* White headings */
    border-bottom: 1px solid #555; /* Subtle separator */
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.setting-item label {
    color: #cccccc;
}

.setting-item select, .setting-item input[type="color"] {
    background-color: #4a4a4a;
    border: 1px solid #666;
    color: #e0e0e0;
}

.setting-item select option {
    background-color: #4a4a4a;
    color: #e0e0e0;
}

/* Stil für die Registerreiter-Buttons */
.tab-button {
    flex: 1;
    padding: 10px;
    text-align: center;
    background-color: white;
    cursor: pointer;
    height: min-content;
    font-family: "Arial";
    font-size: 0.8em;
    color: var(--primary-color);
    transition: color 0.5s ease;
}

/* Stil für den aktiven Registerreiter */
.tab-button.active {
    position: relative; /* Wichtig, damit das Pseudo-Element relativ dazu positioniert werden kann */
    border-bottom: none; /* Stellen Sie sicher, dass keine andere Unterstreichung stört */
}

.tab-button.active::after {
    content: ''; /* Wichtig, um das Pseudo-Element sichtbar zu machen */
    
    /* Positionierung */
    position: absolute;
    bottom: 0; /* Unten am Button anheften */
    left: 50%; /* Startpunkt in der Mitte */
    transform: translateX(-50%); /* Korrigiert die Position, um es wirklich zu zentrieren */

    /* Größe und Farbe (Ihre gewünschte Optik) */
    width: 30px; /* Breite des orangenen Strichs */
    height: 3px; /* Höhe des orangenen Strichs */
    background-color: var(--primary-color); /* Orange Farbe */
    
    /* Optional: Abrunden der Ecken */
    border-radius: 2px;
    animation: markerPop 0.3s ease-out forwards; /* Name Dauer Timing-Funktion Füllmodus */
    transition: background-color 0.5s ease;
}

/* Stil für den Inhalt der Registerreiter */
.tab-content {
    display: none;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    overflow-y: auto;
}

/* Stil für den aktiven Inhalt */
.active-content {
    display: block;
    background-color: white;
    font-family: "Arial";
    font-size: 0.8em;
    margin: 0.3em;
    /* Important for scrolling: Ensure padding/margin is handled inside the scrolling area */
    box-sizing: border-box; 
    padding: 0;
    
    /* ADDED: Ensure inner content can scroll */
    overflow-y: auto;
}

.tabBar{
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    height: min-content; /*optional, I guess*/
    flex-shrink: 0;
    font-size: 0.8em;
}

.quickStart{
    background-color: var(--primary-color);
    text-align: center;
    height: 2em;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
    margin-top: auto;
    position: relative;
    overflow: hidden;
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

.quickStart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../media/img/bubbles.png');
    background-size: cover;
    opacity: 0.33;
    z-index: 0;
}

.quickStart > i {
    position: relative;
    z-index: 1;
}
.messengerProfile{
    width:48px;
    height: 48px;
    border-radius: 50%;
}

.roomList{
    width:48px;
    height: 48px;
    border-radius: 15px;
}

.username{
    font-weight: bolder;
}

td.username {
    max-width: 15ch; /* Maximale Breite für den Raumnamen (15 Zeichen) */
    overflow: hidden; /* Versteckt den überlaufenden Text */
    text-overflow: ellipsis; /* Zeigt "..." für den überlaufenden Text an */
    white-space: nowrap; /* Verhindert Zeilenumbrüche */
}

td.profilePicture{
    width:50px;
}

td.userLevel{
    width: 27px;
    align-content: center;
}

.userLevelDiv{
    background: purple;
    color: white;
    font-size: 0.7em;
    border-radius: 5px;
    padding: 5px;
}

.roomname{
        /* font-weight: bolder; */
    overflow: hidden;
    width: 150px;
}

.roomstatus{
    font-size: 0.8em;
    /* font-weight: bolder; */
    margin-left: 13px;
    overflow: hidden;
    width: 150px;
}

/* Stil für die Tabelle */
table {
    width: 100%; /* Tabelle nimmt die gesamte Breite ein */
    border-collapse: collapse; /* Verhindert Abstand zwischen den Zellen */
}

thead {
    display: none; /* Versteckt die Spaltenüberschriften (Name, Status, etc.) */
}

/* Stil für die Bilder in den Zellen */
td img.roomList {
    width: 48px; /* Festgelegte Breite auf 48px */
    height: 48px; /* Festgelegte Höhe auf 48px */
    object-fit: cover; /* Skaliert das Bild, um es in die 48x48px-Box passen zu lassen */
    border-radius: 10px; /* Runde Ecken für das Bild */
}

/* Stil für die Zellen mit dem Raumnamen */
td.roomname {
    max-width: 15ch; /* Maximale Breite für den Raumnamen (15 Zeichen) */
    overflow: hidden; /* Versteckt den überlaufenden Text */
    text-overflow: ellipsis; /* Zeigt "..." für den überlaufenden Text an */
    white-space: nowrap; /* Verhindert Zeilenumbrüche */
}

/* Stil für die Zellen mit dem Raumstatus */
td.roomStatus {
    max-width: 150px; /* Maximale Breite für den Raumstatus */
    overflow: hidden; /* Versteckt den überlaufenden Text */
    text-overflow: ellipsis; /* Zeigt "..." für den überlaufenden Text an */
    white-space: nowrap; /* Verhindert Zeilenumbrüche */
    color: grey;
}
td.roomStatus:before{
    content: "";
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 17px;
    margin-left: 0em;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 13px;
    width: 13px;
    left: 4px;
    bottom: 2px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color-light);
    transition: background-color 0.5s ease;
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color-dark);
    transition: box-shadow 0.5s ease;
}

input:checked + .slider:before {
    -webkit-transform: translateX(11px);
    -ms-transform: translateX(11px);
    transform: translateX(11px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}
#loginSubmit{
    border-radius: 5px;
    width: 55%;
    height: 25px;
    border: 0px solid ;
    color: white;
    background-color: var(--primary-color);
    transition: background-color 0.5s ease;
}
#newAccount{
    border-radius: 5px;
    width: 55%;
    height: 25px;
    border: 1px solid var(--primary-color);
    color:var(--primary-color);
    transition: border-color 0.5s ease, color 0.5s ease;
}

.bodyPart{
    align-items: center;
    display:flex;

}

.lowerPart{
    align-items: center;
    display:flex;
}
.message{
    width: 95%;
    margin: auto;
    margin-top: 25px;
    border-radius: 0px;
    display: flex; /* Aktiviert Flexbox für den Container */
    align-items: center; /* Vertikale Ausrichtung der Kinder */
}

.messageHistory {
    width: 95%;
    height: 150px;
    margin: auto;
    background-color: white;
}

.inputMessage{
    border-radius: 10px;
    width: 87%;
    flex: 1; /* Der Textbereich nimmt den verfügbaren Platz ein */
    margin-right: 10px; /* Abstand zwischen Textarea und Button */
}

.from{
    color: red;
}

.messageText{
    color:black;
}

/* Container für jede Nachricht */
.message-entry {
    display: flex;
    margin-bottom: 10px;
    position: relative; /* Für die korrekte Positionierung der Sprechblase */
}

/* Stil für fremde Nachrichten (links) */
.message-entry .message-from {
    background-color: #e0e0e0;
    border-radius: 15px;
    padding: 10px;
    margin-right: auto; /* Schiebt die Nachricht nach links */
    max-width: 70%;
    word-wrap: break-word;
    margin-top: 5px;
    position: relative; /* Für die Sprechblase */
}

.message-entry .message-from::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: #e0e0e0; /* Hintergrundfarbe der Sprechblase */
    border-bottom: 0;
    margin-left: -10px;
    margin-bottom: -10px;
}

.message-entry .message-from::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 18px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top-color: #ccc; /* Schattenfarbe der Sprechblase */
    border-bottom: 0;
    margin-left: -8px;
    margin-bottom: -8px;
}

/* Stil für eigene Nachrichten (rechts) */
.message-entry .message-me {
    background-color: #b3e5fc;
    border-radius: 15px;
    padding: 10px;
    margin-left: auto; /* Schiebt die Nachricht nach rechts */
    max-width: 70%;
    word-wrap: break-word;
    margin-top: 5px;
    position: relative; /* Für die Sprechblase */
}

.message-entry .message-me::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 20px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: #b3e5fc; /* Hintergrundfarbe der Sprechblase */
    border-bottom: 0;
    margin-right: -10px;
    margin-bottom: -10px;
}

.message-entry .message-me::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 18px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top-color: #81d4fa; /* Schattenfarbe der Sprechblase */
    border-bottom: 0;
    margin-right: -8px;
    margin-bottom: -8px;
}

/* Stil für den Nachrichtentext */
.message-entry .message-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* Container für Nachrichtenverlauf */
.message-history {
    width: 95%;
    height: 150px;
    max-height: 150px; /* Maximale Höhe des Containers */
    overflow-y: auto; /* Scrollbalken bei Überlauf */
    padding: 10px;
    background-color: white;
    margin: auto;
    border-radius: 5px;
    border: 1px solid #ccc; /* Für bessere Sichtbarkeit */
}

.messengerTab {
    overflow: hidden;
    background-color: #f1f1f1;
    -webkit-app-region: drag;
}

.messengerTab button {
    background-color: inherit;
    /* border: none; */
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    border-radius: 5px 5px 0px 0px;
    height: 35px;
    border-bottom: -3px;
    padding-top: 0.5em;
}

.messengerTab button.active {      
    background-color: var(--primary-color);
    transition: background-color 0.5s ease;
}

.tabcontent {
    display: none;
    padding: 6px 12px;
    border-top: none;
    font-family: 'Tahoma', Cochin, Georgia, Times, 'Times New Roman', serif
}

.tablinks.active{
    background-color:#ffddbb;
    -webkit-app-region: no-drag
}

.tablinks{
    background-color:#444444;
    -webkit-app-region: no-drag
}

.close-tab {
    color: gray;
    margin-left: 10px;
    cursor: pointer;
}

.close-tab:hover {
    color: red;
}

/** Settings-Page **/

.settings-section {
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            padding: 10px;
            margin-bottom: 20px;
            width: 80%;
        }

.settings-page .settings-section h2{
    font-size: 1em;
    color: var(--primary-color);
    transition: color 0.5s ease;
}

.settings-page .settings-section .setting-item{
    font-size: 1em;
    color: #2e2e2e;
    margin-bottom: 15px;
}
.setting-item{
    padding-left: 5em;
}
.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.setting-item select, .setting-item input[type="color"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* CONTACT LIST STYLES */
.profile-picture-container {
    position: relative;
    width: 48px; /* Match image size */
    height: 48px;
}

.profile-picture {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.status-led {
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;  /* Approx 1/4 of width, so 1/16 of area */
    height: 12px;
    border-radius: 50%;
    border: 2px solid white; /* Helps it stand out */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 7px;
    font-weight: bold;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.status-led span {
    display: none;
    line-height: 1;
}

.status-led.privacy-active span {
    display: block;
}

.status-online {
    background-color: #26d357; /* green */
}

.status-away {
    background-color: #ffc107; /* orange */
}
.status-busy {
    background-color: #f86b6b; /*red */
}

.status-offline {
    background-color: #8e8e8e; /* grey */
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

.modal-content {
    background-color: #fefefe;
    margin: auto; /* Center the modal */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 500px; /* Max width for larger screens */
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    margin-left: 15px;
}

.form-group input[type="password"] {
    width: calc(100% - 20px); /* Adjust for padding */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding in width */
}

.form-actions {
    text-align: right;
    margin-top: 20px;
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-left: 10px;
}

#savePasswordButton {
    background-color: var(--primary-color);
    color: white;
}

#savePasswordButton:hover {
    opacity: 0.9;
}

#cancelPasswordButton {
    background-color: #ccc;
    color: #333;
}

#cancelPasswordButton:hover {
    background-color: #bbb;
}

.error-message {
    color: red;
    text-align: center;
    margin-top: 10px;
}

.success-message {
    color: green;
    text-align: center;
    margin-top: 10px;
}