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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    min-height: 100vh;
    user-select: none;
    -webkit-user-select: none;
}

input, textarea, [contenteditable="true"] {
    user-select: text;
    -webkit-user-select: text;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background-color: #3e3d40;
    padding: 10px 20px;
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
}

.design-name-display {
    color: #ccc;
    font-size: 28px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid #555;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.design-name-display:empty {
    display: none;
}

/* Toolbar */
.toolbar {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 70px;
}

.toolbar-btn:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}

.toolbar-btn:active {
    background-color: #e0e0e0;
}

.btn-icon {
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    display: block;
}

.btn-label {
    font-size: 12px;
    color: #666;
}

.toolbar-btn-export {
    background-color: #3e3d40;
    color: #fff;
    border-color: #3e3d40;
}

.toolbar-btn-export:hover {
    background-color: #555;
    border-color: #555;
}

.toolbar-btn-export .btn-label {
    color: #fff;
}

.toolbar-separator {
    width: 1px;
    height: 40px;
    background-color: #ddd;
    margin: 0 10px;
}

.toolbar-property {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toolbar-property label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
}

.toolbar-property input,
.toolbar-property select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.toolbar-property input[type="number"] {
    width: 70px;
}

.toolbar-angle-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolbar-angle-group input[type="number"] {
    width: 70px;
}

.reset-angle-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: none;
}

.reset-angle-btn.visible {
    display: block;
}

.reset-angle-btn:hover {
    color: #333;
}

.toolbar-property input[type="color"] {
    width: 50px;
    height: 28px;
    padding: 2px;
    cursor: pointer;
}

.toolbar-property select {
    min-width: 100px;
}

.toolbar-property input:disabled,
.toolbar-property select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.toolbar-property input.warning {
    color: #d32f2f;
    border-color: #d32f2f;
    background-color: #ffebee;
}

.toolbar-checkbox-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #666666;
}

/* ==================== Font Picker ==================== */
.font-picker-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
}

.font-picker {
    position: relative;
    min-width: 180px;
}

.font-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    min-height: 28px;
}

.font-picker-trigger:hover:not(:disabled) {
    border-color: #bbb;
}

.font-picker-trigger:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.font-picker-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-picker-arrow {
    flex-shrink: 0;
    transition: transform 0.2s;
    color: #666;
}

.font-picker.open .font-picker-arrow {
    transform: rotate(180deg);
}

.font-picker-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 280px;
    max-height: 360px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    flex-direction: column;
    overflow: hidden;
}

.font-picker.open .font-picker-dropdown {
    display: flex;
}

.font-picker-search {
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    outline: none;
    flex-shrink: 0;
}

.font-picker-search::placeholder {
    color: #aaa;
}

.font-picker-list {
    overflow-y: auto;
    flex: 1;
    max-height: 310px;
}

.font-picker-group-label {
    padding: 8px 12px 4px;
    font-size: 10px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f8f8;
    position: sticky;
    top: 0;
    z-index: 1;
}

.font-picker-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.1s;
}

.font-picker-option:hover,
.font-picker-option.focused {
    background: #f0f0f0;
}

.font-picker-option.selected {
    background: #3e3d40;
    color: #fff;
}

.font-picker-option.selected:hover,
.font-picker-option.selected.focused {
    background: #555;
}

.font-picker-option.hidden {
    display: none;
}

.font-picker-no-results {
    padding: 16px 12px;
    color: #999;
    font-size: 13px;
    text-align: center;
    display: none;
}

/* Warning message box */
.warning-message {
    position: absolute;
    right: 260px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px 16px;
    padding-right: 32px;
    max-width: 250px;
    font-size: 13px;
    color: #856404;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.warning-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    color: #856404;
    cursor: pointer;
    padding: 0;
}

.warning-close:hover {
    color: #533f03;
}

.warning-message::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #ffc107;
    border-right: none;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Properties Content (JSON display) */
.properties-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.no-selection {
    color: #999;
    font-style: italic;
    font-size: 14px;
}

