/**
 * Editor CSS - Inline Editor UI styles
 * Universal Onepager Editor
 */

/* Edit Button in Footer */
.edit-trigger {
    display: inline-block;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.5);
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.edit-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    border-color: var(--color-secondary);
}

/* Edit Mode Banner */
.edit-mode-banner {
    display: none;
    position: fixed;
    top: 74px;
    left: 0;
    right: 0;
    background: var(--color-secondary);
    color: white;
    text-align: center;
    padding: 0.6rem 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.edit-mode .edit-mode-banner {
    display: block;
}

body.edit-mode section {
    scroll-margin-top: 120px;
}

/* Editable Elements */
body.edit-mode [data-editable] {
    outline: 2px dashed transparent;
    outline-offset: 4px;
    transition: outline-color 0.2s, background-color 0.2s;
    cursor: text;
    min-height: 1em;
}

body.edit-mode [data-editable]:hover {
    outline-color: var(--color-primary);
    background-color: rgba(0, 128, 200, 0.05);
}

body.edit-mode [data-editable]:focus {
    outline: 3px solid var(--color-secondary);
    outline-offset: 4px;
    background-color: rgba(162, 197, 22, 0.1);
}

/* Geänderte Felder hervorheben (Textmarker-Effekt) */
body.edit-mode [data-editable].modified {
    background: linear-gradient(to bottom,
        transparent 60%,
        rgba(250, 204, 21, 0.4) 60%);
    transition: background 0.3s ease;
}

body.edit-mode [data-editable].modified:hover {
    background: linear-gradient(to bottom,
        transparent 60%,
        rgba(250, 204, 21, 0.5) 60%);
}

body.edit-mode [data-editable].modified:focus {
    background: linear-gradient(to bottom,
        transparent 60%,
        rgba(250, 204, 21, 0.6) 60%);
}

/* Editable Images */
body.edit-mode [data-editable-image] {
    position: relative;
    cursor: pointer;
}

body.edit-mode [data-editable-image]::after {
    content: 'Bild andern';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 128, 200, 0.85);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

body.edit-mode [data-editable-image]:hover::after {
    opacity: 1;
}

/* Gallery Caption - bessere Lesbarkeit beim Bearbeiten */
body.edit-mode .gallery-caption[data-editable] {
    background: #ffffff;
    color: #1a1a1a;
}

body.edit-mode .gallery-caption[data-editable]:focus {
    background: #ffffff;
    color: #1a1a1a;
    outline-color: var(--color-secondary);
}

/* Gallery Add/Remove Buttons */
.gallery-remove-btn {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
}

body.edit-mode .gallery-item {
    position: relative;
}

body.edit-mode .gallery-item:hover .gallery-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-remove-btn:hover {
    background: #b71c1c;
    transform: scale(1.1);
}

.gallery-add-item {
    display: none;
}

body.edit-mode .gallery-add-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 3px dashed var(--color-gray-light);
    border-radius: 8px;
    transition: all 0.3s;
}

body.edit-mode .gallery-add-item:hover {
    border-color: var(--color-primary);
    background: rgba(0, 128, 200, 0.05);
}

.gallery-add-btn {
    width: 60px;
    height: 60px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-add-btn:hover {
    background: var(--color-secondary);
    transform: scale(1.1);
}

/* Section Add Buttons */
body.edit-mode .section-add-btn {
    display: flex;
}

.section-add-btn {
    display: none;
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 128, 200, 0.4);
    transition: all 0.3s ease;
}

.section-add-btn:hover {
    background: var(--color-secondary);
    transform: translateX(-50%) scale(1.1);
}

/* Section Controls (Move/Delete) */
.section-controls {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    gap: 0.5rem;
    z-index: 100;
}

body.edit-mode .section-controls {
    display: flex;
}

.section-controls button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-controls .btn-move-up,
.section-controls .btn-move-down {
    background: var(--color-primary);
    color: white;
}

.section-controls .btn-move-up:hover,
.section-controls .btn-move-down:hover {
    background: var(--color-primary-dark);
}

.section-controls .btn-settings {
    background: var(--color-gray);
    color: white;
}

.section-controls .btn-settings:hover {
    background: #555;
}

.section-controls .btn-delete {
    background: var(--color-danger);
    color: white;
}

.section-controls .btn-delete:hover {
    background: #b71c1c;
}

/* Custom section label in edit mode */
body.edit-mode .custom-section {
    position: relative;
    border: 2px dashed transparent;
    transition: border-color 0.3s;
}

body.edit-mode .custom-section:hover {
    border-color: var(--color-primary);
}

/* Editor Toolbar */
.editor-toolbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-primary-dark);
    padding: 1rem var(--container-padding);
    z-index: 10000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

