/* == Image Text Overlay ============================================= */
/* Prefix: ito-   Accent: #8B5CF6                                       */

.ito-section {
    padding: 40px 0 80px;
}

.ito-upload-zone {
    border: 2px dashed rgba(139, 92, 246, 0.35);
    border-radius: 16px;
    background: rgba(139, 92, 246, 0.04);
    padding: 56px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}

.ito-upload-zone:hover,
.ito-upload-zone:focus,
.ito-upload-zone.ito-drag-over {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.08);
}

.ito-upload-icon {
    font-size: 3rem;
    color: #8B5CF6;
    opacity: 0.7;
    margin-bottom: 14px;
    display: block;
}

.ito-upload-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.ito-upload-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* -- Layout --------------------------------------------------------- */
.ito-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 24px;
}

.ito-col-controls {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
    padding-right: 4px;
}

.ito-col-controls::-webkit-scrollbar {
    width: 4px;
}

.ito-col-controls::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 4px;
}

.ito-col-preview {
    min-width: 0;
}

/* -- Panel sections ------------------------------------------------- */
.ito-panel-section {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.ito-panel-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ito-val-badge {
    display: inline-block;
    background: rgba(139, 92, 246, 0.15);
    color: #8B5CF6;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 0.8125rem;
    font-family: monospace;
}

.ito-number-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ito-number-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* -- Number input --------------------------------------------------- */
.ito-number-input {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    color: var(--text-primary, #0f172a);
    font-size: 0.9375rem;
    font-weight: 500;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.ito-number-input::-webkit-inner-spin-button,
.ito-number-input::-webkit-outer-spin-button {
    opacity: 1;
}

.ito-number-input:focus {
    border-color: #8B5CF6;
}

.ito-unit-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

/* -- Textarea ------------------------------------------------------- */
.ito-textarea {
    width: 100%;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    color: var(--text-primary, #0f172a);
    font-size: 0.9375rem;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.ito-textarea:focus {
    border-color: #8B5CF6;
}

/* -- Select --------------------------------------------------------- */
.ito-select {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #fff;
    color: var(--text-primary, #0f172a);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

.ito-select:focus {
    border-color: #8B5CF6;
}

/* -- Slider --------------------------------------------------------- */
.ito-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(139, 92, 246, 0.2);
    outline: none;
    cursor: pointer;
}

.ito-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8B5CF6;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

/* -- Style row ------------------------------------------------------ */
.ito-style-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ito-align-btns,
.ito-style-btns {
    display: flex;
    gap: 5px;
}

.ito-align-btn,
.ito-style-btn {
    width: 34px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ito-align-btn:hover,
.ito-style-btn:hover {
    border-color: #8B5CF6;
    color: #8B5CF6;
}

.ito-align-btn.active,
.ito-style-btn.active {
    background: #8B5CF6;
    border-color: #8B5CF6;
    color: #fff;
}

/* -- Color row ------------------------------------------------------ */
.ito-color-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ito-color-input {
    width: 40px;
    height: 36px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
}

/* -- Checkbox toggle ------------------------------------------------ */
.ito-check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
}

.ito-check-label input[type="checkbox"] {
    accent-color: #8B5CF6;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* -- Actions -------------------------------------------------------- */
.ito-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ito-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.ito-btn-primary {
    background: #8B5CF6;
    color: #fff;
    border-color: #8B5CF6;
}

.ito-btn-primary:hover {
    filter: brightness(1.1);
}

.ito-btn-secondary {
    background: transparent;
    border-color: #8B5CF6;
    color: #8B5CF6;
}

.ito-btn-secondary:hover {
    background: rgba(139, 92, 246, 0.08);
}

.ito-btn-ghost {
    background: #F1F5F9;
    color: var(--text-secondary, #64748b);
    border-color: rgba(100, 116, 139, 0.2);
}

.ito-btn-ghost:hover {
    border-color: #8B5CF6;
    color: #8B5CF6;
}

/* -- Preview wrap --------------------------------------------------- */
.ito-preview-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: #f1f5f9;
    cursor: move;
}

.ito-canvas-out {
    width: 100%;
    height: auto;
    display: block;
}

/* -- Responsive ----------------------------------------------------- */
@media (max-width: 860px) {
    .ito-layout {
        grid-template-columns: 1fr;
    }

    .ito-col-controls {
        position: static;
        max-height: none;
    }
}