/* --- RESET & VARIABLES --- */
:root {
    /* ToolSlice-style Palette */
    --primary: #4f46e5;       /* Indigo-600 */
    --primary-hover: #4338ca; /* Indigo-700 */
    
    --bg-body: #f3f4f6;       /* Gray-100 */
    --bg-card: #ffffff;       /* White */
    
    --text-main: #111827;     /* Gray-900 */
    --text-muted: #6b7280;    /* Gray-500 */
    --border: #e5e7eb;        /* Gray-200 */
    
    --success: #10b981;
    --danger: #ef4444;
    
    --radius-card: 16px;
    --radius-btn: 8px;
    
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* --- LAYOUT UTILITIES --- */
.container { width: 90%; max-width: 900px; margin: 0 auto; } /* Narrower for tool focus */
.hidden { display: none !important; }

/* --- NAVBAR --- */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky; top: 0; z-index: 50;
}
.nav-container {
    width: 90%; max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.logo {
    display: flex; align-items: center; gap: 0.5rem;
    font-weight: 700; font-size: 1.25rem; color: var(--text-main);
    text-decoration: none; letter-spacing: -0.025em;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a { 
    color: var(--text-muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; 
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }

/* --- MAIN TOOL SECTION --- */
.main-content { padding: 3rem 0 5rem; }

.tool-header { text-align: center; margin-bottom: 2.5rem; }
.tool-header h1 { 
    font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em;
    color: var(--text-main); margin-bottom: 0.75rem; line-height: 1.2;
}
.tool-header p { 
    color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto;
}

/* --- THE CARD (Core Design Element) --- */
.tool-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    min-height: 500px;
    display: flex; flex-direction: column;
}

/* 1. UPLOAD ZONE (Refined) */
.upload-zone {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 4rem 2rem;
    background-color: #f9fafb; /* Slightly darker than white */
    border: 2px dashed var(--border);
    margin: 1.5rem;
    border-radius: var(--radius-card);
    cursor: pointer;
    transition: all 0.2s ease;
}
.upload-zone:hover {
    border-color: var(--primary);
    background-color: #eef2ff; /* Very light indigo */
}
.icon-box { 
    color: var(--primary); margin-bottom: 1.5rem; 
    background: #e0e7ff; padding: 1rem; border-radius: 50%;
}
.upload-zone h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.upload-zone p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.primary-btn {
    background: var(--primary); color: white; border: none;
    padding: 0.75rem 1.5rem; border-radius: var(--radius-btn);
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    transition: background 0.2s;
}
.primary-btn:hover { background: var(--primary-hover); }

/* 2. INSPECTOR VIEW (Clean Split) */
.inspector-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}
@media (min-width: 768px) {
    .inspector-view { flex-direction: row; height: 600px; }
}

/* Left Column: Image */
.preview-col {
    flex: 1;
    background: #f9fafb;
    padding: 2rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-right: 1px solid var(--border);
}
.img-container {
    background: white;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    max-width: 100%; max-height: 400px;
    display: flex; justify-content: center;
}
.img-container img {
    max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px;
}
.file-meta {
    margin-top: 1rem;
    display: flex; gap: 1rem;
    font-size: 0.85rem; font-weight: 500; color: var(--text-muted);
}

/* Right Column: Data & Actions */
.data-col {
    flex: 1.2; /* Slightly wider */
    display: flex; flex-direction: column;
    padding: 0;
    background: white;
}
.data-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.data-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px;}

/* Table Area */
.table-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.meta-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.meta-table tr { border-bottom: 1px solid var(--border); }
.meta-table td { padding: 12px 2rem; }
.meta-table tr:last-child { border-bottom: none; }
.label-cell { color: var(--text-muted); font-weight: 500; width: 35%; }
.value-cell { color: var(--text-main); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; word-break: break-all; }

/* Action Footer inside Card */
.action-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    background: #f9fafb;
}

/* The "Generate/Clean" Button */
.clean-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius-btn);
    font-size: 1rem; font-weight: 600;
    cursor: pointer;
    display: flex; justify-content: center; align-items: center; gap: 0.75rem;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}
.clean-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(79, 70, 229, 0.3);
}

/* 3. SUCCESS VIEW */
.success-view {
    padding: 4rem 2rem; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%;
}
.success-icon {
    width: 64px; height: 64px;
    background: #d1fae5; color: var(--success);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
}
.success-view h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.stats-row {
    display: flex; gap: 2rem; margin: 2rem 0;
    background: #f9fafb; padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border);
}
.stat { text-align: center; }
.stat span { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.stat strong { font-size: 1.5rem; color: var(--text-main); }
.download-btn {
    background: var(--text-main); color: white;
    text-decoration: none; padding: 1rem 3rem; border-radius: var(--radius-btn);
    font-weight: 600; transition: background 0.2s;
    display: inline-block;
}
.download-btn:hover { background: black; }
.reset-link {
    margin-top: 1.5rem; color: var(--text-muted); text-decoration: underline; cursor: pointer; background: none; border: none; font-size: 0.9rem;
}

/* --- [EXISTING CSS STAYS THE SAME] --- */
/* ... keep all your variables, navbar, and tool-card styles ... */


/* --- NEW: SEO TEXT SECTION --- */
.info-section {
    margin-top: 4rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.info-section h2 { font-size: 1.8rem; color: var(--text-main); margin-bottom: 1rem; }
.info-section p { color: var(--text-muted); line-height: 1.8; font-size: 1.05rem; }
.info-section strong { color: var(--primary); }

/* --- NEW: FAQ SECTION --- */
.faq-section {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s;
    text-align: left;
}
.faq-card:hover {
    box-shadow: var(--shadow-hover);
}
.faq-card h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.faq-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- NEW: FOOTER (Matching Screenshot) --- */
.site-footer {
    background: #ffffff; /* White background like screenshot */
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    padding-bottom: 3rem;
}

/* Left Side: Brand */
.footer-brand { max-width: 300px; }
.footer-brand h4 { font-size: 1.25rem; font-weight: 800; color: var(--text-main); margin-bottom: 1rem; }
.footer-brand p { color: var(--text-muted); line-height: 1.6; font-size: 0.95rem; }

/* Right Side: Links */
.footer-links {
    display: flex;
    gap: 2rem;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary); }

/* Bottom: Copyright */
.footer-bottom {
    text-align: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 2rem;
    color: #9ca3af; /* Light gray text */
    font-size: 0.85rem;
}

/* Mobile Responsiveness for Footer */
@media (max-width: 768px) {
    .footer-content { flex-direction: column; text-align: center; align-items: center; }
    .footer-links { flex-direction: column; gap: 1rem; }
}