body.edit-mode .editor-toolbar {
    display: block;
}

.editor-toolbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.editor-toolbar button {
    background: var(--color-secondary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.editor-toolbar button:hover {
    background: var(--color-secondary-dark);
}

.editor-toolbar button.secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.editor-toolbar button.secondary:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
}

.editor-toolbar button#btnHelp {
    width: 36px;
    padding: 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.editor-toolbar .save-status {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.editor-toolbar .save-status.saved {
    color: var(--color-secondary);
}

.editor-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Page Selector */
.page-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 150px;
}

.page-selector select:hover,
.page-selector select:focus {
    border-color: rgba(255, 255, 255, 0.6);
    outline: none;
}

.page-selector select option {
    background: var(--color-primary-dark);
    color: white;
}

.page-selector button {
    width: 36px;
    padding: 0 !important;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Theme Editor Panel */
.theme-editor-panel {
    display: none;
    position: fixed;
    top: 120px;
    right: 20px;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    min-width: 280px;
}

.theme-editor-panel.visible {
    display: block;
}

.theme-editor-panel h4 {
    margin: 0 0 1rem 0;
    color: var(--color-primary-dark);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.theme-editor-panel .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-gray);
    padding: 0;
    width: auto;
}

.theme-editor-panel .close-btn:hover {
    color: var(--color-danger);
    background: none;
}

.theme-editor-panel .btn-primary {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.theme-editor-panel .btn-primary:hover {
    background: var(--color-primary-dark);
}

.theme-field {
    margin-bottom: 1rem;
}

.theme-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-gray);
    margin-bottom: 0.5rem;
}

.theme-field input[type="color"] {
    width: 100%;
    height: 40px;
    border: 2px solid var(--color-gray-light);
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.theme-field select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--color-gray-light);
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 1rem;
    cursor: pointer;
}

.theme-field select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Theme Color Groups (Primary/Dark side by side) */
.theme-color-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.theme-color-group .theme-field {
    flex: 1;
    margin-bottom: 0;
}

.theme-color-group .theme-field-dark {
    flex: 0 0 80px;
}

.theme-color-group .theme-field-dark label {
    font-size: 0.75rem;
}

/* Optional theme fields (textColor, backgroundColor) */
.theme-field-optional small {
    color: #999;
    font-weight: normal;
}

.theme-color-with-reset {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-color-with-reset input[type="color"] {
    flex: 1;
    height: 36px;
}

.theme-reset-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-gray-light);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.theme-reset-btn:hover {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: white;
}

.theme-checkbox {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--color-gray);
    cursor: pointer;
    white-space: nowrap;
}

.theme-checkbox input {
    width: auto;
    height: auto;
    margin: 0;
}

.theme-color-with-reset input[type="color"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Font size slider */
.theme-field input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--color-gray-light);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.theme-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.theme-field input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
}

.theme-field label span {
    float: right;
    font-weight: 600;
    color: var(--color-primary);
}

/* Floating Format Toolbar */
.format-toolbar {
    display: none;
    position: fixed;
    background: var(--color-black);
    padding: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    gap: 0.25rem;
}

.format-toolbar.visible {
    display: flex;
}

.format-toolbar button {
    background: transparent;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    padding: 0;
}

.format-toolbar button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.format-toolbar button.active {
    background: var(--color-primary);
}

/* Login Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    padding: var(--container-padding);
}

.modal-overlay.visible {
    display: flex;
}

#imageModal.visible {
    z-index: 10003;
}

.modal {
    background: white;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.wide {
    max-width: 600px;
}

.modal.extra-wide {
    max-width: 700px;
}

.modal h3 {
    color: var(--color-primary-dark);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.modal input[type="password"],
.modal input[type="text"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-gray-light);
    font-family: var(--font-main);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.modal input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.modal .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: 2px solid var(--color-gray-light);
    border-radius: 6px;
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: var(--color-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal .close-btn:hover {
    border-color: var(--color-danger);
    color: var(--color-danger);
    background: rgba(220, 53, 69, 0.1);
}

.modal .form-group {
    margin-bottom: 1rem;
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-dark);
}

.modal .form-group label input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

label.sm-checkbox {
    display: block;
    font-weight: normal;
    cursor: pointer;
    padding: 0.3rem 0;
}
label.sm-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
    vertical-align: middle;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-buttons button {
    flex: 1;
    padding: 1rem;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-buttons .btn-primary {
    background: var(--color-secondary);
    color: white;
    border: none;
}

.modal-buttons .btn-primary:hover {
    background: var(--color-secondary-dark);
}

.modal-buttons .btn-secondary {
    background: transparent;
    color: var(--color-gray);
    border: 2px solid var(--color-gray-light);
}

.modal-buttons .btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Modal Actions (SEO Settings etc.) */
.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-gray-light);
}

