/* ==========================================================================
   Grayscale Image page — styles
   Loaded only by /grayscale-image/index.html alongside style.css.
   Self-contained per tool-board independence rule; .gs- prefix.
   ========================================================================== */

.gs-page-title {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin: 1.5rem 0 0.5rem;
}
.gs-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) ───────────── */
.gs-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;
}
.gs-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;
}
.gs-dropzone-icon,
.gs-dropzone-text,
.gs-dropzone-hint {
    transform: scale(0.625);
    transform-origin: center;
    position: relative;
    z-index: 2;
}
.gs-dropzone-icon {
    color: #9aa0a6;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
}
.gs-dropzone-icon svg {
    width: 100px;
    height: 100px;
    fill: none !important;
    filter: none !important;
}
.gs-dropzone-text {
    font-size: 26px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0;
}
.gs-dropzone-hint {
    font-size: 17px;
    color: #80868b;
}

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

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

/* ── Error banner ─────────────────────────────────────────────────────── */
.gs-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;
}

/* ── Full-screen progress overlay (mirrors upscale) ──────────────────── */
.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: gs-spin 1s linear infinite;
}
@keyframes gs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

/* ── Result-pane placeholder ─────────────────────────────────────────── */
.gs-result-placeholder {
    color: #80868b;
    font-size: 15px;
    text-align: center;
    padding: 0 1rem;
    line-height: 1.5;
}

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

/* ── Controls layout override (1-col + stacked button row) ───────────── */
.page-grayscale-image .compression-controls {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    padding: 1.5rem 2rem;
}
.page-grayscale-image .controls-left {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0;
}
.page-grayscale-image .controls-right {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-self: stretch;
    margin-top: 1rem;
}
.page-grayscale-image .controls-right .compress-button,
.page-grayscale-image .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-grayscale-image .compress-button {
    grid-column: auto;
    grid-row: auto;
    width: auto;
    height: auto;
    margin-top: 0;
    justify-self: auto;
    align-self: auto;
}
.page-grayscale-image .controls-left > .control-group {
    margin-bottom: 0;
    max-width: calc(50% - 1rem);
}
.page-grayscale-image .controls-left .control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

/* ── Intensity slider ────────────────────────────────────────────────── */
.gs-strength-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.gs-strength-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: linear-gradient(to right, #d1d5db 0%, #6b7280 100%);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.gs-strength-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color, #6366f1);
    border: 3px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}
.gs-strength-row input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color, #6366f1);
    border: 3px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}
.gs-strength-value {
    min-width: 4ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--primary-color, #6366f1);
    font-weight: 600;
}

/* ── Privacy badge ───────────────────────────────────────────────────── */
.gs-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;
}

/* 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"]) .gs-seo-section {
    display: none !important;
}

/* ==========================================================================
   SEO knowledge section — long-form content below the How-To
   ========================================================================== */
.gs-seo-section {
    max-width: 1200px;
    margin: 3rem auto 2rem;
    padding: 0 1rem;
    color: #374151;
    line-height: 1.7;
    font-size: 15px;
}
.gs-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 #e5e7eb;
}
.gs-seo-section h2:first-child { margin-top: 0; }
.gs-seo-section h3 {
    font-size: 17px;
    font-weight: 600;
    color: #4338ca;
    margin: 1.5rem 0 0.5rem;
}
.gs-seo-section p { margin: 0 0 0.85rem; }
.gs-seo-section strong { color: #111827; }
.gs-seo-section em { color: #6b7280; font-style: italic; }
.gs-seo-section code {
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    color: #4338ca;
}
.gs-formula {
    background: #f9fafb;
    border-left: 3px solid #6366f1;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0 1rem;
}
.gs-formula code {
    background: transparent;
    padding: 0;
    font-size: 15px;
    color: #111827;
}

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

.gs-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;
}
.gs-doc-table th,
.gs-doc-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}
.gs-doc-table th {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.gs-doc-table tr:last-child td { border-bottom: none; }
.gs-doc-table tr:nth-child(even) td { background: #fafbfc; }

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

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