:root {
    --bg-main: #0b132b;
    --bg-card: #1c2541;
    --bg-header: #0b132b;
    --accent: #48cae4;
    --accent-hover: #90e0ef;
    --text-primary: #ffffff;
    --text-secondary: #00b4d8;
    --border-color: #3a506b;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size: 16px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Nav */
.app-header {
    background-color: rgba(11, 19, 43, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.brand-logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.brand-logo-dev {
    font-size: 1.55rem;
    font-weight: 500;
}

.brand-logo span {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

/* Sprachwechsler */
.lang-switch a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.lang-switch a.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.lang-switch .divider {
    color: var(--border-color);
    margin: 0 4px;
}

/* Button Styling */
.btn {
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline {
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background-color: var(--accent);
    color: var(--bg-main);
}

/* Main Content */
.app-main {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 2rem;
    overflow: auto;
    margin-bottom: 20px;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

#smartphone-hint {
  display: none;
  margin-bottom: 30px;
}

.content-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.main-content {
  /* flex: 1 0 auto; */
  overflow: auto;
  border-radius: 8px;
  min-height: 300px;
}

/* Footer */
.app-footer {
    /* flex-shrink: 0; */
    background-color: var(--bg-header);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Mobile Toggle Hamburger Button */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
}

/* Responsiveness (Smartphones / Tablets) */
@media (max-width: 768px) {
    #smartphone-hint {
        display: block;
    }
    
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--bg-main);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1.5rem;
        display: none; /* Per JS getoggelt */
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    footer {
      /* display: none; */
    }
}

/* Primär-Button */
.btn-primary {
    background-color: var(--accent);
    color: var(--bg-main);
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Auth Cards & Formulare */
.auth-card {
    max-width: 420px;
    margin: 2rem auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.auth-card h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}





.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}




form.property-dialog-form input:not([type="color"]):not([type="checkbox"]) {
  background-color: white;
  height: 37px;
  border: 1px solid #000;
  color: #000;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

form.property-dialog-form input[type="color"] {
  background-color: white;
  height: 37px;
  border: 1px solid #000;
  color: #000;
  padding: 0;
}

form.property-dialog-form select {
  background-color: white;
  height: 37px;
  border: 1px solid #000;
  color: #000;
  padding: 8px 12px;
  font-size: 0.9rem;
}

form.property-dialog-form label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}


#tab-1 {
  overflow: auto;
  padding-right: 10px;
  padding-left: 10px;
}

#tab-3 {
  overflow: auto;
  padding-right: 10px;
  padding-left: 10px;
}




.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Alerts & User Badge */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.15);
    border: 1px solid #22c55e;
    color: #86efac;
}

.user-badge {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.user-badge strong {
    color: var(--accent);
}

/* ==========================================================================
   Dashboard / 3-Spalten Layout (Gleiche Höhe für alle Spalten)
   ========================================================================== */

.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 1.5rem;
    align-items: stretch;
    width: 100%;
    height: 100px;
    
    /* 
       Höhe an das Fenster anpassen: 
       100vh minus ca. 120px für Navigation/Header, Margins & Footer.
       Passe die '120px' genau an die Höhe deines Headers/Footers an!
    height: calc(100vh - 220px);
    */
        
    /* min-height: 500px; /* Sicherung für sehr kleine Bildschirmhöhen */
    
    box-sizing: border-box;
}

/* Karten-Container im Dashboard */
.dash-card {
    background: #ffffff;
	color: #000000;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dash-col {
  height: calc(100vh - 200px);
}

/* --- Linke Spalte (Flexibles 2er-Gespann) --- */
.dash-col-left {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Obere Karte: Begrenzt auf max. 2/3 der Viewport-Höhe */
.dash-left-top {
    height: 60%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Verhindert das Ausbrechen von Abständen */
    flex: 1;
}

.dash-left-top h3 {
    margin-bottom: 0.5rem;
    flex-shrink: 0; /* Überschrift bleibt beim Scrollen immer oben stehen */
}

/* Der scrollbare Bereich innerhalb der oberen Karte */
.treeview-container {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 0.25rem; /* Platz für die Scrollbar */
}

/* Untere Karte: Füllt den restlichen verfügbaren Platz aus */
.dash-left-bottom {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}




.dash-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
}

