/* Design System */
:root {
    --primary: #4f46e5;
    --primary-hover: #3730a3;
    --bg-dark: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent: #10b981;
    --glass-border: rgba(15, 23, 42, 0.08);
    --input-bg: #ffffff;
    --input-border: rgba(15, 23, 42, 0.12);
}

/* ─── Bottom Footer Bar ─────────────────────────────────────────────────── */
.bottom-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 100px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.footer-link:hover,
.footer-link.active {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.07);
    border-color: rgba(79, 70, 229, 0.15);
}

.footer-sep {
    width: 1px;
    height: 14px;
    background: var(--glass-border);
    flex-shrink: 0;
}

/* ─── Top Navigation (tool pages) ──────────────────────────────────────── */
.top-nav {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.2rem 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background: rgba(15, 23, 42, 0.05);
}

.text-left {
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 2rem 6rem; /* bottom padding for fixed footer */
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
}

.container {
    max-width: 800px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #818cf8, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.upload-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.08);
    text-align: center;
    transition: transform 0.3s ease;
}

.upload-card:hover {
    transform: translateY(-5px);
}

.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.hidden {
    display: none;
}

/* Passport Layout Preview */
.preview-section {
    margin-top: 3rem;
    width: 100%;
}

.sheet-container {
    background: white;
    padding: 0;
    margin: 2rem auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
    width: 210mm; /* A4 Width */
    height: 297mm; /* A4 Height */
    position: relative;
    overflow: hidden;
    display: none; /* Hidden until upload */
}

.photo-row {
    display: flex;
    justify-content: center;
    margin-bottom: 3mm; /* Exact 3mm gap between rows */
    margin-top: 0; /* Top row gap is controlled by slider */
    padding: 0 5mm; /* Removed vertical padding to ensure exact 3mm gap between images */
    gap: 2mm; /* Narrower gap to fit 6 in a row */
    border: none; /* Removed border as requested */
    width: 100%; /* Take full width of container */
    max-width: 210mm;
}

.passport-photo {
    width: 32mm; /* Slightly reduced to fit 6 in a row (Portrait A4 is 210mm) */
    height: 42mm; /* Proportional height */
    border: none; /* No border */
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.print-instructions {
    max-width: 600px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.03);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.print-instructions ul {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
    text-align: left;
}

/* Print Specific Styles */
@media print {
    body {
        background: white !important;
        padding: 0;
        margin: 0;
    }
    
    /* Strict Ad Blocker for Print: Hide EVERYTHING first */
    body * {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    /* Only turn back on the specific photo sheet elements */
    .preview-section, 
    .sheet-wrapper, 
    .sheet-container, 
    .photo-row, 
    .passport-photo {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .photo-row {
        display: flex !important;
    }

    .preview-section {
        position: absolute;
        top: 0;
        left: 0;
        margin: 0 !important;
        padding: 0 !important;
    }

    .sheet-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }

    .sheet-container {
        box-shadow: none !important;
        margin: 0 !important;
        width: 210mm;
        height: 297mm;
        border: none;
    }

    .passport-photo {
        box-shadow: none !important;
    }

    @page {
        size: A4;
        margin: 0;
    }
}

.btn-print-box {
    margin-top: 1rem;
    text-align: center;
}
