/*
 * BlooImageCrop — Styles
 * Utilise les CSS variables du design system bloo.Cards (--primary, --text, --surface, etc.)
 * Voir /docs/skills/bloo-image-crop/SKILL.md
 */

body.bic-locked { overflow: hidden; }

.bic-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 14, 20, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 180ms ease;
    font-family: Poppins, system-ui, -apple-system, sans-serif;
}
.bic-overlay.bic-visible { opacity: 1; }

.bic-modal {
    background: var(--surface, #1a1d26);
    color: var(--text, #eef0f6);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    transform: translateY(12px) scale(0.98);
    transition: transform 180ms ease;
}
.bic-overlay.bic-visible .bic-modal { transform: translateY(0) scale(1); }

.bic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}
.bic-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #eef0f6);
    letter-spacing: 0.2px;
}
.bic-close {
    background: transparent;
    border: none;
    color: var(--text-sub, #9aa1b1);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease, color 120ms ease;
    font-size: 14px;
}
.bic-close:hover { background: rgba(255,255,255,0.06); color: var(--text, #eef0f6); }

.bic-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
}

.bic-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bic-frame {
    position: relative;
    background: #000;
    overflow: hidden;
    border-radius: 8px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.bic-frame-circle {
    border-radius: 50%;
}
.bic-canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.bic-frame-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.25) inset;
}
.bic-frame-circle .bic-frame-border {
    border-radius: 50%;
}

.bic-help {
    margin: 0;
    color: var(--text-sub, #9aa1b1);
    font-size: 12px;
    text-align: center;
    max-width: 420px;
}

.bic-controls {
    display: flex;
    justify-content: center;
    padding: 4px 0 0;
}
.bic-zoom-label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    color: var(--text-sub, #9aa1b1);
}
.bic-zoom-label i { font-size: 12px; }
.bic-zoom {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--border, rgba(255,255,255,0.12));
    border-radius: 99px;
    outline: none;
    cursor: pointer;
}
.bic-zoom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary, #7c5cfc);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
}
.bic-zoom::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary, #7c5cfc);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
}

.bic-footer {
    padding: 14px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    background: var(--surface-2, rgba(255,255,255,0.02));
}
.bic-btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 140ms ease;
}
.bic-btn-ghost {
    background: transparent;
    border-color: var(--border, rgba(255,255,255,0.12));
    color: var(--text, #eef0f6);
}
.bic-btn-ghost:hover { background: rgba(255,255,255,0.04); }
.bic-btn-primary {
    background: var(--primary, #7c5cfc);
    color: #fff;
}
.bic-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 18px rgba(124, 92, 252, 0.35);
}
.bic-btn:focus-visible {
    outline: 2px solid var(--primary, #7c5cfc);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 600px) {
    .bic-overlay { padding: 0; }
    .bic-modal { max-height: 100vh; border-radius: 0; max-width: 100%; }
    .bic-body { padding: 14px; }
    .bic-footer { padding: 12px 14px; }
    .bic-btn { flex: 1; }
}