.dash-list li {
    margin-bottom: 0.5rem;
}

.dash-list a {
    color: #2b6cb0;
    text-decoration: none;
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.dash-list a:hover {
    background-color: #edf2f7;
}

.dash-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* margin-top: 20px;  */
}

/* --- Mittlere Spalte --- */
.dash-col-center {

}

.dash-center-content {
    height: 100%;
    /* min-height: 100%;  */
}

/* --- Rechte Spalte & Tabs --- */
.dash-col-right {

}

.dash-right-content {
    height: 100%; /* Bezieht volle Höhe der Spalte */
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.tab-header {
    display: flow;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #2d3748;
}

.tab-btn.active {
    color: #3182ce;
    border-bottom-color: #3182ce;
}

.tab-body {
    flex: 1; /* Füllt den verbleibenden vertikalen Platz in der rechten Karte aus */
    height: 100px;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}

#media-tab-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#media-tree-container {
  overflow: auto;
}

/* Responsive Anpassung für mobile Bildschirme */
@media (max-width: 992px) {
    .dashboard-layout {
        grid-template-columns: 1fr; /* Untereinander auf Smartphones & Tablets */
        align-items: start;
    }
    footer {
      /* display: none; */
    }
}

/* ==========================================================================
   Baumstruktur / Treeview (Links Oben)
   ========================================================================== */

.treeview, .tree-sub {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.treeview {
    margin-top: 0.75rem;
}

.tree-node {
    margin-bottom: 0.25rem;
}

/* Hauptknoten / Ebene 1 */
.tree-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
    transition: background-color 0.2s ease;
}

.tree-label:hover {
    background-color: #edf2f7;
    color: #2b6cb0;
}

.tree-toggle-icon {
    font-size: 0.7rem;
    width: 12px;
    display: inline-block;
    transition: transform 0.2s ease;
    color: #718096;
}

/* Unterebene / Ebene 2 */
.tree-sub {
    padding-left: 1.25rem; /* Einrückung für die Kinder */
    display: none; /* Standardmäßig zugeklappt */
}

/* Geöffneter Zustand */
.tree-node.open > .tree-sub {
    display: block;
}

/* Untereinträge / Links */
.tree-item {
    display: block;
    /* padding: 0.3rem 0.5rem; */
    font-size: 0.9rem;
    color: #4a5568;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tree-item:hover {
    background-color: #e2e8f0;
    color: #2b6cb0;
}

.drag-tree-item:hover {
    cursor: move
}

.tree-item.active {
    background-color: #ebf8ff;
    color: #2b6cb0;
    font-weight: 600;
}

/* ==========================================================================
   Treeview / Baumstruktur & Aktions-Buttons Styling
   ========================================================================== */

/* Header der Karte (Überschrift + "+ Projekt"-Button) */
.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #edf2f7;
}

.dash-card-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #2d3748;
}

/* Primary "+ Projekt"-Button */
.btn-icon-add {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background-color: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #bee3f8;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-icon-add:hover {
    background-color: #3182ce;
    border-color: #3182ce;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(49, 130, 206, 0.2);
}

