/* Change Image Background AI  additions on top of app.css */
.cib-root { padding-top: 1rem; padding-bottom: 3rem; }

.cib-info-list { list-style: none; padding: 0; margin: 1rem 1rem 0; text-align: left; }
.cib-info-list li { padding: .5rem 0 .5rem 1.5rem; position: relative; color: #4b5563; font-size: .95rem; line-height: 1.5; }
.cib-info-list li::before { content: ""; position: absolute; left: 0; top: .85rem; width: 8px; height: 8px; border-radius: 50%; background-image: linear-gradient(to right, var(--gradient-primary), var(--gradient-secondary)); }

.workspace.cib-workspace { display: none; }
.workspace.cib-workspace.cib-open { display: block; }

.cib-image-section {
  background:
    linear-gradient(45deg, #f4f4f5 25%, transparent 25%),
    linear-gradient(-45deg, #f4f4f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f4f4f5 75%),
    linear-gradient(-45deg, transparent 75%, #f4f4f5 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 400px; position: relative;
}
.cib-canvas-wrap { display: inline-block; max-width: 100%; position: relative; }
.cib-canvas { position: relative; line-height: 0; box-shadow: 0 6px 18px rgba(0,0,0,.08); border-radius: 6px; overflow: hidden; background: #fff; display: inline-block; }
.cib-bg { position: absolute; inset: 0; background: #ffffff; background-size: cover; background-position: center; z-index: 0; }
.cib-fg-img { position: relative; display: block; max-width: 100%; max-height: 65vh; width: auto; height: auto; z-index: 1; }
.cib-fg-img:not([src]) { display: none; }
.cib-hint { font-size: .8rem; color: #6a7280; }
.cib-loading { position: absolute; inset: 0; background: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center; z-index: 5; }
.cib-loading[hidden] { display: none; }
.cib-loading .progressive-loader { margin: 0; }

.cib-options { min-height: 500px; }

.cib-tabs .button { padding: 8px 4px; font-size: 12px; flex-direction: column; gap: 2px; }
.cib-tabs .button svg { height: 16px; width: 16px; margin-right: 0; }
.cib-tabs .button span { font-size: 11px; }
.cib-tabs :nth-child(4) { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }

.cib-panel-hint { color: #6a7280; font-size: .85rem; margin-bottom: .75rem; }

.cib-color-chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; margin-top: .5rem; }
.cib-chip { aspect-ratio: 1/1; border: 2px solid #e4e7eb; border-radius: 10px; cursor: pointer; padding: 0; transition: transform .15s ease; }
.cib-chip:hover { transform: scale(1.05); }
.cib-chip.cib-active { border-color: var(--gradient-primary); box-shadow: 0 0 0 2px rgba(101,87,255,.15); }

.cib-current-bg { border: 1px solid #e4e7eb; border-radius: 10px; padding: 8px; background: #f8f9fa; }
.cib-current-bg-label { font-size: .75rem; color: #6a7280; margin-bottom: 4px; }
.cib-current-bg img { width: 100%; max-height: 120px; object-fit: cover; border-radius: 6px; display: block; }

.cib-preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.cib-preset { aspect-ratio: 1/1; border: 2px solid #e4e7eb; border-radius: 10px; cursor: pointer; padding: 0; background-size: cover; background-position: center; transition: transform .15s ease; }
.cib-preset:hover { transform: scale(1.05); }
.cib-preset.cib-active { border-color: var(--gradient-primary); box-shadow: 0 0 0 2px rgba(101,87,255,.15); }

.cib-search-row { display: flex; gap: .5rem; margin-bottom: .75rem; }
.cib-search-input { flex: 1 1 auto; margin-bottom: 0 !important; }
.cib-search-row .btn-style { padding: 8px 14px; }
.cib-pexels-status { font-size: .8rem; color: #6a7280; margin-bottom: .5rem; min-height: 1em; }
.cib-pexels-status.cib-error { color: #b42318; }
.cib-pexels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.cib-pexels-grid button { aspect-ratio: 1/1; border: 2px solid #e4e7eb; border-radius: 8px; cursor: pointer; padding: 0; overflow: hidden; background: #f4f4f5; }
.cib-pexels-grid button:hover { border-color: var(--gradient-primary); }
.cib-pexels-grid button.cib-active { border-color: var(--gradient-primary); box-shadow: 0 0 0 2px rgba(101,87,255,.15); }
.cib-pexels-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cib-pexels-credit { font-size: .7rem; color: #8892a3; margin-top: .5rem; margin-bottom: 0; text-align: right; }
.cib-pexels-credit a { color: #6557ff; text-decoration: none; }

.cib-download-block .editor-panel { border: 1px solid #e4e7eb; border-radius: 10px; padding: 12px 14px; background: #fff; }
.cib-download-block .ep-header { padding: 0 0 8px; }
.cib-download-block .ep-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: #55606f; }
.cib-num { font-size: .8rem; color: #222b3a; font-weight: 600; }
.cib-fmt-tabs { margin-top: .5rem; }
.cib-fmt-tabs :nth-child(3) { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.cib-reset-btn { width: 100%; }

@media (max-width: 767px) {
  .cib-image-section { min-height: 320px; padding: 12px !important; }
}
