/* ===== EDITOR V3 - MINIMALISTISCHES REDESIGN ===== */

/* Editor Modal - Fullscreen */
.modal-fullscreen {
    padding: 0 !important;
}

.modal-fullscreen .modal-content {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.editor-container-v3 {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas Area */
.canvas-area {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 60px 70px;
    position: relative;
}

.canvas-area canvas {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border-radius: 4px;
    background: white;
}

/* ===== ULTRA-SLIM FLOATING TOOLBAR ===== */
.toolbar-floating {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 100;
    width: 48px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.tool-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    flex-shrink: 0;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.05);
}

.tool-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.tool-btn:active {
    transform: scale(0.95);
}

/* Tooltips - nur Desktop */
@media (hover: hover) {
    .tool-btn::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 52px;
        background: rgba(20, 20, 20, 0.95);
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
        border: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1000;
    }
    
    .tool-btn:hover::after {
        opacity: 1;
    }
}

.tool-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
    flex-shrink: 0;
}

/* ===== ULTRA-COMPACT TOP BAR ===== */
.top-bar {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 100;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.divider-vertical {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.color-picker {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.15s;
}

.color-picker:hover {
    transform: scale(1.1);
    border-color: #60a5fa;
}

.slider-compact {
    width: 60px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
}

.slider-compact::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #60a5fa;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.slider-compact::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #60a5fa;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.value-display {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    min-width: 24px;
    text-align: center; /* Value bleibt zentriert */
}

/* WICHTIG: Spezifische Regel für Property Labels im Properties Panel */
.properties-panel .property-label,
.properties-panel .property-group .property-label,
#propertiesPanel .property-label,
#propertiesPanel div.property-label,
#propertiesPanel label.property-label,
#generalPropertiesGroup .property-label {
    text-align: left !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
}

/* ===== COLLAPSIBLE PROPERTIES PANEL ===== */
.properties-panel {
    position: fixed;
    right: -220px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px 0 0 12px;
    padding: 12px 12px 12px 12px; /* Gleicher Padding oben und unten */
    width: 220px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    box-shadow: -8px 0 32px rgba(0,0,0,0.4);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
    color: white !important;
}

/* Alle Elemente im Properties Panel */
.properties-panel * {
    color: white !important;
}

.properties-panel.open {
    right: 0;
}

.properties-toggle {
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px 0 0 8px;
    width: 32px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    transition: all 0.2s;
}

.properties-toggle:hover {
    color: white;
    background: rgba(30, 30, 30, 0.9);
}

.property-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

.property-group {
    margin-bottom: 12px;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start !important; /* WICHTIG: Links ausrichten */
}

.property-group:last-child {
    margin-bottom: 0; /* Kein Abstand beim letzten Element */
}

.property-label,
.property-group div.property-label,
.property-group label.property-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5) !important;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    background: transparent !important;
    text-align: left !important;
}

.property-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 8px;
    color: white;
    font-size: 12px;
}

/* Button Group Container */
.button-group {
    display: flex;
    gap: 4px;
    width: 100%;
}

/* Color Presets für Highlight */
.color-presets {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    width: 100%;
    justify-content: flex-start;
}

.color-preset {
    /* Größe wird dynamisch aus Config.PRESET_CONFIG.PRESET_SIZE gesetzt */
    /* Fallback: 32px wenn Config nicht geladen */
    width: var(--preset-size, 32px);
    height: var(--preset-size, 32px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
    padding: 0;
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.color-preset:active {
    transform: scale(0.95);
}

.color-preset.active {
    border-color: #60a5fa;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3);
}

.property-input:focus {
    outline: none;
    border-color: #60a5fa;
}

/* Color Input nach Presets - weniger prominent */
.color-presets + .property-input[type="color"] {
    margin-top: 4px;
}

/* Select Dropdowns in Properties */
.property-input select,
.properties-panel select,
.properties-panel #selectedFont,
.properties-panel #selectedArrowType {
    background: rgba(255, 255, 255, 0.05) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
}

.property-input select option,
.properties-panel select option {
    background: #1e293b !important;
    color: white !important;
}

/* Number Inputs in Properties */
.property-input[type="number"],
.properties-panel input[type="number"],
.properties-panel #selectedFontSize {
    background: rgba(255, 255, 255, 0.05) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Color Inputs in Properties */
.property-input[type="color"],
.properties-panel input[type="color"],
.properties-panel #selectedColor,
.properties-panel #selectedStrokeColor {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    cursor: pointer;
}