.tree-title {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Aktions-Button Container (Standardmäßig ausgeblendet) */
.tree-actions {
    display: none;
    align-items: center;
    gap: 0.15rem;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

/* Item-Layouts für Ausrichtung der Aktions-Buttons */
.tree-label, 
.tree-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

/* !!! */
.tree-label .tree-actions-media,
.tree-item-wrapper .tree-actions-media {
    display: flex;
}

/* Einblenden beim Darüberfahren (Hover) */
.tree-label:hover .tree-actions,
.tree-item-wrapper:hover .tree-actions {
    display: flex;
}

/* Aktiver Zustand der ausgewählten Seite */
.tree-item-wrapper.active {
    background-color: #ebf8ff;
    border-left: 3px solid #3182ce;
}

.tree-item-wrapper.active .tree-item {
    color: #2b6cb0;
    font-weight: 600;
}

/* Einzeltasten für Aktionen (＋, ✎, 🗑) */
.btn-tree-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    color: #718096;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

/* Hover-Zustand für neutrale Aktionen (Hinzufügen / Bearbeiten) */
.btn-tree-action:hover {
    background-color: #e2e8f0;
    color: #2b6cb0;
}

/* Hover-Zustand für Löschen (Gefahrenbereich) */
.btn-tree-action.btn-danger-action:hover {
    background-color: #fed7d7;
    color: #e53e3e;
}

/* Barrierefreie Fokus-Zustände */
.btn-tree-action:focus-visible,
.btn-icon-add:focus-visible {
    outline: 2px solid #3182ce;
    outline-offset: 1px;
}

/* ==========================================================================
   Custom Modal / Prompt Styling
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px); /* Eleganter Unschärfe-Effekt */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-container {
    background: #ffffff;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: modalSlideDown 0.2s ease-out;
}

@keyframes modalSlideDown {
    from { transform: translateY(-15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #edf2f7;
}

.modal-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #2d3748;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #a0aec0;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: #4a5568;
}

.modal-body {
    padding: 1.25rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #4a5568;
}

.modal-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.modal-input:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: #f7fafc;
    border-top: 1px solid #edf2f7;
}

.btn2 {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn2-secondary {
    background-color: #edf2f7;
    color: #4a5568;
}

.btn2-secondary:hover {
    background-color: #e2e8f0;
}

.btn2-primary {
    background-color: #3182ce;
    color: #ffffff;
}

.btn2-primary:hover {
    background-color: #2b6cb0;
}

/* ==========================================================================
   Custom Alert Ergänzungen
   ========================================================================== */

.modal-message {
    margin: 0;
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Modal Variant: Error / Danger */
.modal-overlay.alert-error .modal-header {
    border-bottom: 2px solid #feb2b2;
    background-color: #fff5f5;
}
.modal-overlay.alert-error #customAlertTitle {
    color: #c53030;
}
.modal-overlay.alert-error .btn-primary {
    background-color: #e53e3e;
}
.modal-overlay.alert-error .btn-primary:hover {
    background-color: #c53030;
}

/* Modal Variant: Success */
.modal-overlay.alert-success .modal-header {
    border-bottom: 2px solid #9ae6b4;
    background-color: #f0fff4;
}
.modal-overlay.alert-success #customAlertTitle {
    color: #276749;
}
.modal-overlay.alert-success .btn-primary {
    background-color: #38a169;
}
.modal-overlay.alert-success .btn-primary:hover {
    background-color: #2f855a;
}






/* ==========================================================================
   Custom Confirm Ergänzungen
   ========================================================================== */

/* Danger-Button für kritische Aktionen (z. B. Löschen) */
.btn-confirm {
    background-color: #e53e3e;
    color: #ffffff;
}

.btn-confirm:hover {
    background-color: #c53030;
}

/* Modal Variant: Confirm Danger / Warning Header Accent */
.modal-overlay.confirm-danger .modal-header {
    border-bottom: 2px solid #feb2b2;
    background-color: #fff5f5;
}

.modal-overlay.confirm-danger #customConfirmTitle {
    color: #c53030;
}



.upload-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-wrapper {
    position: relative;
    flex: 1;
    max-width: 250px;
    height: 20px;
    background-color: #edf2f7;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #cbd5e0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3182ce 0%, #2b6cb0 100%);
    transition: width 0.15s ease-in-out;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: #2d3748;
}

.progress-wrapper.hidden {
    display: none;
}



.drag-element {
  margin-top: 8px;
  border: 1px solid #dfc1c1;
  border-radius: 8px;
  padding: 4px;
  cursor: grabbing;
}

.elements-container {
  margin-bottom: 20px;
}



.dialog-input-text {
  background-color: #fff !important;
  color: #000 !important;
  padding: 8px !important;
}


/* --- Layout Gesamt-Container --- */
.public-app-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- Header --- */
.public-app-header {
    /* height: 100px; */
    background-color: #1e293b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}

.public-app-header .public-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #38bdf8;
}

.public-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

/* --- Mittlerer App-Body (Sidebars + Content) --- */
.public-app-body {
    display: flex;
    flex: 1;
    overflow: hidden; /* Verhindert das Ausbrechen des Containers */
}

/* --- Allgemein Sidebars --- */
.public-sidebar {
    width: 200px;
    background-color: #ffffff;
    border-color: #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.public-sidebar-left {
    border-right: 1px solid #e2e8f0;
}

.public-sidebar-right {
    border-left: 1px solid #e2e8f0;
}

.public-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.public-sidebar-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.public-sidebar-content {
    /* padding: 1rem; */
    overflow-y: auto;
    flex: 1;
}

/* --- Hauptinhalt (Main Content) --- */
.public-app-content {
    flex: 1;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.public-content-header {
    padding: 1.5rem;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.public-content-body {
    /* padding: 1.5rem; */
    flex: 1;
}

/* --- Footer --- */
.public-app-footer {
    /* height: 100px; */
    background-color: #1e293b;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    font-size: 0.8rem;
    border-top: 1px solid #334155;
    flex-shrink: 0;
}

/* --- Hilfsklassen & Komponenten --- */
.public-text-muted {
    color: #94a3b8;
    font-size: 0.875rem;
}

.public-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    background-color: #0ea5e9;
    color: white;
    transition: background-color 0.2s;
}

.public-btn:hover {
    background-color: #0284c7;
}

.public-btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.drag-over {
  border: 3px solid red;
}

.dropzone {
}

/* Verhindert, dass Kind-Elemente Drag-Events abfangen oder auslösen */
body.is-dragging .dropzone * {
    pointer-events: none;
}



/* Haupt-Container */
.card-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background-color: #ffffff;
  width: 100%;
  /* max-width: 400px; */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  /* margin: 1px; */
}

/* Reihe 1: Action-Buttons rechtsbündig ausrichten */
.card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* Styling der Icon-Buttons */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* Löschen-Button farblich hervorheben */
.action-btn-danger:hover {
  background-color: #fef2f2;
  color: #ef4444;
}

.action-btn-drag {
  /* Der 'grab' Cursor signalisiert, dass das Element gezogen werden kann */
  cursor: move;
  color: #94a3b8; /* Etwas dezenter als die Aktions-Icons */
}

/* Während des Ziehens (optionales Styling für das Icon selbst) */
.action-btn-drag:active {
  cursor: grabbing;
}

/* Reihe 2: Inhalt füllt die volle Breite aus */
.card-content {
  width: 100%;
}

.card-content textarea,
.card-content input,
.card-content select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background-color: transparent;
}