.element-json {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.storage-info {
    margin-top: 15px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 11px;
    color: #666;
}

.storage-info div {
    margin-bottom: 4px;
}

.storage-bar {
    height: 8px;
    background-color: #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}

.storage-bar-fill {
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.storage-bar-fill[style*="width: 7"],
.storage-bar-fill[style*="width: 8"],
.storage-bar-fill[style*="width: 9"] {
    background-color: #FF9800;
}

.storage-bar-fill[style*="width: 100"],
.storage-bar-fill[style*="width: 99"],
.storage-bar-fill[style*="width: 98"] {
    background-color: #f44336;
}

.property-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.property-group label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.property-group input[type="text"],
.property-group input[type="number"],
.property-group select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
}

.property-group input[type="color"] {
    width: 100%;
    height: 35px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.property-group input:focus,
.property-group select:focus {
    outline: none;
    border-color: #3e3d40;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px;
    overflow: auto;
    background-color: #e8e8e8;
}

#designCanvas {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background-color: #fff;
}

/* Fabric.js Controls Styling */
.canvas-container .upper-canvas {
    cursor: default !important;
}

/* Right Panel with Accordion */
.right-panel {
    width: 250px;
    background-color: #fff;
    border-left: 1px solid #ddd;
    overflow-y: auto;
}

/* Accordion */
.accordion {
    display: flex;
    flex-direction: column;
}

.accordion-item {
    border-bottom: 1px solid #ddd;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f8f8;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #555;
    transition: background-color 0.2s;
}

.accordion-header:hover {
    background-color: #f0f0f0;
}

.accordion-header.active {
    background-color: #3e3d40;
    color: #fff;
}

.accordion-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.open {
    max-height: 600px;
    overflow-y: auto;
}

/* Export Section */
.export-buttons {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-btn {
    padding: 10px 15px;
    background-color: #3e3d40;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.export-btn:hover {
    background-color: #555;
}

.export-btn-secondary {
    background-color: #fff;
    color: #3e3d40;
    border: 1px solid #3e3d40;
}

.export-btn-secondary:hover {
    background-color: #f0f0f0;
}

.export-separator {
    height: 1px;
    background-color: #ddd;
    margin: 5px 0;
}

/* Zoom Section */
.zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}

#zoomLevel {
    font-size: 14px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.zoom-slider {
    width: calc(100% - 30px);
    margin: 0 15px 15px;
}

.zoom-reset-btn {
    display: block;
    width: calc(100% - 30px);
    margin: 0 15px 15px;
    padding: 8px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.zoom-reset-btn:hover {
    background-color: #e0e0e0;
}

.layers-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.no-layers {
    color: #999;
    font-style: italic;
    font-size: 14px;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    background-color: #fff;
}

.layer-item:hover {
    background-color: #f5f5f5;
    border-color: #ddd;
}

.layer-item.active {
    background-color: #3e3d40;
    color: #fff;
    border-color: #3e3d40;
}

.layer-item.active .layer-type {
    color: #ccc;
}

.layer-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.layer-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layer-type {
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
}

/* Layer Drag & Drop */

.layer-item.dragging {
    opacity: 0.5;
    background-color: #e0e0e0;
}

.layer-item.drag-over-top {
    border-top: 2px solid #3e3d40;
    margin-top: -1px;
}

.layer-item.drag-over-bottom {
    border-bottom: 2px solid #3e3d40;
    margin-bottom: -1px;
}

.layer-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.layer-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    color: #666;
}

.layer-btn:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

.layer-item.active .layer-btn {
    border-color: #666;
    background: #555;
    color: #fff;
}

.layer-item.active .layer-btn:hover {
    background: #444;
}

.layer-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.layer-btn:disabled:hover {
    background: #f5f5f5;
    border-color: #ddd;
}

.layer-item.active .layer-btn:disabled {
    background: #555;
}

.layer-item.active .layer-btn:disabled:hover {
    background: #555;
}

.layer-btn.layer-delete {
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-btn.layer-delete:hover {
    background: #fee;
    border-color: #d32f2f;
    color: #d32f2f;
}

.layer-btn.layer-delete:hover svg {
    stroke: #d32f2f;
}

.layer-item.active .layer-btn.layer-delete:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}

.layer-item.active .layer-btn.layer-delete:hover svg {
    stroke: #fff;
}

/* Footer */
.footer {
    background-color: #3e3d40;
    color: #999;
    padding: 10px 20px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer .version {
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: #999;
    text-decoration: none;
}

.footer-links a:hover {
    color: #ccc;
}

/* Responsive */
@media (max-width: 900px) {
    .right-panel {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .right-panel {
        width: 180px;
    }

    .toolbar-btn {
        min-width: 60px;
        padding: 6px 12px;
    }

    .btn-icon {
        font-size: 18px;
    }

    .btn-label {
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .main-content {
        flex-direction: column;
    }

    .right-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
    }

    .canvas-container {
        padding: 15px;
        order: -1;
    }
}

/* ==================== Header Actions ==================== */

.header-spacer {
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.header-btn svg {
    flex-shrink: 0;
}

.header-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

.header-btn-primary {
    background: #888;
    border-color: #888;
}

.header-btn-primary:hover {
    background: #777;
}

/* Grün nur wenn es Änderungen gibt */
.header-btn-primary.has-changes {
    background: #4CAF50;
    border-color: #4CAF50;
}

.header-btn-primary.has-changes:hover {
    background: #43A047;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-wrapper {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #f44336;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: #666;
    justify-content: center;
}

.user-btn span {
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-btn span svg {
    display: block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-header {
    padding: 12px 16px;
}

.dropdown-header strong {
    display: block;
    color: #333;
    font-size: 14px;
}

.dropdown-header small {
    color: #666;
    font-size: 12px;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item-danger {
    color: #f44336;
}

.dropdown-item-danger:hover {
    background: #ffebee;
}

/* ==================== Modals ==================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.2s ease;
}

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

.modal-small { width: 100%; max-width: 400px; }
.modal-medium { width: 100%; max-width: 500px; }
.modal-large { width: 100%; max-width: 700px; }
.modal-auth { width: 100%; max-width: 420px; }

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal h2 {
    margin: 0 0 20px;
    padding-right: 48px;
    font-size: 20px;
    color: #333;
}

.modal p {
    padding-right: 48px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ==================== Profile Modal ==================== */

.profile-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 2px solid #eee;
}

.profile-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.profile-tab:hover {
    color: #333;
}

.profile-tab.active {
    color: var(--primary-color);
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

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

.profile-tab-content h3 {
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* ==================== Delete Modal ==================== */

#deleteModal.open {
    z-index: 3000 !important;
}

.delete-warning {
    color: #666;
    margin-bottom: 8px;
}

.delete-design-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    background: #f5f5f5;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    word-break: break-word;
}

/* ==================== Auth Modal ==================== */

.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 2px solid #eee;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.auth-tab:hover {
    color: #333;
}

.auth-tab.active {
    color: #3e3d40;
    border-bottom-color: #3e3d40;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==================== Forms ==================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3e3d40;
}

.form-hint {
    font-size: 12px;
    color: #888;
}

.form-error {
    color: #f44336;
    font-size: 13px;
    padding: 8px 12px;
    background: #ffebee;
    border-radius: 4px;
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

.form-success {
    color: #2e7d32;
    font-size: 13px;
    padding: 8px 12px;
    background: #e8f5e9;
    border-radius: 4px;
    display: none;
}

.form-success:not(:empty) {
    display: block;
}

.forgot-password-link {
    text-align: right;
    margin-top: -8px;
    margin-bottom: 8px;
}

.forgot-password-link a {
    color: #6b7280;
    font-size: 13px;
    text-decoration: none;
}

.forgot-password-link a:hover {
    color: #4f46e5;
}

.form-info {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.back-to-login {
    text-align: center;
    margin-top: 12px;
}

.back-to-login a {
    color: #6b7280;
    font-size: 13px;
    text-decoration: none;
}

.back-to-login a:hover {
    color: #4f46e5;
}

/* ==================== Buttons ==================== */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #3e3d40;
    color: #fff;
}

.btn-primary:hover {
    background: #555;
}

.btn-primary:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Unsaved Changes Indicator - entfernt, Farbwechsel reicht aus */

/* Progress Bar für Speichern/Laden */
.save-progress,
.load-progress {
    width: 100%;
    margin-bottom: 15px;
}

.save-progress-bar,
.load-progress-bar {
    height: 8px;
    background: #4CAF50;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    margin-bottom: 5px;
}

.save-progress-text,
.load-progress-text {
    font-size: 12px;
    color: #666;
    text-align: center;
}

.load-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.load-overlay-content {
    background: white;
    padding: 30px 50px;
    border-radius: 8px;
    text-align: center;
    min-width: 300px;
}

.load-overlay-content h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.btn-danger {
    background: #f44336;
    color: #fff;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    font-weight: 500;
}

.btn-google:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn-google .google-icon {
    flex-shrink: 0;
}

.btn-apple {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    font-weight: 500;
    margin-top: 8px;
}

.btn-apple:hover {
    background: #333;
    border-color: #333;
}

.btn-apple .apple-icon {
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: #999;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.auth-divider span {
    padding: 0 12px;
}

/* ==================== Designs List ==================== */

.designs-list {
    margin-top: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.design-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.design-card:hover {
    border-color: #3e3d40;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.design-thumbnail {
    aspect-ratio: 3/1;
    height:300;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ccc;
}

.design-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.design-info {
    padding: 12px;
}

.design-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.design-date {
    font-size: 12px;
    color: #888;
}

.design-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.design-actions button {
    flex: 1;
    padding: 6px;
    font-size: 12px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ==================== Design Accordion ==================== */

.design-accordion {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.design-accordion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    background: #e8e8e8;
    transition: background 0.2s;
}

.design-accordion-header:hover {
    background: #dcdcdc;
}

.design-accordion-thumbnail {
    width: 320px;
    height: 108px;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ccc;
    flex-shrink: 0;
}

.design-accordion-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.design-accordion-info {
    flex: 1;
    min-width: 0;
}

.design-accordion-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.design-accordion-meta {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.design-id {
    color: #999;
    font-size: 0.85em;
    font-weight: normal;
}

.design-accordion-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.design-accordion-actions button {
    padding: 4px 10px;
    font-size: 12px;
}

.design-accordion-arrow {
    font-size: 12px;
    color: #888;
    transition: transform 0.2s;
}

.design-accordion-arrow.open {
    transform: rotate(180deg);
}

.design-accordion-content {
    display: none;
    border-top: 1px solid #eee;
    background: #fff;
}

.design-accordion-content.open {
    display: block;
}

.design-version {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 32px;
    border-bottom: 1px solid #e8e8e8;
    background: #f5f5f5;
}

.design-version:first-child {
    display: none;
}

.design-version:last-child {
    border-bottom: none;
}

.design-version-thumbnail {
    width: 320px;
    height: 108px;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ccc;
    flex-shrink: 0;
}

.design-version-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.design-version-date {
    flex: 1;
    font-size: 13px;
    color: #555;
}

.design-version-actions {
    display: flex;
    gap: 6px;
}

.design-version-actions button {
    padding: 4px 10px;
    font-size: 12px;
}

/* ==================== Cart ==================== */

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #e8e8e8;
    border-bottom: 1px solid #d0d0d0;
}

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

.cart-item:first-child {
    border-radius: 8px 8px 0 0;
}

.cart-item:last-child {
    border-radius: 0 0 8px 8px;
}

.cart-item:only-child {
    border-radius: 8px;
}

/* Cart Item Thumbnail - same size as design list */
.cart-item-thumbnail {
    width: 320px;
    height: 108px;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.cart-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cart-item-thumbnail img.loaded {
    opacity: 1;
}

.cart-item-thumbnail .thumbnail-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.cart-item-placeholder {
    font-size: 32px;
    color: #ccc;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-meta {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.cart-item-meta strong {
    color: #333;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-tier-info {
    margin-top: 16px;
    padding: 12px;
    background: #f0f7ff;
    border-radius: 8px;
    font-size: 13px;
    color: #1a5276;
    border: 1px solid #d4e6f1;
}

.cart-tier-info--best {
    background: #eafaf1;
    color: #1e8449;
    border-color: #a9dfbf;
}

.cart-tier-info .tier-row {
    padding: 3px 0;
}

.cart-tier-info .tier-remaining {
    color: #e67e22;
    font-weight: 600;
}

.cart-tier-info .tier-label {
    color: #7f8c8d;
    font-size: 12px;
}

.cart-tier-info .tier-icon {
    font-weight: 700;
    margin-right: 4px;
}

.cart-summary {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
}

.cart-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
}

.cart-total {
    font-weight: 600;
    font-size: 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

/* Quantity Buttons */
.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.qty-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.qty-btn:active {
    background: #eee;
}

.cart-item-qty input {
    width: 65px;
    padding: 4px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Cart Item Remove Button - matches design list style */
.cart-item-remove {
    padding: 4px 10px;
    font-size: 12px;
}

/* ==================== Toast Notifications ==================== */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3000;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toastSlideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-success { background: #4CAF50; }
.toast-error { background: #f44336; }
.toast-warning { background: #ff9800; }
.toast-info { background: #2196F3; }

.toast-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
}

.toast-close:hover {
    opacity: 1;
}


/* ==================== Loading ==================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #888;
}

/* Thumbnail Loading Spinner */
.thumbnail-loading {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #ddd;
    border-top-color: #888;
    border-radius: 50%;
    animation: thumbnail-spin 0.8s linear infinite;
}

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

.design-accordion-thumbnail img,
.design-version-thumbnail img {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.design-accordion-thumbnail img.loaded,
.design-version-thumbnail img.loaded {
    opacity: 1;
}

.design-accordion-thumbnail .thumbnail-loading,
.design-version-thumbnail .thumbnail-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}


/* ==================== Checkout Modal ==================== */

.checkout-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 0 10px;
}

.checkout-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.checkout-step::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #ddd;
    z-index: 0;
}

.checkout-step:last-child::after {
    display: none;
}

.checkout-step.completed::after {
    background: #4CAF50;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.checkout-step.active .step-number {
    background: #3e3d40;
    color: #fff;
}

.checkout-step.completed .step-number {
    background: #4CAF50;
    color: #fff;
}

.step-label {
    font-size: 11px;
    color: #888;
    margin-top: 6px;
    text-align: center;
}

.checkout-step.active .step-label {
    color: #333;
    font-weight: 500;
}

.checkout-step.completed .step-label {
    color: #4CAF50;
}

/* Checkout Form */

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row.two-cols .form-group:first-child {
    flex: 0 0 120px;
}

.form-row.two-cols .form-group:last-child {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
}

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

.checkbox-group label {
    cursor: pointer;
    font-weight: normal;
    font-size: 14px;
}

/* Order Summary in Checkout */

.order-summary {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
}

.order-summary-row:last-child {
    margin-bottom: 0;
}

.order-summary-row.total {
    font-weight: 600;
    font-size: 16px;
    border-top: 1px solid #ddd;
    padding-top: 12px;
    margin-top: 12px;
}

/* Payment Methods */

.payment-methods {
    margin-top: 20px;
}

.payment-methods h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #333;
}

#paypal-button-container {
    max-width: 400px;
}

.payment-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #999;
    font-size: 13px;
}

.payment-divider::before,
.payment-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.payment-divider span {
    padding: 0 12px;
}

#amazon-pay-button {
    max-width: 400px;
}

/* Checkout Actions */

.checkout-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* Order Success */

.order-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #4CAF50;
    color: #fff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.order-success h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #333;
}

.order-success p {
    color: #666;
    margin-bottom: 8px;
}

.design-accordion-thumbnail,
.design-version-thumbnail {
    position: relative;
}