/* Style Buttons in Properties */
.properties-panel .style-btn,
.properties-panel #boldBtn,
.properties-panel #italicBtn,
.properties-panel #underlineBtn,
.properties-panel #generalBoldBtn,
.properties-panel #generalItalicBtn,
.properties-panel #generalUnderlineBtn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 32px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.properties-panel .style-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.properties-panel .style-btn.active {
    background: rgba(59, 130, 246, 0.3) !important;
    border-color: #60a5fa !important;
    color: #60a5fa !important;
}

/* ===== MINIMAL ZOOM CONTROLS ===== */
.zoom-controls {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 100;
}

.zoom-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.15s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.zoom-value {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 40px;
    text-align: center;
}

/* ===== COMPACT ACTION BUTTONS ===== */
.action-buttons {
    position: fixed;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.btn-action {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-action:hover {
    background: rgba(30, 30, 30, 0.9);
}

.btn-action:active {
    transform: scale(0.95);
}

.btn-action.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
}

.btn-action.primary:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ===== TEXT INPUT OVERLAY ===== */
.text-input-overlay {
    position: absolute;
    display: none;
    border: 2px solid #60a5fa;
    background: white;
    padding: 4px 8px;
    font-family: Arial;
    font-size: 16px;
    outline: none;
    z-index: 1000;
    min-width: 100px;
}

/* ===== SCROLLBAR STYLING ===== */
.toolbar-floating::-webkit-scrollbar,
.properties-panel::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.toolbar-floating::-webkit-scrollbar-track,
.properties-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.toolbar-floating::-webkit-scrollbar-thumb,
.properties-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Bei kleiner Höhe: Horizontal Toolbar */
@media (max-height: 600px) {
    .editor-container-v3 .toolbar-floating {
        top: 10px;
        transform: none;
        flex-direction: row;
        width: auto;
        max-width: calc(100vw - 100px);
        max-height: none;
        left: 10px;
        overflow-x: auto;
    }

    .editor-container-v3 .tool-btn {
        flex-shrink: 0;
    }

    .editor-container-v3 .tool-divider {
        width: 1px;
        height: 24px;
        margin: 0 4px;
    }

    .editor-container-v3 .canvas-area {
        padding: 70px 10px 70px 10px;
    }

    .editor-container-v3 .properties-panel {
        top: auto;
        bottom: 70px;
        transform: none;
        max-height: 200px;
    }

    .editor-container-v3 .properties-toggle {
        top: -32px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 8px 8px 0 0;
        width: 48px;
        height: 32px;
    }
}

/* Mobile Optimierungen */
@media (max-width: 768px) {
    .editor-container-v3 .canvas-area {
        padding: 80px 10px 80px 60px;
    }

    .editor-container-v3 .toolbar-floating {
        left: 5px;
        width: 44px;
    }

    .editor-container-v3 .tool-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .editor-container-v3 .top-bar {
        top: 5px;
        padding: 4px 8px;
        gap: 8px;
        flex-wrap: wrap;
        max-width: calc(100vw - 70px);
    }

    .editor-container-v3 .slider-compact {
        width: 40px;
    }

    .editor-container-v3 .properties-panel {
        width: 200px;
        right: -200px;
    }

    .editor-container-v3 .zoom-controls {
        bottom: 5px;
        padding: 3px 6px;
    }

    .editor-container-v3 .action-buttons {
        flex-direction: column;
        gap: 4px;
        bottom: 5px;
        right: 5px;
    }

    .editor-container-v3 .btn-action {
        width: 100%;
        min-width: 100px;
        text-align: center;
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Touch-freundlich */
    .editor-container-v3 .tool-btn,
    .editor-container-v3 .zoom-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .editor-container-v3 .btn-action {
        min-height: 44px;
    }
}

/* Sehr kleine Mobile Screens */
@media (max-width: 480px) and (max-height: 700px) {
    /* Horizontale Toolbar oben */
    .editor-container-v3 .toolbar-floating {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        width: auto;
        max-width: calc(100vw - 20px);
        overflow-x: auto;
    }

    .editor-container-v3 .tool-divider {
        width: 1px;
        height: 24px;
        margin: 0 2px;
    }

    .editor-container-v3 .canvas-area {
        padding: 70px 10px 70px 10px;
    }

    /* Properties als Bottom Sheet */
    .editor-container-v3 .properties-panel {
        top: auto;
        bottom: -200px;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 60vh;
        transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .editor-container-v3 .properties-panel.open {
        bottom: 60px;
        right: 0;
    }

    /* Action Buttons weiter nach oben */
    .editor-container-v3 .action-buttons {
        bottom: auto;
        top: 60px;
        right: 5px;
    }

    .editor-container-v3 .properties-toggle {
        top: -32px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 8px 8px 0 0;
        width: 60px;
        height: 32px;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .editor-container-v3 .canvas-area {
        padding: 70px 15px 70px 65px;
    }
}