.card-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
}




/* Transparenz der Karte, die gerade gezogen wird */
.card-item.is-dragging {
  opacity: 0.4;
}

/* Visuelle Einfüge-Linie oben oder unten */
.card-item.drag-over-above {
  border-top: 3px solid #ff0000 !important; /* Linie oben */
}

.card-item.drag-over-below {
  border-bottom: 3px solid #ff0000 !important; /* Linie unten */
}


.dummy {
  padding: 20px;
}






/* Dialog Backdrop & Container Styling */
.property-dialog {
  /* 1. Aufhebung von Browser-Defaults */
  margin: auto; /* Zentriert das Element horizontal und vertikal im Viewport */
  border: none;
  border-radius: 8px;
  padding: 0;
  
  /* 2. Abmessungen */
  width: 90%;
  max-width: 500px;
  max-height: 90vh; /* Verhindert, dass der Dialog höher als der Bildschirm wird */
  
  /* 3. Shadow & Hintergrund */
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  background-color: #ffffff;
}

/* Optional: Verhindert ungewolltes Scrollen der gesamten Seite bei geöffnetem Dialog */
body:has(dialog[open]) {
  overflow: hidden;
}

.property-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.property-dialog-container {
  display: flex;
  flex-direction: column;
}

.property-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.property-dialog-header h3 {
  margin: 0;
  font-size: 1.125rem;
}

.dialog-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
}

.property-dialog-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Form-Elemente innerhalb des Body */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 0.875rem;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.property-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  background-color: #f8fafc;
}




.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="color"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

/* Chrome / Edge Inner Patch */
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

/* Firefox Inner Patch */
input[type="color"]::-moz-color-swatch {
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

input[type="number"] {
  background-color: #ffffff;
  color: #000000;
  height: 37px;
}


#page {
  padding: 4px;
}


