/* ==========================================================================
   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-icon img { width: 128px; height: 128px; border-radius: 20px; margin: -14px 0; }
.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; }

/* Hide HowTo AND SEO section once user enters production page */
body:has(.image-preview-container[style*="display: block"]) .idphoto-process-section,
body:has(.image-preview-container[style*="display: block"]) .cc-seo-section {
    display: none !important;
}

/* ==========================================================================
   SEO knowledge section — long-form content below the How-To
   ========================================================================== */
.cc-seo-section {
    max-width: 1200px;
    margin: 3rem auto 2rem;
    padding: 0 1rem;
    color: #374151;
    line-height: 1.7;
    font-size: 15px;
}
.cc-seo-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 2.25rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #ede9fe;
}
.cc-seo-section h2:first-child { margin-top: 0; }
.cc-seo-section h3 {
    font-size: 17px;
    font-weight: 600;
    color: #4338ca;
    margin: 1.5rem 0 0.5rem;
}
.cc-seo-section p { margin: 0 0 0.85rem; }
.cc-seo-section strong { color: #111827; }
.cc-seo-section em { color: #6b7280; font-style: italic; }
.cc-seo-section code {
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    color: #4338ca;
}
.cc-seo-section kbd {
    background: #fff;
    border: 1px solid #d1d5db;
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: #374151;
}

.cc-doc-list,
.cc-seo-section ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}
.cc-doc-list li,
.cc-seo-section ol li {
    margin: 0.35rem 0;
    line-height: 1.65;
}

.cc-doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1.25rem;
    font-size: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.cc-doc-table th,
.cc-doc-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}
.cc-doc-table th {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #4338ca;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cc-doc-table tr:last-child td { border-bottom: none; }
.cc-doc-table tr:nth-child(even) td { background: #fafbfc; }

.cc-faq h3 { margin-top: 1.75rem; }
.cc-faq h3::before {
    content: 'Q.';
    color: #4338ca;
    font-weight: 800;
    margin-right: 0.5rem;
}

/* Screenshot — full-width inside the .cc-seo-section container */
.cc-screenshot {
    margin: 1.5rem 0 2rem;
    padding: 0;
}
.cc-screenshot-img {
    display: block;
    width: 100%;          /* fill the text container (max-width 1200px) */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.cc-screenshot figcaption {
    margin-top: 0.6rem;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
    /* Force single-line display — user explicitly asked for no wrap */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .cc-seo-section { padding: 0 0.75rem; font-size: 14px; }
    .cc-seo-section h2 { font-size: 19px; }
    .cc-seo-section h3 { font-size: 15px; }
    .cc-doc-table { font-size: 13px; }
    .cc-doc-table th, .cc-doc-table td { padding: 8px; }
}

/* ==========================================================================
   Custom output size input + Image Border options
   ========================================================================== */
/* One-row layout: preset buttons on the left, custom input on the right */
.cc-size-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.cc-size-row .format-buttons {
    flex: 0 0 auto;
}
.cc-custom-size-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 14px;
    color: #374151;
}
.cc-custom-size-row input[type="number"] {
    width: 80px;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cc-custom-size-row input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
/* Hide the spinner buttons visually but keep them functional — most
   browsers render them as tiny up/down arrows inside the input. */
.cc-custom-size-row input[type="number"]::-webkit-outer-spin-button,
.cc-custom-size-row input[type="number"]::-webkit-inner-spin-button {
    opacity: 1;  /* show spinners — user explicitly asked for them */
    height: 22px;
}

.cc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0;
}
.cc-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color, #6366f1);
}

.cc-border-options {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-left: 3px solid var(--primary-color, #6366f1);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    animation: cc-border-slide-in 0.18s ease-out;
}
@keyframes cc-border-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cc-border-options[hidden] { display: none; }

.cc-border-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 14px;
}
.cc-border-row label {
    width: 48px;
    color: #374151;
    font-weight: 500;
    margin-bottom: 0;
    font-size: 14px;
}
.cc-border-row input[type="color"] {
    width: 44px;
    height: 28px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}
.cc-border-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.cc-border-row input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}
.cc-border-row input[type="number"] {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    color: #111827;
    background: #fff;
}
.cc-border-row input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