.modal-actions button {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-actions .primary {
    background: var(--color-primary);
    color: white;
    border: none;
}

.modal-actions .primary:hover {
    background: var(--color-primary-dark);
}

.modal-actions .secondary {
    background: white;
    color: var(--color-gray);
    border: 2px solid var(--color-gray-light);
}

.modal-actions .secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.modal .error-message {
    color: var(--color-danger);
    font-size: 0.9rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    display: none;
}

.modal .error-message.visible {
    display: block;
}

.modal-buttons .btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
    flex: 0 0 auto;
    padding: 1rem 1.5rem;
}

.modal-buttons .btn-danger:hover {
    background: #c0392b;
}

/* Color Suggestions */
.color-suggestions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-gray-light);
}

.color-suggestions label {
    font-size: 0.8rem;
    color: var(--color-gray);
    margin-bottom: 0.5rem;
    display: block;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: var(--color-primary);
}

.color-swatch::after {
    content: attr(data-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    margin-bottom: 4px;
}

.color-swatch:hover::after {
    opacity: 1;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--color-gray);
    margin-top: 0.25rem;
}

/* Media Tabs */
.media-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-gray-light);
}

.media-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--color-gray);
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.media-tab:hover {
    color: var(--color-primary);
}

.media-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.media-tab-content {
    min-height: 200px;
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.25rem;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item:hover {
    border-color: var(--color-primary);
}

.media-item.selected {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px var(--color-secondary);
}

.media-item .media-date {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.65rem;
    padding: 0.25rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-item:hover .media-date,
.media-item.selected .media-date {
    opacity: 1;
}

/* Template Selection Modal */
.template-nav-input {
    margin-bottom: 1rem;
}

.template-nav-input label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-primary-dark);
}

.template-nav-input input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-gray-light);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.template-nav-input input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.template-nav-input .input-hint {
    font-size: 0.8rem;
    color: var(--color-gray);
    margin-top: 0.5rem;
}

.template-categories {
    margin: 1rem 0;
    max-height: 50vh;
    overflow-y: auto;
}

.template-category {
    margin-bottom: 1.25rem;
}

.template-category-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-gray);
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--color-gray-light);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

.template-card {
    border: 1px solid var(--color-gray-light);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.template-card:hover {
    border-color: var(--color-primary);
    background: rgba(0, 128, 200, 0.04);
}

.template-card.selected {
    border-color: var(--color-primary);
    background: rgba(0, 128, 200, 0.08);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.template-card h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 0 0 0.2rem 0;
}

.template-card p {
    color: var(--color-gray);
    font-size: 0.75rem;
    margin: 0;
    line-height: 1.3;
}

/* Image Upload Modal */
.upload-zone {
    border: 3px dashed var(--color-gray-light);
    padding: 3rem;
    text-align: center;
    margin: 1.5rem 0;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--color-primary);
    background: rgba(0, 128, 200, 0.05);
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-zone p {
    color: var(--color-gray);
    margin-top: 1rem;
}

.upload-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 1rem;
    display: none;
}

.upload-preview.visible {
    display: block;
}

/* Custom Section Styles */
.custom-section {
    position: relative;
}

/* Section type label - use ::after to not conflict with section background patterns */
body.edit-mode .custom-section::after {
    content: attr(data-section-type);
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--color-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    z-index: 10;
    pointer-events: none;
}

/* Ensure content wrappers are visible in edit mode */
body.edit-mode .about-flyer-wrapper,
body.edit-mode .cta-content,
body.edit-mode .content-wrapper {
    position: relative;
    z-index: 2;
}

/* Ensure flyer section content is visible */
body.edit-mode .about-flyer-section {
    min-height: 400px;
}

body.edit-mode .about-flyer-section .about-flyer-wrapper {
    background: inherit;
}

body.edit-mode .about-flyer-header,
body.edit-mode .about-flyer-content {
    position: relative;
    z-index: 5;
}

/* Ensure CTA section content is visible */
body.edit-mode .cta-section {
    min-height: 300px;
}

body.edit-mode .cta-section .cta-content {
    position: relative;
    z-index: 5;
}

body.edit-mode .cta-date,
body.edit-mode .cta-list,
body.edit-mode .vote-request {
    position: relative;
    z-index: 5;
}

/* Mobile Editor Adjustments */
@media (max-width: 768px) {
    .editor-toolbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .editor-toolbar button {
        width: 100%;
    }

    .format-toolbar {
        left: 50% !important;
        transform: translateX(-50%);
    }

    body.edit-mode .briefwahl-fab {
        bottom: 100px;
    }

    .theme-editor-panel {
        left: 20px;
        right: 20px;
        min-width: auto;
    }
}