.projectProps {
  /* 1. Standard-Button-Styles entfernen */
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit; /* Übernimmt Schriftart & -größe vom Eltern-Element */
  
  /* 2. Link-Optik anwenden */
  color: black;
  text-decoration: underline;
  text-decoration-thickness: 1px; 
  /* text-underline-offset: 3px; */
  cursor: pointer;
  display: inline;               /* Reagiert im Fließtext wie ein normales <a>-Tag */
}

/* Optional: Interaktion bei Hover/Focus */
.projectProps:hover {
  color: darkred;
}

.projectProps:focus-visible {
  outline: 2px solid red;
  outline-offset: 2px;
}






/* Optional: Elegante, schlanke Scrollbar für die Baumstruktur */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}








.register {
  color: #cbc6c6;
}


.monospace {
  font-family: monospace;
}

.prop-style {
  width: 100% !important; 
  min-height: 80px !important;
  height: 80px;
  padding: 8px 12px;
  border: 1px solid rgb(203, 213, 225);
  border-radius: 4px;
  box-sizing: border-box;
  min-width: 100% !important;
}

.new-element {
  /* border: 2px dashed #48cae4; */
}




trix-editor {
    min-height: 200px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 12px;
}

/* Toolbar-Buttons leicht anpassen */
.trix-button-row {
    background-color: #f5f5f5;
    padding: 5px;
    border-radius: 4px 4px 0 0;
    border: 1px solid #ccc;
    border-bottom: none;
}

/* Fix für den "Quote" (Zitat) Button */
trix-editor blockquote, 
.trix-content blockquote {
    border-left: 4px solid #ccc !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 1rem !important;
    color: #555 !important;
    font-style: italic !important;
}

/* Fix für den "Indent" (Einrücken) Button bei Listen */
trix-editor ul, 
.trix-content ul {
    list-style-type: disc !important;
    margin-left: 1.5rem !important;
}

trix-editor ol, 
.trix-content ol {
    list-style-type: decimal !important;
    margin-left: 1.5rem !important;
}

/* Fix für tiefere Verschachtelungen (Mehrfaches Einrücken) */
trix-editor ul ul, 
trix-editor ol ul,
.trix-content ul ul,
.trix-content ol ul {
    list-style-type: circle !important;
    margin-left: 1.5rem !important;
}
        
        
        
        
/* Bilder im Editor auf maximal 50% der Breite begrenzen und zentrieren */
trix-editor figure img,
.trix-content figure img {
    /* max-width: 50% !important; */
    /* height: auto !important; */
    /* display: block; */
    /* margin: 10px auto !important; */
}

figure.attachment {
    max-width: 40% !important;
    height: auto !important;
    display: inline-block;
    vertical-align: middle;
}




trix-toolbar .trix-button-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	overflow-x: auto;
}

figcaption.attachment__caption {
  display: none;
}

/* Ausrichtung direkt im Trix-Editor sichtbar machen */
trix-editor .text-center {
    text-align: center !important;
}

trix-editor .text-right {
    text-align: right !important;
}

/* WICHTIG: Auch für die spätere HTML-Ausgabe auf deiner PHP-Webseite bereitstellen */
.trix-content .text-center {
    text-align: center !important;
}

.trix-content .text-right {
    text-align: right !important;
}


/* Erlaubt dem Unterstreichen-Button das Anzeigen des SVG-Icons */
trix-toolbar .trix-button[data-trix-attribute="underline"] {
    text-indent: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

trix-toolbar .trix-button[data-trix-attribute="underline"]::before {
    display: none !important; /* Entfernt das leere Trix-Standardbild */
}

/* Stil für den aktiven/gedrückten Zustand des Buttons */
trix-toolbar .trix-button[data-trix-attribute="underline"].trix-active {
    background-color: #e2e8f0 !important; /* Passt sich dezent an */
}


/* Container für die Farbpunkte leicht abgrenzen */
trix-toolbar .trix-color-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 4px;
    padding: 0 4px;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
}

/* Grundstyling für die Farbpunkte */
trix-toolbar .trix-button.color-btn {
    text-indent: 0 !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    border-radius: 50% !important; /* Macht die Buttons kreisrund */
    margin: auto 2px !important;
    padding: 0 !important;
    background-color: var(--btn-color) !important; /* Holt sich die Farbe aus dem HTML-Style */
    border: 2px solid transparent !important;
    transition: transform 0.1s ease, border-color 0.1s ease;
    cursor: pointer;
}

