/* Стили для редактора текста */

.text-editor-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.text-editor-row {
    margin-bottom: 20px;
}

.text-editor-column {
    display: inline-block;
    width: 48%;
    margin-right: 2%;
    vertical-align: top;
}

.text-editor-column:last-child {
    margin-right: 0;
}

.text-editor-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.text-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: both;
    background: #fff; /* поле ввода — белое */
    color: #000;
    overflow: auto;
    box-sizing: border-box;
}

.text-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.text-editor-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    cursor: pointer;
}

.text-editor-select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.text-editor-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.text-editor-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.text-editor-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.text-editor-slider:focus {
    outline: none;
}

.text-editor-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.text-editor-slider:focus::-moz-range-thumb {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.color-swatches {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-swatch:hover {
    border-color: #10b981;
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.text-preview {
    min-height: 60px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #000; /* фон предпросмотра — чёрный (имитация камня) */
    font-size: 16px;
    line-height: 1.5;
    color: #fff; /* дефолтный цвет текста на чёрном фоне */
    font-weight: bold;
}

.text-editor-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #10b981;
    color: white;
}

.btn-primary:hover {
    background: #059669;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Стили оформления текста для предпросмотра */
.text-preview.text-style-1 {
    /* Стандартное - без дополнительных эффектов */
}

.text-preview.text-style-2 {
    /* Контур */
    -webkit-text-stroke: 2px #ffffff;
    text-stroke: 2px #ffffff;
    paint-order: stroke fill;
}

.text-preview.text-style-3 {
    /* Контур с серой заливкой */
    -webkit-text-stroke: 2px #ffffff;
    text-stroke: 2px #ffffff;
    background-color: rgba(128, 128, 128, 0.3);
    padding: 8px;
    border-radius: 4px;
    paint-order: stroke fill;
}

.text-preview.text-style-4 {
    /* Контур с мягкой тенью */
    -webkit-text-stroke: 2px #ffffff;
    text-stroke: 2px #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    paint-order: stroke fill;
}

.text-preview.text-style-5 {
    /* Теневой с отступом */
    color: #ffffff !important;
    text-shadow: 2px 2px 0px var(--original-color, currentColor);
}

.text-preview.text-style-6 {
    /* Теневой плавный */
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

.text-preview.text-style-7 {
    /* На белом фоне */
    background-color: rgba(255, 255, 255, 0.9);
    color: #000000 !important;
    padding: 8px;
    border-radius: 4px;
}

/* Дополнительная поддержка для Firefox */
@-moz-document url-prefix() {
    .text-preview.text-style-2,
    .text-preview.text-style-3,
    .text-preview.text-style-4 {
        text-shadow: 
            -2px -2px 0 #ffffff,
            -2px 2px 0 #ffffff,
            2px -2px 0 #ffffff,
            2px 2px 0 #ffffff;
    }
    
    .text-preview.text-style-4 {
        text-shadow: 
            -2px -2px 0 #ffffff,
            -2px 2px 0 #ffffff,
            2px -2px 0 #ffffff,
            2px 2px 0 #ffffff,
            2px 2px 4px rgba(0, 0, 0, 0.3);
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .text-editor-container {
        padding: 15px;
    }
    
    .text-editor-column {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .text-editor-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
