/* == Image Border ================================================= */
/* Prefix: ib-   Accent: #8B5CF6                                    */

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

.ib-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;
}
.ib-upload-zone:hover, .ib-upload-zone:focus, .ib-upload-zone.ib-drag-over {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.08);
}
.ib-upload-icon { font-size: 3rem; color: #8B5CF6; opacity: 0.7; margin-bottom: 14px; display: block; }
.ib-upload-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin: 0 0 6px; }
.ib-upload-sub   { font-size: 1rem; color: var(--text-secondary); margin: 0; }

/* -- Layout -------------------------------------------------------- */
.ib-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 24px;
}
.ib-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;
}
.ib-col-controls::-webkit-scrollbar { width: 4px; }
.ib-col-controls::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 4px; }
.ib-col-preview { min-width: 0; }

/* -- Panel sections ------------------------------------------------ */
.ib-panel-section {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
}
.ib-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;
}

/* -- Style tabs ---------------------------------------------------- */
.ib-style-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.ib-style-tab {
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(139,92,246,0.3);
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.ib-style-tab:hover { border-color: #8B5CF6; color: #8B5CF6; }
.ib-style-tab.active { background: #8B5CF6; border-color: #8B5CF6; color: #fff; }

/* -- Number input -------------------------------------------------- */
.ib-number-row { display: flex; align-items: center; gap: 0.6rem; }
.ib-number-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex: 1;
}
.ib-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;
}
.ib-number-input::-webkit-inner-spin-button,
.ib-number-input::-webkit-outer-spin-button { opacity: 1; }
.ib-number-input:focus { border-color: #8B5CF6; }
.ib-unit-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

/* -- Select -------------------------------------------------------- */
.ib-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;
}
.ib-select:focus { border-color: #8B5CF6; }

/* -- Color row ----------------------------------------------------- */
.ib-color-row { display: flex; align-items: center; gap: 0.6rem; }
.ib-color-input {
    width: 40px; height: 36px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
}

/* -- Checkbox ------------------------------------------------------ */
.ib-check-label {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.9375rem; font-weight: 600;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
}
.ib-check-label input[type="checkbox"] { accent-color: #8B5CF6; width: 15px; height: 15px; cursor: pointer; }

/* -- Actions ------------------------------------------------------- */
.ib-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ib-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;
}
.ib-btn-secondary { background: transparent; border-color: #8B5CF6; color: #8B5CF6; }
.ib-btn-secondary:hover { background: rgba(139,92,246,0.08); }
.ib-btn-ghost { background: #F1F5F9; color: var(--text-secondary, #64748b); border-color: rgba(100,116,139,0.2); }
.ib-btn-ghost:hover { border-color: #8B5CF6; color: #8B5CF6; }

/* -- Preview wrap -------------------------------------------------- */
.ib-preview-wrap {
    border-radius: 10px;
    border: 1px solid rgba(139,92,246,0.2);
    background: repeating-conic-gradient(#e2e8f0 0% 25%, #f8fafc 0% 50%) 0 0 / 20px 20px;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ib-canvas-out { max-width: 100%; height: auto; display: block; }

/* -- Responsive ---------------------------------------------------- */
@media (max-width: 860px) {
    .ib-layout { grid-template-columns: 1fr; }
    .ib-col-controls { position: static; max-height: none; }
}