trix-toolbar .trix-button.color-btn::before {
    display: none !important; /* Trix-Standard-Icon ausblenden */
}

/* Hover-Effekt */
trix-toolbar .trix-button.color-btn:hover {
    transform: scale(1.15);
    border-color: #aaa !important;
}

/* Aktive/Ausgewählte Farbe markieren */
trix-toolbar .trix-button.color-btn.trix-active {
    border-color: #000000 !important; /* Schwarzer Rahmen um die aktive Farbe */
    box-shadow: 0 0 0 1px #ffffff, 0 0 4px rgba(0,0,0,0.3);
    transform: scale(1.1);
}





/* Verhindert, dass das Trix-CSS den H2/H3-Text versteckt */
trix-toolbar .trix-button.text-btn {
    text-indent: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* Erlaubt dem Tabellen-Button sein SVG anzuzeigen */
trix-toolbar .trix-button[data-custom-action="insertTable"] {
    text-indent: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}
trix-toolbar .trix-button[data-custom-action="insertTable"]::before {
    display: none !important;
}

/* --- Tabellen-Styling für den Editor UND die produktive Ausgabe (.trix-content) --- */
trix-editor table,
.trix-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 15px 0 !important;
}

trix-editor th, trix-editor td,
.trix-content th, .trix-content td {
    border: 1px solid #cbd5e1 !important;
    padding: 8px 12px !important;
    text-align: left;
}

trix-editor th,
.trix-content th {
    background-color: #f8fafc !important;
    font-weight: bold;
}






/* WICHTIG: Begrenze die Höhe des Editors, falls gewünscht */
.quill-wrapper {
    height: 200px;
    background: #fff;
}

.ql-editor {
  min-height: 100px !important;
  max-height: 500px !important;
  padding: 0px !important;
  white-space: normal !important;
  word-wrap: normal;
  /* overflow: hidden !important; */
}

.ql-container.ql-snow, 
.ql-editor, 
.ql-editor * {
    font-family: inherit !important;
}

.ql-toolbar {
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
  background-color: #ffffff !important;
}


.ql-editor img {
  max-width: min(800px, 100%);
  height: auto;
  display: inline-block;
  vertical-align: middle;
  border-radius: 8px;
}

/* Findet deinen Custom-Button in der Toolbar und fügt das Symbol ein */
.ql-toolbar .ql-divider::before {
  content: "―";
  font-weight: bold;
  font-size: 14px;
  color: #444; /* Farbe des Icons */
  display: block;
  text-align: center;
  line-height: 24px; /* Zentriert das Symbol vertikal */
}

/* Optional: Ändert die Farbe, wenn man mit der Maus darüber fährt */
.ql-toolbar .ql-divider:hover::before {
  color: #06c; 
}

/* Styling für deine Linie */
.ql-editor hr {
  border: none;
  border-top: 2px solid currentColor;
  margin: 15px 0;
}

.ql-editor {
  caret-color: currentColor !important;
  caret-shape: block !important; 
}

/* Erzeugt ein sauberes Tabellen-Symbol (Raster) in der Menüleiste */
.ql-toolbar .ql-table-menu::before {
  content: "⊞";
  font-weight: bold;
  font-size: 16px;
  display: block;
  text-align: center;
  line-height: 24px;
  color: #444;
}

.ql-toolbar .ql-table-menu:hover::before {
  color: #06c; /* Hover-Effekt wie bei den anderen Icons */
}


.ql-editor table {
  width: 100%;
  border-collapse: collapse;
  margin: 0px;
  border: 1px solid #ccc;
}
.ql-editor table td, 
.ql-editor table th {
  width: 50%;
  padding: 10px;
  border: 1px solid #ccc;
  vertical-align: top;
  min-height: 40px; /* Garantiert, dass die Zelle auch leer sichtbar bleibt */
}
.ql-editor table th {
  outline: 1px dashed #0066cc;
  background-color: rgba(0, 102, 204, 0.02);
}

