/* ==========================================================================
   Crop Circle page — styles
   Loaded only by /crop-circle/index.html alongside style.css.
   Self-contained per tool-board independence rule; .cc- prefix.
   ========================================================================== */

.cc-page-title {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin: 1.5rem 0 0.5rem;
}
.cc-page-subtitle {
    font-size: 18px;
    color: #6b7280;
    text-align: center;
    margin: 0 auto 1.5rem;
    line-height: 1.5;
}

/* ── Upload dropzone (mirrors upscale / blur-face template) ───────────── */
.cc-dropzone {
    width: 625px;
    height: 260px;
    transform: scale(1.6);
    margin: 8rem auto 10rem !important;
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
    background: var(--card-bg, #fff);
    border: 2px solid transparent;
    border-radius: var(--border-radius, 14px);
    padding: 2.8rem 1.5rem 2rem;
    text-align: center;
    box-shadow: var(--box-shadow, 0 1px 3px rgba(0,0,0,0.04));
    overflow: hidden;
    transition: all 0.3s ease;
}
.cc-dropzone::after {
    content: '';
    position: absolute;
    top: 1rem; left: 1rem; right: 1rem; bottom: 1rem;
    border: 2px dashed #c7d2fe;
    border-radius: 12px;
    pointer-events: none;
    z-index: 1;
}
.cc-dropzone-icon,
.cc-dropzone-text,
.cc-dropzone-hint {
    transform: scale(0.625);
    transform-origin: center;
    position: relative;
    z-index: 2;
}
.cc-dropzone-icon { color: #9aa0a6; margin-bottom: 0; display: flex; justify-content: center; }
.cc-dropzone-icon svg { width: 100px; height: 100px; fill: none !important; filter: none !important; }
.cc-dropzone-text { font-size: 26px; font-weight: 600; color: #1a1a1a; margin-bottom: 0; }
.cc-dropzone-hint { font-size: 17px; color: #80868b; }

.cc-dropzone:hover,
.cc-dropzone.dragover { transform: scale(1.6) translateY(-5px); }
.cc-dropzone:hover .cc-dropzone-icon,
.cc-dropzone.dragover .cc-dropzone-icon { color: #4285f4; }
.cc-dropzone.dragover { background: #e8f0fe; }
.cc-dropzone.dragover::after { border-color: #4285f4; border-style: solid; }

@media (max-width: 768px) {
    .cc-dropzone { transform: scale(1.2); margin: 2rem auto !important; }
    .cc-dropzone:hover, .cc-dropzone.dragover { transform: scale(1.2) translateY(-5px); }
}
@media (max-width: 480px) {
    .cc-dropzone { transform: scale(1.0); margin: 1.5rem auto !important; }
    .cc-dropzone:hover, .cc-dropzone.dragover { transform: scale(1.0) translateY(-5px); }
}

.cc-error-banner {
    margin: 16px 0;
    padding: 14px 18px;
    background: #fce8e6;
    border: 1px solid #f28b82;
    border-radius: 10px;
    color: #b3261e;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Progress overlay ─────────────────────────────────────────────────── */
.progress-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.progress-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 90vw;
}
.progress-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: cc-spin 1s linear infinite;
}
@keyframes cc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.cc-result-placeholder {
    color: #80868b;
    font-size: 15px;
    text-align: center;
    padding: 0 1rem;
    line-height: 1.5;
}

body:has(.image-preview-container[style*="display: block"]) .idphoto-process-section {
    display: none !important;
}

/* ── Controls layout override ────────────────────────────────────────── */
.page-crop-circle .compression-controls {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    padding: 1.5rem 2rem;
}
.page-crop-circle .controls-left {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0;
}
.page-crop-circle .controls-right {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-self: stretch;
    margin-top: 1rem;
}
.page-crop-circle .controls-right .compress-button,
.page-crop-circle .controls-right .download-button {
    flex: 0 0 calc(50% - 1rem);
    max-width: calc(50% - 1rem);
    width: auto;
    height: auto;
    margin-top: 0;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.page-crop-circle .compress-button {
    grid-column: auto; grid-row: auto;
    width: auto; height: auto;
    margin-top: 0; justify-self: auto; align-self: auto;
}
.page-crop-circle .controls-left > .control-group {
    margin-bottom: 0;
    max-width: calc(50% - 1rem);
}
.page-crop-circle .controls-left .control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.cc-privacy-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0.5rem;
    padding: 4px 12px;
    background: #ecfdf5;
    color: #047857;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

/* ==========================================================================
   Crop Circle overlay (draggable + resizable round crop selector)
   ========================================================================== */

/* Overlay container: absolute over .image-container, JS pins it to the
   image's actual rendered rect (object-fit:contain math). */
.cc-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}
.cc-overlay .cc-crop-circle {
    pointer-events: auto;
}

/* The circle: visually a perfect circle (border-radius:50%) drawn as a div.
   Inline left/top/width/height set by JS in display-pixel coords. */
.cc-crop-circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--primary-color, #6366f1);
    box-sizing: border-box;
    cursor: move;
    /* outer dim ring darkens the area outside the circle so users see what will be cropped away */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
    transition: border-color 0.15s ease;
}
.cc-crop-circle:hover {
    border-color: #4338ca;
}

/* Resize handles at the 4 corners (in the circle's bounding box) */
.cc-crop-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border: 2px solid var(--primary-color, #6366f1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 2;
    pointer-events: auto;
}
.cc-crop-handle.handle-nw { top: -7px; left: -7px;  cursor: nwse-resize; }
.cc-crop-handle.handle-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.cc-crop-handle.handle-sw { bottom: -7px; left: -7px;  cursor: nesw-resize; }
.cc-crop-handle.handle-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
