/* Edit Mode Styles - Reusable module */

.edit-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    cursor: pointer;
    padding: 10px;
}

.red-dot {
    width: 20px;
    height: 20px;
    background: #ff3b3b;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 59, 59, 0.5);
    transition: all 0.3s ease;
}

.edit-toggle:hover .red-dot {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 59, 59, 0.8);
}

.edit-toggle.active .red-dot {
    background: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.8);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.edit-controls {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(10px);
    font-family: sans-serif;
    min-width: 150px;
}

.control-label {
    color: #00ff88;
    font-size: 12px;
    margin-bottom: 10px;
    text-align: center;
    font-weight: bold;
}

.size-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.size-controls button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.size-controls button:hover {
    background: rgba(255, 255, 255, 0.4);
}

#size-display {
    color: white;
    font-size: 14px;
    min-width: 50px;
    text-align: center;
}


/* Layer Controls */
.layer-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.layer-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

.layer-controls button {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.layer-controls button:hover {
    background: rgba(0, 255, 136, 0.4);
}

#layer-display {
    color: #00ff88;
    font-size: 13px;
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

/* Text Controls */
.text-controls {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.text-controls.hidden {
    display: none;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.control-row label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    min-width: 40px;
}

.control-row input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: transparent;
}

.control-row select {
    flex: 1;
    padding: 5px 8px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 11px;
    cursor: pointer;
}

.control-row select option {
    background: #333;
    color: white;
}

.style-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.style-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.style-btn.active {
    background: #00ff88;
    color: #000;
}

/* Alignment Controls */
.align-controls {
    gap: 5px !important;
}

.align-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.align-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.align-btn.active {
    background: #00ff88;
    color: #000;
}

.text-align-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-align-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.text-align-btn.active {
    background: #00ff88;
    color: #000;
}

#align-controls {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

/* Add Element Button */
.add-element-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(135deg, #4a5fd9, #2a3a8f);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    font-weight: bold;
}

.add-element-btn:hover {
    background: linear-gradient(135deg, #5a6fe9, #3a4a9f);
    transform: translateY(-1px);
}

.reset-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 59, 59, 0.5);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: rgba(255, 59, 59, 0.8);
}

.edit-controls.hidden {
    display: none;
}

/* Add Element Modal */
.add-element-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.add-element-modal.hidden {
    display: none;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 15px;
    width: 90%;
    max-width: 350px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header span {
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: white;
}

.modal-body {
    padding: 20px;
}

.element-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.type-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: transparent;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.type-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.type-btn.active {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.file-input-wrapper,
.url-input-wrapper {
    margin-bottom: 15px;
}

.file-input-wrapper label,
.url-input-wrapper label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-bottom: 8px;
}

.file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 12px;
    cursor: pointer;
}

.file-input-wrapper input[type="file"]:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.url-input-wrapper input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 13px;
    box-sizing: border-box;
}

.url-input-wrapper input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.url-input-wrapper input[type="text"]:focus {
    outline: none;
    border-color: #00ff88;
}

.add-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: #000;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.3);
}

/* Added Elements */
.added-element {
    cursor: move;
}

/* Editable elements */
.editable {
    transition: outline 0.2s, box-shadow 0.2s;
}

.editable.edit-active {
    cursor: move;
    outline: 2px dashed rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

.editable.edit-active:hover {
    outline-color: rgba(0, 255, 136, 0.5);
}

.editable.selected {
    outline: 2px solid #00ff88 !important;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

/* Add Buttons Row */
.add-buttons-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.add-text-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: serif;
}

.add-text-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.add-element-btn {
    flex: 1;
}

/* Add Text Modal */
.add-text-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.add-text-modal.hidden {
    display: none;
}

.text-input-wrapper {
    margin-bottom: 15px;
}

.text-input-wrapper label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-bottom: 8px;
}

.text-input-wrapper textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.text-input-wrapper textarea:focus {
    outline: none;
    border-color: #00ff88;
}

.text-input-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Added Text Elements */
.added-text {
    cursor: move;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Delete Button */
.delete-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 59, 59, 0.7);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.delete-btn:hover {
    background: rgba(255, 59, 59, 1);
    transform: translateY(-1px);
}

/* Save to HTML Button */
.save-html-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(135deg, #00c853, #00a040);
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.save-html-btn:hover {
    background: linear-gradient(135deg, #00e676, #00c853);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}