/* Bestehende Styles ... */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a {
    color: #000;
    font-weight: bold;
}

footer a {
    color: #fff;
}

body, html {
    height: 100%;
    font-family: Calibri, sans-serif;
    overflow: hidden;
}

header, footer {
    background-color: #333;
    color: white;
    padding: 10px 20px;
}

header {
    display: block ruby;
    text-align: center;
    padding: 10px 20px;
    height: 80px;
}

header nav {
  position: static;
}

.new-block-input {
    background: #ffffff;
    border: 1px solid #cecece;
    resize:block;   
}   

textarea {
    background: none;
    border: none;
    resize:none;
}

.content-frame {
    width: 100%;
    min-width: 300px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}


#content .content-frame {
    height: 100vh;
    align-items: normal;
}

.logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.logo img {
  height: 75px;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  margin-left: 10px;
}

.logo-text h1 {
    font-size: 24px;
    cursor: pointer;
}

nav ul {
    list-style: none;
    display: flex;
    position: relative;
}

nav ul li {
    position: relative; /* Positionierung des übergeordneten <li> */
}

.menu-item {
    color: white;
    text-decoration: none;
    cursor: pointer;
    display: block; /* Block-Display für bessere Klickfläche */
    padding: 12px 20px; /* Angepasstes Padding */
}

.dropdown {
    display: none;
    position: absolute;
    background-color: #444;
    list-style: none;
    padding: 10px 0; /* Vertikales Padding für Dropdown-Inhalte */
    border-radius: 0px 0px 5px 5px;
    top: 100%; /* Positionsdropdown direkt unter dem Hauptmenüpunkt */
    left: -15px; /* Links ausgerichtet zum übergeordneten Menüpunkt */
    min-width: 150px; /* Sicherstellt, dass das Dropdown genügend Breite hat */
    z-index: 1000; /* Bringt Dropdown über andere Elemente */
}

.dropdown li a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 8px 20px; /* Mehr Padding für bessere Klickfläche */
}

.dropdown li a:hover {
    background-color: #555;
}

/* Aktualisierte margin-top für den Hauptinhalt */
main {
    background-color: white;
    height: 100vh; /* Vollständige Höhe des Ansichtsfensters */
    position: relative; /* Für die absolute Positionierung der Layers */
    display: block ruby;
    text-align: center;
}

main a {
    text-decoration: underline;
    cursor: pointer;
}

.title-container {
    position: fixed;
    width: 100%;
    background-color: white;
    padding: 10px 20px;
    z-index: 3;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: 40px;
}

.layers-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100% - 140px); /* Höhe abzüglich Header und title-container */
    transform: translateY(0);
    transition: transform 0.8s ease;
}

.layer {
    flex: 0 0 100%;
    width: 100%;
    display: flex; /* Flexbox für den Inhalt */
    flex-direction: column;
    justify-content: flew-start;
    align-items: flex-start; /* Blocks links ausrichten */
    padding: 20px;
    overflow: scroll;
    margin-top: 40px;
}

.layer h2 {
    font-size: 18px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.section {
    width: 100%; /* Sektion nimmt die gesamte verfügbare Breite ein */
    display: flex; /* Flexbox für die Inhalte */
    flex-wrap: wrap; /* Blöcke umbrechen, falls nicht genug Platz vorhanden ist */
    box-sizing: border-box; /* Padding und Border in die Breite einberechnen */
}

.blocks {
    width: 100%; /* Blocks-Container nimmt die gesamte verfügbare Breite ein */
    display: flex; /* Blöcke innerhalb gleichmäßig verteilen */
}

.block {
    min-width: 200px;
}

.editable-block {
    flex: 1 1 200px; /* Flex-Wachstum und -Basis */
    min-width: 200px; /* Mindestbreite für Blocks */
    border: 1px solid #ccc; /* Rahmen für statische Blocks */
    padding: 10px;
    border-radius: 4px;
    background-color: #f9f9f9; /* Hintergrundfarbe für statische Blocks */
}

.editable-block {
    border: 2px dashed #ccc;
    padding: 10px;
    position: relative;
}

.editable-footer {
    width: 40%;
    background: none;
    text-align: center;
    border: 2px dashed gray;
    color: #fff;
}

.new-block-input {
    overflow: auto;
}

.block-image {
    max-width: 600px;
    max-height: 300px;
    width: auto;
    height: auto;
}

.img-edit-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 10px;
}

.img-preview {
    max-width: 200px;
    max-height: 200px;
    margin-bottom: 5px;
}

.alt-text-input {
    width: 100%;
    padding: 5px;
    margin-top: 5px;
}

footer {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    z-index: 4; /* Über den Layers */
}

