/* ==========================================
   Ojoo Image Crop Tools - Isolated Styles
   All selectors strictly scoped to .image-crop-page
   ========================================== */

.image-crop-page {
    --ic-primary: #0d6efd;
    --ic-accent: #6f42c1;
    --ic-success: #198754;
    --ic-card-bg: #ffffff;
    --ic-card-border: rgba(0, 0, 0, 0.08);
    --ic-card-hover-border: #0d6efd;
    --ic-text-primary: #212529;
    --ic-text-secondary: #6c757d;
    --ic-badge-bg: rgba(13, 110, 253, 0.1);
    --ic-dropzone-bg: #f8fafc;
    --ic-dropzone-border: #cbd5e1;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-bs-theme="dark"] .image-crop-page,
body.dark-mode .image-crop-page,
body.bg-dark .image-crop-page {
    --ic-card-bg: #1e2430;
    --ic-card-border: rgba(255, 255, 255, 0.1);
    --ic-card-hover-border: #4792ff;
    --ic-text-primary: #f8f9fa;
    --ic-text-secondary: #a0aec0;
    --ic-badge-bg: rgba(13, 110, 253, 0.25);
    --ic-dropzone-bg: #161b26;
    --ic-dropzone-border: #334155;
}

/* Breadcrumb & Header */
.image-crop-page .ic-breadcrumb {
    font-size: 0.875rem;
    color: var(--ic-text-secondary);
    margin-bottom: 0.75rem;
}

.image-crop-page .ic-breadcrumb a {
    color: var(--ic-primary);
    text-decoration: none;
    font-weight: 500;
}

.image-crop-page .ic-header {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.04) 0%, rgba(111, 66, 193, 0.04) 100%);
    border-bottom: 1px solid var(--ic-card-border);
    padding: 2.5rem 0 2rem 0;
}

.image-crop-page .ic-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--ic-primary) 0%, var(--ic-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.image-crop-page .ic-subtitle {
    font-size: 1.1rem;
    color: var(--ic-text-secondary);
    max-width: 800px;
    margin-bottom: 0;
}

/* Dropzone */
.image-crop-page .ic-dropzone {
    background: var(--ic-dropzone-bg);
    border: 2px dashed var(--ic-dropzone-border);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.image-crop-page .ic-dropzone:hover,
.image-crop-page .ic-dropzone.dragover {
    border-color: var(--ic-primary);
    background: var(--ic-badge-bg);
}

.image-crop-page .ic-dropzone-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--ic-badge-bg);
    color: var(--ic-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

/* Mode Pills */
.image-crop-page .ic-nav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--ic-card-border);
    padding-bottom: 1rem;
}

.image-crop-page .ic-mode-btn {
    background: var(--ic-card-bg);
    color: var(--ic-text-secondary);
    border: 1px solid var(--ic-card-border);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.image-crop-page .ic-mode-btn:hover {
    background: var(--ic-badge-bg);
    color: var(--ic-primary);
    border-color: var(--ic-primary);
}

.image-crop-page .ic-mode-btn.active {
    background: var(--ic-primary);
    color: #ffffff;
    border-color: var(--ic-primary);
    box-shadow: 0 3px 10px rgba(13, 110, 253, 0.25);
}

/* Crop Workspace Canvas */
.image-crop-page .ic-canvas-wrapper {
    position: relative;
    background: var(--ic-dropzone-bg);
    border: 1px solid var(--ic-card-border);
    border-radius: 16px;
    padding: 1rem;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
}

.image-crop-page .ic-image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.image-crop-page .ic-source-img {
    max-width: 100%;
    max-height: 520px;
    display: block;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

/* Crop Box Overlay */
.image-crop-page .ic-crop-box {
    position: absolute;
    border: 2px dashed #0d6efd;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    cursor: move;
    box-sizing: border-box;
    z-index: 10;
    transition: border-radius 0.2s ease;
}

.image-crop-page .ic-crop-box.circle-mask {
    border-radius: 50% !important;
}

/* Rule of Thirds Grid */
.image-crop-page .ic-grid-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.image-crop-page .ic-grid-h1 { top: 33.33%; left: 0; width: 100%; height: 1px; }
.image-crop-page .ic-grid-h2 { top: 66.66%; left: 0; width: 100%; height: 1px; }
.image-crop-page .ic-grid-v1 { left: 33.33%; top: 0; height: 100%; width: 1px; }
.image-crop-page .ic-grid-v2 { left: 66.66%; top: 0; height: 100%; width: 1px; }

/* Handle Handles */
.image-crop-page .ic-handle {
    width: 12px;
    height: 12px;
    background: #0d6efd;
    border: 2px solid #ffffff;
    border-radius: 50%;
    position: absolute;
    z-index: 12;
}

.image-crop-page .ic-handle-tl { top: -6px; left: -6px; cursor: nwse-resize; }
.image-crop-page .ic-handle-tr { top: -6px; right: -6px; cursor: nesw-resize; }
.image-crop-page .ic-handle-bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.image-crop-page .ic-handle-br { bottom: -6px; right: -6px; cursor: nwse-resize; }

.image-crop-page .ic-handle-tc { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.image-crop-page .ic-handle-bc { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.image-crop-page .ic-handle-ml { top: 50%; left: -6px; transform: translateY(-50%); cursor: ew-resize; }
.image-crop-page .ic-handle-mr { top: 50%; right: -6px; transform: translateY(-50%); cursor: ew-resize; }

/* Panels & Form Controls */
.image-crop-page .ic-panel {
    background: var(--ic-card-bg);
    border: 1px solid var(--ic-card-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.image-crop-page .ic-form-control {
    background: var(--ic-card-bg);
    color: var(--ic-text-primary);
    border: 1px solid var(--ic-card-border);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
}

.image-crop-page .ic-preset-chip {
    background: var(--ic-card-bg);
    color: var(--ic-text-primary);
    border: 1px solid var(--ic-card-border);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-crop-page .ic-preset-chip:hover,
.image-crop-page .ic-preset-chip.active {
    background: var(--ic-primary);
    color: #ffffff;
    border-color: var(--ic-primary);
}

/* Spec Chips */
.image-crop-page .ic-spec-chip {
    background: var(--ic-card-bg);
    border: 1px solid var(--ic-card-border);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ic-text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Responsive */
@media (max-width: 767.98px) {
    .image-crop-page .ic-title { font-size: 1.75rem; }
    .image-crop-page .ic-dropzone { padding: 2rem 1rem; }
    .image-crop-page .ic-nav-pills { flex-direction: column; }
    .image-crop-page .ic-mode-btn { width: 100%; }
}