/* Hide editor elements when not in edit mode */
body:not(.edit-mode) .editor-toolbar,
body:not(.edit-mode) .edit-mode-banner,
body:not(.edit-mode) .section-add-btn,
body:not(.edit-mode) .section-controls {
    display: none !important;
}

/* ============================================================
   SEO Panel & Widget
   ============================================================ */

.seo-panel {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 380px;
    max-height: calc(100vh - 120px - 70px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    flex-direction: column;
}

.seo-panel.visible {
    display: flex;
}

.seo-panel h4 {
    margin: 0;
    padding: 1rem 1.25rem;
    background: var(--color-primary);
    color: white;
    font-size: 1rem;
    border-radius: 8px 8px 0 0;
}

.seo-panel .close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
}

.seo-panel .close-btn:hover {
    opacity: 1;
}

.seo-panel .seo-settings-btn {
    position: absolute;
    top: 0.5rem;
    right: 2.5rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
    padding: 0;
    line-height: 1;
}

.seo-panel .seo-settings-btn:hover {
    opacity: 1;
}

#seoContent {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.seo-loading {
    text-align: center;
    color: var(--color-gray);
    padding: 2rem;
}

/* SEO Score */
.seo-score {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--color-gray-light);
    border-radius: 8px;
}

.seo-score-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.seo-score-circle.score-excellent { background: #22c55e; }
.seo-score-circle.score-good { background: #84cc16; }
.seo-score-circle.score-fair { background: #f59e0b; }
.seo-score-circle.score-poor { background: #ef4444; }

.seo-score-info h5 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.seo-score-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-gray);
}

/* SEO Recommendations */
.seo-recommendations h5 {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text);
}

.seo-rec-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.seo-rec-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-gray-light);
    font-size: 0.85rem;
}

.seo-rec-item:last-child {
    border-bottom: none;
}