footer ul {
    display: flex;
    gap: 10px;
    justify-content: center;
    list-style: none;
    margin-bottom: 10px;
}

/* Zusätzliche Styles für sanfte Übergänge */
.layers-container.no-transition {
    transition: none;
}

.add-layer-button {
    font-weight: bold;
    color: green;
    font-size: 18px;
    display: block;
    text-align: center;
    padding: 5px;
}

.add-layer-button:hover {
    color: darkgreen;
}

/* Neue Styles für Edit- und Save-Buttons */
.edit-buttons {
    position: absolute;
    top: 10px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 5; /* Über allem */
}

.edit-buttons button {
    background-color: #555;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.edit-buttons button:hover {
    background-color: #666;
}

/* Styles für das Modal-Fenster */
.modal {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 1001; /* Über allen anderen Elementen */
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.4); /* Schwarzer Hintergrund mit Transparenz */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% von oben und zentriert */
    padding: 20px;
    border: 1px solid #888;
    width: 300px; /* Breite des Modals */
    border-radius: 4px;
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#confirm-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 3px;
    margin-top: 10px;
}

#confirm-button:hover {
    background-color: #45a049;
}

/* Neue Regel für das "+"-Button Border */
#add-subpage-button {
    border: 2px dashed gray; /* Angepasster Border */
}

/* Neue Klasse für editierbare Titel */
.editable-title {
    border: 2px dashed gray; /* Gestrichelter Rahmen */
    padding: 4px;
    font-size: 24px; /* Gleiche Schriftgröße wie h1 */
    width: 100%;
    box-sizing: border-box;
}

header .editable-title,
.editable-slogan {
    background: none;
    color: #fff;
}

/* Neue Klasse für den Platzhalter zum Hinzufügen von Sections */
.add-section-placeholder {
    border: 2px dashed gray; /* Gestrichelter Rahmen */
    padding: 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0; /* Optional: Hintergrundfarbe */
    cursor: pointer; /* Hinweis, dass es klickbar ist */
}

.add-section-placeholder:hover {
    background-color: #e0e0e0; /* Optional: Hover-Effekt */
}

.add-block {
    width: 80px;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    transition: 0.2s;
}

.add-block:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.delete-block, .delete-layer-button {
   padding: 2px;
   font-size: 20px;
}

/* Styling für die Benachrichtigungen */
.notification-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4CAF50; /* Grüner Hintergrund */
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 1002;
    opacity: 1;
    font-family: Calibri, sans-serif;
    font-size: 14px;
    transition: opacity 0.5s ease-in-out;
}

.settings-menu {
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
}

.settings-menu label {
    font-weight: bold;
    margin-right: 5px;
}

.menu-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compact-menu {
    display: flex;
    gap: 5px;
}

.menu-icon {
    border: none;
    background-color: #f1f1f1;
    padding: 2px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.menu-icon:hover {
    background-color: #ddd;
}

.context-menu {
    position: absolute;
    background-color: white;
    border: 1px solid #ccc;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.context-menu .menu-label {
    font-weight: bold;
    margin-bottom: 5px;
}


.style-mode .block {
    cursor: pointer;
    outline: 2px dashed #007BFF; /* Blaue gestrichelte Umrandung */
    transition: outline 0.2s ease-in-out;
}


/* Popup-Styling */
.style-popup {
    position: fixed;
    background-color: #fff;
    border-radius: 5px;
    border: 2px solid #ccc;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.style-popup input {
    text-align: right;
    width: 80px;
    height: 20px;
}

.style-popup h3 {
    margin: 10px; 
}

/* Steuerleiste für Drag & Schließen */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ddd;
    padding: 5px;
    cursor: grab;
    border-bottom: 2px solid #ccc;
    height: 36px;
}

/* Schließen-Button */
.popup-header .close-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    top: 5px;
    right: 10px;
}

.popup-header .close-button:hover {
    color: red;
}

/* Erste Zeile im Pop-up (3 Spalten) */
.font-row, .row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 10px;
}

/* Container für die Schriften & Einstellungen */
.font-list-container, .font-settings-container {
    flex: 1;
    min-height: 150px;
    border: 2px dashed #bbb;
    padding: 10px;
    background: #f9f9f9;
}

/* Die Buttons für die Schriften */
.font-button {
    display: block;
    width: 100%;
    padding: 5px;
    background: #e0e0e0;
    border: 1px solid #bbb;
    cursor: grab;
    margin-bottom: 5px;
}

.font-button:active {
    cursor: grabbing;
}

/* Optionale Einstellungen (wie Schriftgröße & Farbe) */
.font-settings-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.font-settings-container .option-group {
    width: 100%;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: none;
}

.font-settings-container .option-group input {
    width: 50px;
}

