/* ==========================================================================
   EXIF Viewer page — styles
   Loaded only by /exif-viewer/index.html alongside style.css.
   Self-contained per tool-board independence rule; .ev- prefix.
   ========================================================================== */

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

/* ── Upload dropzone ──────────────────────────────────────────────────── */
.ev-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;
}
.ev-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;
}
.ev-dropzone-icon, .ev-dropzone-text, .ev-dropzone-hint {
    transform: scale(0.625); transform-origin: center;
    position: relative; z-index: 2;
}
.ev-dropzone-icon { color: #9aa0a6; margin-bottom: 0; display: flex; justify-content: center; }
.ev-dropzone-icon svg { width: 100px; height: 100px; fill: none !important; filter: none !important; }
.ev-dropzone-text { font-size: 26px; font-weight: 600; color: #1a1a1a; margin-bottom: 0; }
.ev-dropzone-hint { font-size: 17px; color: #80868b; }
.ev-dropzone:hover, .ev-dropzone.dragover { transform: scale(1.6) translateY(-5px); }
.ev-dropzone:hover .ev-dropzone-icon, .ev-dropzone.dragover .ev-dropzone-icon { color: #4285f4; }
.ev-dropzone.dragover { background: #e8f0fe; }
.ev-dropzone.dragover::after { border-color: #4285f4; border-style: solid; }

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

.ev-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;
}

.ev-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;
}

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

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

/* ── Workspace: image left, EXIF table right ─────────────────────────── */
.ev-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 900px) {
    .ev-workspace { grid-template-columns: 1fr; }
}

.ev-image-col h4, .ev-exif-col h4 {
    margin: 0 0 0.5rem;
    font-size: 14px; font-weight: 600;
    color: var(--text-color);
}

.ev-exif-scroll {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius, 12px);
    background: var(--card-bg, #fff);
}

/* ── EXIF table ───────────────────────────────────────────────────────── */
.ev-exif-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ev-exif-table tr:nth-child(even) td {
    background: #fafbfc;
}
.ev-exif-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    word-break: break-word;
}
.ev-exif-table td.ev-field {
    width: 38%;
    color: #6b7280;
    font-weight: 500;
}
.ev-exif-table td.ev-value {
    color: #111827;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ev-exif-table td.ev-value a {
    color: var(--primary-color, #6366f1);
    text-decoration: none;
}
.ev-exif-table td.ev-value a:hover { text-decoration: underline; }
.ev-exif-table td.ev-empty {
    text-align: center;
    color: #9ca3af;
    padding: 2rem 1rem;
    font-style: italic;
}
/* "Already clean" state — image has no metadata. Highlight positively. */
.ev-exif-table td.ev-empty.ev-empty-success {
    color: #047857;
    font-size: 18px;
    font-weight: 600;
    font-style: normal;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    padding: 2.5rem 1rem;
    border-top: 2px solid #10b981;
    border-bottom: 2px solid #10b981;
}

/* Placeholder shown when the browser can't decode the image format
   (HEIC, TIFF) but exifr still parsed metadata. */
.ev-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 280px;
    padding: 2rem 1.5rem;
    text-align: center;
    color: #6b7280;
    background:
        repeating-linear-gradient(45deg, #f9fafb 0 10px, #f3f4f6 10px 20px);
    border-radius: var(--border-radius-small, 8px);
}
.ev-preview-placeholder svg { color: #9ca3af; margin-bottom: 0.5rem; }
.ev-preview-placeholder strong { color: #374151; font-size: 16px; }
.ev-preview-placeholder small { font-size: 13px; line-height: 1.5; max-width: 320px; }

/* Group header row */
.ev-exif-table tr.ev-group-header td {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%) !important;
    color: #4338ca;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 12px;
    border-bottom: 1px solid #c4b5fd;
}
.ev-exif-table tr.ev-group-header + tr td { border-top: none; }

/* ── Controls layout ─────────────────────────────────────────────────── */
.page-metadata-viewer .compression-controls {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    padding: 1.5rem 2rem;
    margin-top: 1rem;
}
.page-metadata-viewer .controls-left {
    grid-column: 1; grid-row: 1;
    display: flex; flex-direction: column; gap: 1rem;
    margin-bottom: 0;
}
.page-metadata-viewer .controls-right {
    grid-column: 1; grid-row: 2;
    display: flex; flex-direction: row; gap: 2rem;
    align-self: stretch; margin-top: 1rem;
}
.page-metadata-viewer .controls-right .compress-button,
.page-metadata-viewer .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-metadata-viewer .compress-button {
    grid-column: auto; grid-row: auto;
    width: auto; height: auto;
    margin-top: 0; justify-self: auto; align-self: auto;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}
.page-metadata-viewer .compress-button:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}
.page-metadata-viewer .controls-left > .control-group {
    margin-bottom: 0;
    max-width: calc(50% - 1rem);
}
.page-metadata-viewer .controls-left .control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600; font-size: 1rem;
    color: var(--text-color);
}

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

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

.ev-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;
}
.ev-doc-table th,
.ev-doc-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}
.ev-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;
}
.ev-doc-table tr:last-child td { border-bottom: none; }
.ev-doc-table tr:nth-child(even) td { background: #fafbfc; }

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

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