.seo-rec-badge {
    flex-shrink: 0;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.seo-rec-badge.high { background: #fef2f2; color: #dc2626; }
.seo-rec-badge.medium { background: #fef3c7; color: #d97706; }
.seo-rec-badge.low { background: #ecfdf5; color: #059669; }
.seo-rec-badge.info { background: #eff6ff; color: #2563eb; }

.seo-rec-message {
    flex: 1;
    line-height: 1.4;
}

/* SEO Actions */
.seo-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-gray-light);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.seo-actions button {
    flex: 1;
    min-width: 140px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--color-gray-light);
    background: white;
    color: var(--color-text);
    transition: background 0.15s ease;
}

.seo-actions button:hover {
    background: var(--color-gray-light);
}

.seo-actions button.primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.seo-actions button.primary:hover {
    opacity: 0.9;
}

/* SEO Details Grid */
.seo-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.seo-detail-item {
    padding: 0.5rem;
    background: var(--color-gray-light);
    border-radius: 4px;
}

.seo-detail-item label {
    display: block;
    font-size: 0.7rem;
    color: var(--color-gray);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.seo-detail-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

.seo-detail-item span.seo-warning {
    color: #dc2626;
    font-weight: 600;
}

/* SEO Settings Modal Additions */
#seoSettingsModal .connection-status {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

#seoSettingsModal .connection-status.success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

#seoSettingsModal .connection-status.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

#seoSettingsModal .connection-status.loading {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Empty state */
.seo-empty {
    text-align: center;
    padding: 2rem;
    color: var(--color-gray);
}

.seo-empty p {
    margin: 0 0 1rem;
}

/* Keywords section */
.seo-keywords {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
}

.seo-primary-keyword {
    margin-bottom: 0.75rem;
}

.seo-primary-keyword label,
.seo-keyword-list label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--color-gray);
    margin-bottom: 0.25rem;
}

.keyword-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    background: #e2e8f0;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #475569;
}

.keyword-badge.primary {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.keyword-badge.has-presence {
    background: #dcfce7;
    color: #166534;
}

.kw-presence {
    margin-left: 0.25rem;
    font-size: 0.6rem;
    opacity: 0.7;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Primary keyword without presence warning */
.keyword-badge.no-presence {
    background: #fef3c7;
    color: #92400e;
}

.kw-warning {
    display: block;
    font-size: 0.65rem;
    color: #dc2626;
    margin-top: 0.25rem;
}

/* No relevant keywords warning box */
.seo-no-keywords-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.seo-no-keywords-warning .warning-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.seo-no-keywords-warning .warning-text {
    font-size: 0.75rem;
    color: #92400e;
    line-height: 1.4;
}

/* Hint text for generic keywords */
.kw-hint {
    font-size: 0.65rem;
    color: #6b7280;
    margin: 0.5rem 0 0;
    font-style: italic;
}

/* Generic keywords section */
.seo-keyword-list.generic {
    margin-top: 0.5rem;
    opacity: 0.7;
}

.seo-keyword-list.generic label {
    color: #9ca3af;
}

/* Cannibalization warnings */
.seo-cannibalization {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #fef2f2;
    border-radius: 6px;
    border-left: 3px solid #ef4444;
}

.seo-cannibalization h5 {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    color: #dc2626;
}

.seo-hint {
    font-size: 0.7rem;
    color: #7f1d1d;
    margin: 0 0 0.5rem;
}

.cannibalization-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cannibalization-list li {
    font-size: 0.75rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #fecaca;
}

.cannibalization-list li:last-child {
    border-bottom: none;
}

.cannibalization-list li.more {
    color: #991b1b;
    font-style: italic;
}

.cannibal-keyword {
    font-weight: 600;
    color: #b91c1c;
}

.cannibal-pages {
    display: block;
    color: #7f1d1d;
    font-size: 0.7rem;
    margin-top: 0.125rem;
}

/* Cluster / Related pages */
.seo-cluster {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #f0fdf4;
    border-radius: 6px;
}

.seo-cluster h5 {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: #166534;
}

.cluster-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cluster-list li {
    font-size: 0.75rem;
    padding: 0.25rem 0;
}

.cluster-list a {
    color: #15803d;
    text-decoration: none;
}

.cluster-list a:hover {
    text-decoration: underline;
}

/* Link suggestions */
.seo-link-suggestions {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #eff6ff;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.seo-link-suggestions h5 {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    color: #1d4ed8;
}

.seo-link-suggestions .seo-hint {
    font-size: 0.7rem;
    color: #1e40af;
    margin: 0 0 0.5rem;
}

.link-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.link-suggestions-list li {
    font-size: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #dbeafe;
}

.link-suggestions-list li:last-child {
    border-bottom: none;
}

.link-suggestions-list a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.link-suggestions-list a:hover {
    text-decoration: underline;
}

.link-reason {
    display: block;
    font-size: 0.65rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

/* Primary keyword reason */
.kw-reason {
    display: block;
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Cannibalization links */
.cannibal-pages a {
    color: #b91c1c;
    text-decoration: none;
}

.cannibal-pages a:hover {
    text-decoration: underline;
}

/* Keyword test form */
.seo-keyword-test {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.seo-keyword-test h5 {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: #374151;
}

.keyword-test-form {
    display: flex;
    gap: 0.5rem;
}

.keyword-test-form input {
    flex: 1;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.keyword-test-form button {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.keyword-test-form button:hover {
    opacity: 0.9;
}

.keyword-test-result {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.keyword-test-result:empty {
    display: none;
}

.kw-test-phrase {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.kw-test-found {
    display: flex;
    gap: 1rem;
    color: #166534;
    margin-bottom: 0.25rem;
}

.kw-test-notfound {
    color: #9ca3af;
    font-style: italic;
    margin-bottom: 0.25rem;
}

.kw-test-presence {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.kw-test-presence .present {
    color: #166534;
}

.kw-test-presence .missing {
    color: #dc2626;
}

.kw-test-warning {
    margin-top: 0.25rem;
    color: #d97706;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .seo-panel {
        left: 10px;
        right: 10px;
        width: auto;
        top: 60px;
    }

    .seo-details {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   GEO PANEL (LLM-Optimierung)
   ============================================ */

.geo-panel {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 380px;
    max-height: calc(100vh - 120px - 70px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    flex-direction: column;
}

.geo-panel.visible {
    display: flex;
}

.geo-panel h4 {
    margin: 0;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 12px 12px 0 0;
    color: white;
    font-size: 1rem;
}

.geo-panel .close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
}

.geo-panel .close-btn:hover {
    opacity: 1;
}

.geo-panel .geo-settings-btn {
    position: absolute;
    top: 0.5rem;
    right: 2.5rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
    padding: 0.25rem;
}

.geo-panel .geo-settings-btn:hover {
    opacity: 1;
}

#geoContent {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.geo-loading {
    text-align: center;
    color: var(--color-gray);
    padding: 2rem;
}

/* GEO Total Score */
.geo-total-score {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #faf5ff;
    border-radius: 8px;
}

.geo-score-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.geo-score-circle.score-excellent { background: linear-gradient(135deg, #22c55e, #16a34a); }
.geo-score-circle.score-good { background: linear-gradient(135deg, #84cc16, #65a30d); }
.geo-score-circle.score-fair { background: linear-gradient(135deg, #f59e0b, #d97706); }
.geo-score-circle.score-poor { background: linear-gradient(135deg, #ef4444, #dc2626); }

.geo-score-info h5 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.geo-score-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-gray);
}

/* GEO Check Cards */
.geo-checks {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.geo-check-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.geo-check-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.geo-check-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
}

.geo-check-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.geo-check-icon.excellent { background: #dcfce7; color: #16a34a; }
.geo-check-icon.good { background: #fef9c3; color: #ca8a04; }
.geo-check-icon.poor { background: #fee2e2; color: #dc2626; }

.geo-check-info {
    flex: 1;
    min-width: 0;
}

.geo-check-info h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.geo-check-info small {
    color: #6b7280;
    font-size: 0.75rem;
}

.geo-check-score {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.geo-check-toggle {
    color: #9ca3af;
    transition: transform 0.2s;
}

.geo-check-card.expanded .geo-check-toggle {
    transform: rotate(180deg);
}

.geo-check-details {
    display: none;
    padding: 0 1rem 1rem;
    border-top: 1px solid #f3f4f6;
}

.geo-check-card.expanded .geo-check-details {
    display: block;
}

/* GEO Found/Missing Lists */
.geo-found-list,
.geo-missing-list {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.geo-found-list li,
.geo-missing-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.8rem;
    line-height: 1.4;
}

.geo-found-list li::before {
    content: '✓';
    color: #22c55e;
    font-weight: bold;
}

.geo-missing-list li::before {
    content: '✗';
    color: #ef4444;
    font-weight: bold;
}

/* GEO Suggestions */
.geo-suggestions {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #eff6ff;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.geo-suggestions h6 {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    color: #1d4ed8;
    text-transform: uppercase;
}

.geo-suggestions ul {
    margin: 0;
    padding: 0 0 0 1rem;
    font-size: 0.8rem;
    color: #1e40af;
}

.geo-suggestions li {
    margin-bottom: 0.35rem;
}

/* GEO Facts Preview */
.geo-facts-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.geo-fact-tag {
    background: #f3e8ff;
    color: #7c3aed;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
}

/* GEO Questions Preview */
.geo-questions-preview {
    margin-top: 0.5rem;
}

.geo-question-item {
    background: #f0fdf4;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    color: #166534;
}

/* GEO Actions */
.geo-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
}

.geo-actions button {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.geo-actions button:hover {
    background: #f9fafb;
}

.geo-actions button.primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: transparent;
    color: white;
}

.geo-actions button.primary:hover {
    opacity: 0.9;
}

/* GEO Empty State */
.geo-empty {
    text-align: center;
    padding: 2rem;
    color: var(--color-gray);
}

.geo-empty p {
    margin: 0 0 1rem;
}

/* GEO Optimizer CTA in check card */
.geo-optimizer-cta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #e5e7eb;
}

.geo-optimizer-cta button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

/* ==========================================
   GEO Optimizer Modal Styles
   ========================================== */

#geoOptimizerModal .modal {
    max-width: 600px;
}

#geoOptimizerModal .modal-subtitle {
    font-size: 0.9rem;
}

/* Fieldset styling */
.geo-optimizer-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.geo-optimizer-section legend {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary);
    padding: 0 0.5rem;
}

/* Geo coordinates row */
.geo-coords-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.geo-coords-row .form-group {
    margin-bottom: 0;
}

.geo-coords-row label {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.25rem;
    color: #374151;
}

.geo-coords-row input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Geo lookup */
.geo-lookup-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.geo-lookup-row button {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.geo-lookup-row .btn-icon {
    font-size: 1.1rem;
}

.lookup-status {
    font-size: 0.85rem;
    color: #6b7280;
}

.lookup-status.loading {
    color: #3b82f6;
}

.lookup-status.success {
    color: #16a34a;
}

.lookup-status.error {
    color: #dc2626;
}

/* Opening hours */
.opening-hours-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.opening-hours-row:last-child {
    margin-bottom: 0;
}

.day-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 80px;
    font-size: 0.9rem;
    cursor: pointer;
}

.day-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.opening-hours-row input[type="time"] {
    padding: 0.4rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 90px;
}

.opening-hours-row input[type="time"]:disabled {
    background: #f3f4f6;
    color: #9ca3af;
}

.opening-hours-row span:not(.day-checkbox span) {
    color: #6b7280;
}

/* Person / Founder fields */
.geo-optimizer-section .form-group {
    margin-bottom: 0.75rem;
}

.geo-optimizer-section .form-group:last-child {
    margin-bottom: 0;
}

.geo-optimizer-section .form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: #374151;
}

.geo-optimizer-section .form-group input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.geo-optimizer-section .input-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Social media validation list */
.social-media-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-media-list .empty-text,
.social-media-list .loading-text {
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
}

.social-media-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 0.85rem;
}

.social-media-item.valid {
    border-color: #86efac;
    background: #f0fdf4;
}

.social-media-item.invalid {
    border-color: #fca5a5;
    background: #fef2f2;
}

.social-media-item .social-icon {
    font-size: 1rem;
}

.social-media-item.valid .social-icon {
    color: #16a34a;
}

.social-media-item.invalid .social-icon {
    color: #dc2626;
}

.social-media-item .social-url {
    flex: 1;
    color: #374151;
}

.social-media-item .social-status {
    font-size: 0.75rem;
    color: #9ca3af;
}

.social-media-item.invalid .social-status {
    color: #ef4444;
}

/* Button styles in modal */
#geoOptimizerModal button.small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

#geoOptimizerModal button.secondary {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
}

#geoOptimizerModal button.secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

#geoOptimizerModal button.primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    color: white;
}

#geoOptimizerModal button.primary:hover {
    opacity: 0.9;
}

.geo-empty button {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* GEO Mobile */
@media (max-width: 768px) {
    .geo-panel {
        left: 10px;
        right: 10px;
        width: auto;
        top: 60px;
    }
}

/* ==========================================
   AI Content Assistant Modal
   ========================================== */

.ai-modal {
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.ai-improve-content {
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.ai-modal .modal-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

/* Loading State */
.ai-loading {
    text-align: center;
    padding: 3rem 1rem;
}

.ai-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-loading p {
    margin: 0 0 0.25rem;
    font-weight: 500;
    color: #374151;
}

.ai-loading small {
    color: #6b7280;
}

/* Error State */
.ai-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.ai-error p {
    margin: 0 0 0.5rem;
    color: #dc2626;
}

.ai-error a {
    color: #7c3aed;
}

/* Empty State */
.ai-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #6b7280;
}

.ai-empty p {
    margin: 0 0 0.5rem;
    font-weight: 500;
    color: #374151;
}

/* Context Badges */
.ai-context {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
}

.ai-model {
    margin-left: auto;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Improvements List */
.ai-improvements {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.ai-improvement-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.15s;
}

.ai-improvement-card:has(input:checked) {
    border-color: #8b5cf6;
    background: #faf5ff;
}

.ai-improvement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ai-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.ai-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
    cursor: pointer;
}

.ai-checkbox span {
    font-weight: 600;
    color: #1f2937;
}

.ai-section-badge {
    background: #e0e7ff;
    color: #4338ca;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Diff Display */
.ai-diff {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-before,
.ai-after {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ai-before span,
.ai-after span {
    display: block;
    white-space: pre-wrap;
}

.ai-before {
    background: #fef2f2;
    border-left: 3px solid #fca5a5;
}

.ai-before strong {
    color: #dc2626;
    font-size: 0.7rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.25rem;
}

.ai-after {
    background: #f0fdf4;
    border-left: 3px solid #86efac;
}

.ai-after strong {
    color: #16a34a;
    font-size: 0.7rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.25rem;
}

.ai-reason {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

/* Selection Info */
.ai-selection-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.85rem;
    color: #6b7280;
    text-align: center;
}

.ai-selected-count {
    font-weight: 600;
    color: #8b5cf6;
}

/* Check Actions (in GEO panel) */
.geo-check-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.geo-check-actions button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.geo-ai-btn {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
    color: white !important;
    border: none !important;
}

.geo-ai-btn:hover {
    opacity: 0.9;
}

/* AI Toast Notification */
.ai-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.ai-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.ai-toast button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.ai-toast button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* KI-Analyse Button in GEO Panel */
.ai-analyze-btn {
    margin-left: auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* AI Summary Section */
.ai-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.ai-summary-item {
    margin-bottom: 0.25rem;
    color: #475569;
}

.ai-summary-item:last-child {
    margin-bottom: 0;
}

.ai-summary-item strong {
    color: #1e293b;
}

/* Grouped Improvements */
.ai-improvements-grouped {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-category-group {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.ai-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

.ai-category-icon {
    font-size: 1.1rem;
}

.ai-category-label {
    flex: 1;
    color: #1e293b;
}

.ai-category-count {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 400;
}

.ai-category-items {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Priority badges */
.ai-priority-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 4px;
    font-weight: 500;
}

.ai-improvement-card.priority-high {
    border-left: 3px solid #dc2626;
}

.ai-improvement-card.priority-medium {
    border-left: 3px solid #f59e0b;
}

/* Badge colors per category */
.ai-badge-identity { background: #ede9fe; color: #7c3aed; }
.ai-badge-facts { background: #dbeafe; color: #2563eb; }
.ai-badge-schema { background: #dcfce7; color: #16a34a; }
.ai-badge-faq { background: #fef3c7; color: #d97706; }
.ai-badge-seo { background: #fee2e2; color: #dc2626; }
.ai-badge-hai {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: white;
    font-weight: 600;
    cursor: help;
}

/* ============================================================
   HAI CONTEXT EDITOR
   ============================================================ */

.hai-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.hai-toolbar button {
    padding: 0.4rem 0.75rem;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    min-width: 40px;
    transition: all 0.15s ease;
}

.hai-toolbar button:hover {
    background: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
}

.hai-toolbar-divider {
    width: 1px;
    background: #e2e8f0;
    margin: 0 0.5rem;
}

.hai-editor {
    width: 100%;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 6px 6px;
    resize: vertical;
    min-height: 300px;
    box-sizing: border-box;
}

.hai-editor:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.hai-status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    min-height: 1.5rem;
    color: #64748b;
}

.hai-status.success {
    color: #16a34a;
}

.hai-status.error {
    color: #dc2626;
}

/* ============================================================
   MOBILE BOTTOM SHEET + FAB PILLS
   ============================================================ */

/* Desktop: Mobile-only elements verstecken */
.mobile-fab-pills,
.bottom-sheet-handle,
.bottom-sheet-backdrop {
    display: none;
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* ===== FAB PILLS ===== */
    body.edit-mode .mobile-fab-pills {
        display: flex;
        position: fixed;
        bottom: 52px;
        right: 16px;
        gap: 12px;
        z-index: 10001;
        flex-direction: column;
    }

    .fab-pill {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .fab-pill:active {
        transform: scale(0.95);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    }

    .fab-pill.primary {
        background: var(--color-secondary);
        color: white;
    }

    .fab-pill.secondary {
        background: white;
        color: var(--color-text);
    }

    .fab-pill.geo {
        background: linear-gradient(135deg, #8b5cf6, #6366f1);
        color: white;
    }

    /* ===== BOTTOM SHEET ===== */
    body.edit-mode .editor-toolbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 85vh;
        transform: translateY(calc(100% - 32px));
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 20px 20px 0 0;
        overflow: hidden;
        padding: 0;
    }

    body.edit-mode .editor-toolbar.expanded {
        transform: translateY(0);
    }

    .bottom-sheet-handle {
        display: flex;
        padding: 14px;
        justify-content: center;
        cursor: grab;
        touch-action: none;
        background: var(--color-primary-dark);
    }

    .bottom-sheet-handle::before {
        content: '';
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 2px;
    }

    body.edit-mode .editor-toolbar .editor-toolbar-inner {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem 1rem 1rem;
        gap: 0.5rem;
        max-height: calc(85vh - 50px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Toolbar Buttons Container - 2-spaltig Grid */
    body.edit-mode .editor-toolbar .editor-toolbar-inner > div[style] {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem !important;
        width: 100%;
    }

    /* Page Selector - volle Breite */
    body.edit-mode .editor-toolbar select {
        grid-column: 1 / -1;
        width: 100% !important;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem;
        box-sizing: border-box;
    }

    /* Kompakte Buttons */
    body.edit-mode .editor-toolbar button,
    body.edit-mode .editor-toolbar a.secondary {
        width: 100% !important;
        padding: 0.5rem 0.5rem !important;
        font-size: 0.8rem;
        display: flex !important;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
    }

    /* Speichern & Beenden - volle Breite, hervorgehoben */
    body.edit-mode .editor-toolbar #btnSave,
    body.edit-mode .editor-toolbar #btnExit {
        grid-column: span 1;
        padding: 0.6rem 0.5rem !important;
        font-size: 0.85rem;
    }

    /* Verstecke den Separator auf Mobile */
    body.edit-mode .editor-toolbar span[style*="opacity: 0.3"] {
        display: none !important;
    }

    /* Save Status - kompakt */
    body.edit-mode .editor-toolbar-left {
        padding: 0.25rem 0;
        text-align: center;
        font-size: 0.8rem;
    }

    /* ===== BACKDROP ===== */
    .bottom-sheet-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 9999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .bottom-sheet-backdrop.visible {
        display: block;
        opacity: 1;
    }

    /* FABs über dem Backdrop */
    body.edit-mode .mobile-fab-pills {
        z-index: 10002;
    }

    /* Wenn Sheet expanded, FABs leicht ausblenden */
    body.edit-mode .editor-toolbar.expanded ~ .mobile-fab-pills {
        opacity: 0.3;
        pointer-events: none;
    }
}