.ql-editor table td span,
.ql-editor table td strong {
  display: block;
  /* max-width: 300px; */
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #cbcccd;
}

.ql-editor table td span:not(:first-child),
.ql-editor table td strong:not(:first-child) {
  margin-top: 20px;
}

.ql-editor table td span:not(:last-child),
.ql-editor table td strong:not(:last-child) {
  margin-bottom: 20px;
}



/* Zeigt die Textbeschriftungen im Dropdown-Menü an */
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="12px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12px"]::before { content: '12px'; }

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before { content: '14px'; }

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="16px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16px"]::before { content: '16px'; }

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="18px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18px"]::before { content: '18px'; }

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="24px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24px"]::before { content: '24px'; }

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="32px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="32px"]::before { content: '32px'; }

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="40px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="40px"]::before { content: '40px'; }

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="60px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="60px"]::before { content: '60px'; }

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="80px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="80px"]::before { content: '80px'; }





.dialog-accordion-container {
  white-space: nowrap;
}

.dialog-tab-content-item ul {
  padding-left: 1.5rem; 
  margin: 10px 0;
}

.dialog-tab-content-item ul li::marker { 
  content: "⬥"; 
  color: #000; 
  font-size: 0.75rem; 
}

.dialog-tab-content-item ul li { 
  padding-left: 0.3rem; 
  margin-bottom: 5px; 
}
    
table.my-prop-infos {
  width: 100%;
  border-collapse: collapse;
}

th.my-prop-infos {
  padding: 4px;
  font-weight: bold;
  text-align: left;
}

td.my-prop-infos {
  padding: 4px;
}




/* Button komplett als Link stylen */
.copy-link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #2563eb; /* Klassisches Link-Blau */
  text-decoration: underline; /* Unterstreichung */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.2s ease;
  transform: translateY(2px);
}

/* Hover-Effekt */
.copy-link-btn:hover {
  color: #1d4ed8;
}

/* SVG Icon Feinanpassung */
.copy-link-btn svg {
  width: 16px;
  height: 16px;
  display: inline-block;
  text-decoration: none;
}

/* Styling für den erfolgreichen Kopier-Zustand */
.copy-link-btn.success {
  color: #16a34a; /* Wechselt zu Grün */
}






/* Container, der Input und Button zusammenhält */
.search-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: 400px; /* Maximale Breite des Suchfelds */
}

/* Das Texteingabefeld */
.search-input {
  width: 100%;
  padding: 5px 45px 5px 15px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.3s ease;
}

/* Fokus-Effekt für das Eingabefeld */
.search-input:focus {
  border-color: #007bff; /* Blau bei Klick/Fokus */
}

/* Der Lupen-Button */
.search-button {
  position: absolute;
  right: 5px; /* Abstand zum rechten Rand */
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

/* Hover-Effekt für den Button */
.search-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Styling für das SVG-Icon */
.search-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #666; /* Farbe der Lupe */
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

/* Wenn das Input-Feld fokussiert ist, färbt sich auch die Lupe blau */
.search-input:focus + .search-button svg {
  stroke: #007bff;
}






.table-controls-panel {
  background-color: #f7f9fa;
  border: 1px solid #ccc;
  border-bottom: none;
  padding: 6px 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  gap: 15px;
  align-items: center;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-group:not(:last-child) {
  margin-bottom: 8px; 
}

.group-label {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  color: #666;
  margin-right: 4px;
  min-width: 60px;
}

.table-action-btn {
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease-in-out;
}

.table-action-btn:hover {
  background: #eef2f5;
  border-color: #999;
}

/* Spezial-Styling für Löschen-Aktionen */
.delete-btn {
  color: #c0392b;
}
.delete-btn:hover {
  background: #fdeadc;
  border-color: #e0b1b1;
}

/* Großer Gefahren-Button */
.danger-btn {
  background: #fff5f5;
  color: #e74c3c;
  border-color: #f5c6cb;
  font-weight: 500;
}
.danger-btn:hover {
  background: #e74c3c;
  color: #ffffff;
  border-color: #e74c3c;
}

#editor-container {
  border: 1px solid #ccc;
  height: 350px;
}

.editor-container {
  margin-bottom: 50px;
}