.option-group {
    width: 50%;
    min-height: 150px;
    border: 2px dashed #bbb;
    padding: 10px;
    background: #f9f9f9;
}

/* Container für einzelne Einstellungen */
.option-container {
    position: relative; /* Stellt sicher, dass das ausgeklappte Menü innerhalb bleibt */
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

/* Label für die Optionen */
.option-container label {
    font-weight: bold;
    flex: 1;
}

/* Inputs für Farben & Texte */
.option-container input {
    border-radius: 15px;
}

.expanded-options {
    position: absolute;
    left: 0;
    top: 100%;
    border: 2px dashed #ccc;
    border-top: none;
    padding: 0px;
    width: 100%;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    z-index: 10;
    align-items: center;
    background: #f9f9f9;
    text-align: right;
}

.expanded-options.active {
    max-height: 150px; /* Genug Platz für Inhalte */
}

.expanded-options input, .expanded-options select {
    margin: 5px;
}

.border-container {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    border: none;
}

.border-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.pixel-options {
    width: 75px;
}

.font-family-container {
    display: flex;
    flex: 2;
    gap: 10px;
}

.border-options {
    display: flex;
    gap: 5px;
}

.font-size-container {
    display: flex;
    align-items: center;
    gap: 5px; /* Abstand zwischen Input und Einheit */
}

.font-size-input {
    width: 65px;
    height: 28px;
    text-align: center;
    font-size: 14px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.font-size-unit {
    height: 28px; /* Gleiche Höhe wie Buttons */
    font-size: 14px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
}

.style-buttons-container {
    display: flex;
    gap: 3px; /* Abstand zwischen Buttons */
    margin-left: 3px;
}

.style-toggle {
    width: 28px; /* Einheitliche Breite wie andere Icon-Buttons */
    height: 28px;
    border: 1px solid #ccc;
    background-color: #f1f1f1;
    padding: 2px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
}

.style-toggle.active {
    background-color: #bbb;
    font-weight: bold;
}

.style-toggle:hover {
    background-color: #ddd;
}

.border-options {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    padding: 5px;
}

.border-width-input {
    width: 50px;
    text-align: center;
    font-size: 14px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.border-color {
    border: none;
    cursor: pointer;
}

.new-block-input {
    width: 100%;
    height: 28px;
    margin-top: 5px;
}

.input-container {
    display: flex;
    gap: 5px; /* Abstand zwischen Select und Input */
    align-items: center;
}

.block-type-select {
    height: 30px;
    font-size: 14px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
}

.contact-link,
.description {
    font-size: 0.9em !important;
}

.settings-container {
    margin-bottom: 5px; /* Abstand zum Eingabefeld */
}

.input-container select {
    height: 30px;
    font-size: 14px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
}

.input-container input, 
.input-container textarea {
    flex-grow: 1;
}

.image-upload-container {
    width: 100%;
    height: 150px;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    margin-bottom: 10px;
}

.image-upload-container.drag-over {
    border-color: #333;
    background-color: rgba(0, 0, 0, 0.1);
}

.image-preview {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

.image-display {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Mobile Menü-Styles */
.mobile-menu {
  position: fixed;
  top: 80px;
  left: 0;
  width: 100vw;
  background: #fff;
  z-index: 1000;
  overflow-y: auto;
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu-main {
  list-style: none;
  padding: 0;
  text-align: left;
}

.mobile-menu-item {
    margin: 0px 0;
    font-size: 1.4em;
    cursor: pointer;
    border-top: 1px solid #c8c8c8;
    padding: 6px 0;
}

.subpage-title,
.close-menu {
    padding: 4px 20px;
}

.mobile-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    text-align: center;
    transition: max-height 0.3s ease;
}

/* Wenn das Submenü geöffnet ist */
.mobile-submenu.open {
  max-height: 500px; /* Stelle sicher, dass dieser Wert groß genug ist */
}

.mobile-submenu-item {
  margin: 0;
  font-size: 0.9em;
  cursor: pointer;
  font-weight: bold;
  padding: 6px;
  border-top: 1px dashed #e1f0ff;
}

.mobile-submenu-item:hover {
    background-color: #ccdbe9;
    font-weight: bold;
}

.mobile-menu-item:hover {
    background-color: #e1f0ff;
}

.mobile-menu-item.active > .mobile-submenu {
  display: block;
}

.burger-button {
  display: none;
  font-size: 2em;
  background: none;
  border: none;
  cursor: pointer;
  margin: 10px;
}


@media (max-width: 900px) {

    .blocks {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .block {
        min-width: 200px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .layer h2 {
        align-self: center;
    }

    #content {
        overflow: auto;
    }

    .burger-button { display: block; }
}

