@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #F4F4F5;
    color: #18181b;
    min-height: 100vh;
}

.font-heading { font-family: 'Space Grotesk', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

.app-container { min-height: 100vh; display: flex; flex-direction: column; }

.camera-container {
    position: fixed;
    inset: 0;
    background: #000;
    overflow: hidden;
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This is crucial for the full-screen look */
}

.camera-controls {
    position: absolute;
    bottom: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    z-index: 100;
}


.header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e4e4e7;
    background: white;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.footer {
    padding: 1rem;
    text-align: center;
    background: white;
    border-top: 1px solid #e4e4e7;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease-out;
    border: none;
    font-size: 0.875rem;
    text-decoration: none;
}

.btn-primary {
    background-color: #18181b;
    color: white;
    border: 2px solid #18181b;
    box-shadow: 4px 4px 0px 0px rgba(0,0,0,1);
}

.btn-primary:hover { background-color: #27272a; }
.btn-primary:active { transform: translateY(2px); box-shadow: none; }

.btn-success {
    background-color: #22c55e;
    color: white;
    border: 2px solid #22c55e;
    box-shadow: 4px 4px 0px 0px rgba(0,0,0,1);
}

.btn-success:hover { background-color: #16a34a; }

.btn-accent {
    background-color: #f97316;
    color: white;
    border: 2px solid #f97316;
    box-shadow: 4px 4px 0px 0px rgba(0,0,0,1);
}

.btn-accent:hover { background-color: #ea580c; }

.btn-ghost {
    background: transparent;
    color: #71717a;
    border: none;
    box-shadow: none;
}

.btn-ghost:hover { background-color: #f4f4f5; color: #18181b; }

.btn-full { width: 100%; }
.btn-large { height: 3.5rem; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 0; }

.input {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid #e4e4e7;
    background: white;
    font-size: 0.875rem;
}

.input:focus {
    outline: none;
    border-color: #18181b;
    box-shadow: 0 0 0 2px rgba(24,24,27,0.1);
}

.card { background: white; border: 1px solid #e4e4e7; padding: 1.5rem; }

.data-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #71717a;
}

.data-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    color: #18181b;
}

.pin-dots { display: flex; gap: 0.75rem; justify-content: center; }

.pin-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #e4e4e7;
    transition: background-color 0.15s ease;
}

.pin-dot.filled { background-color: #18181b; }
.pin-dot.error { background-color: #ef4444; }

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 16rem;
    margin: 0 auto;
}

.pin-key {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    background: white;
    border: 1px solid #e4e4e7;
    cursor: pointer;
    transition: background-color 0.1s;
}

.pin-key:hover { background-color: #f4f4f5; }
.pin-key:active { background-color: #e4e4e7; }

.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (min-width: 768px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }

.image-thumbnail {
    position: relative;
    aspect-ratio: 1;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    overflow: hidden;
}

.image-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.image-thumbnail .delete-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    background: #ef4444;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-thumbnail .delete-btn:hover { background: #dc2626; }

.image-thumbnail .image-number {
    position: absolute;
    bottom: 0.25rem;
    left: 0.25rem;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.25rem;
    font-family: 'JetBrains Mono', monospace;
}

.add-more-btn {
    aspect-ratio: 1;
    background: white;
    border: 2px dashed #d4d4d8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s;
}

.add-more-btn:hover { border-color: #a1a1aa; }
.add-more-btn svg { width: 2rem; height: 2rem; color: #a1a1aa; }
.add-more-btn span { font-family: 'JetBrains Mono', monospace; font-size: 0.625rem; color: #71717a; }

.scanner-container { position: fixed; inset: 0; background: black; z-index: 50; }
.scanner-video { width: 100%; height: 100%; object-fit: cover; }
.scanner-overlay { position: absolute; inset: 0; pointer-events: none; }

.viewfinder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
}

.viewfinder-corner { position: absolute; width: 2rem; height: 2rem; border-color: #f97316; }
.viewfinder-corner.top-left { top: 0; left: 0; border-top: 4px solid; border-left: 4px solid; }
.viewfinder-corner.top-right { top: 0; right: 0; border-top: 4px solid; border-right: 4px solid; }
.viewfinder-corner.bottom-left { bottom: 0; left: 0; border-bottom: 4px solid; border-left: 4px solid; }
.viewfinder-corner.bottom-right { bottom: 0; right: 0; border-bottom: 4px solid; border-right: 4px solid; }

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #f97316;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.8);
    animation: scan 2s ease-in-out infinite;
}

@keyframes scan { 0% { top: 0; } 50% { top: 100%; } 100% { top: 0; } }

.camera-container { position: fixed; inset: 0; background: black; z-index: 50; }
.camera-video { width: 100%; height: 100%; object-fit: cover; }

.camera-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 30px;
    z-index: 1000;
}

.shutter-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 5px solid white;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shutter-btn-inner { width: 60px; height: 60px; border-radius: 50%; background: white; }

.done-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #22c55e;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.done-btn:disabled { background: #666; cursor: not-allowed; }

.preview-thumbnail {
    width: 60px;
    height: 60px;
    border: 3px solid white;
    border-radius: 8px;
    overflow: hidden;
    background: #333;
}

.preview-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.photo-count {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #f97316;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    z-index: 1000;
}

.success-icon {
    width: 6rem;
    height: 6rem;
    background: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkmark { stroke-dasharray: 166; stroke-dashoffset: 166; animation: checkmark-draw 0.6s ease-out forwards; }
.checkmark-check { stroke-dasharray: 48; stroke-dashoffset: 48; animation: checkmark-draw 0.3s ease-out 0.3s forwards; }
@keyframes checkmark-draw { to { stroke-dashoffset: 0; } }

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e4e4e7;
    border-top-color: #18181b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.pulse-ring { animation: pulse-ring 2s ease-in-out infinite; }
@keyframes pulse-ring {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.text-center { text-align: center; }
.text-white { color: white; }
.text-muted { color: #71717a; }
.text-success { color: #22c55e; }
.text-error { color: #ef4444; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.max-w-sm { max-width: 24rem; }
.max-w-xs { max-width: 20rem; }

.hidden { display: none; }
.block { display: block; }

.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }

.bg-white { background-color: white; }
.bg-black { background-color: black; }
.bg-zinc-100 { background-color: #f4f4f5; }
.bg-zinc-900 { background-color: #18181b; }
.bg-orange-500 { background-color: #f97316; }
.bg-emerald-500 { background-color: #22c55e; }

.border { border: 1px solid #e4e4e7; }
.border-b { border-bottom: 1px solid #e4e4e7; }
.border-t { border-top: 1px solid #e4e4e7; }

.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.toast-container { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 9999; }

.toast {
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: toast-in 0.3s ease-out;
    margin-bottom: 0.5rem;
}

.toast-success { background: #22c55e; color: white; }
.toast-error { background: #ef4444; color: white; }
.toast-info { background: #18181b; color: white; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-1rem); }
    to { opacity: 1; transform: translateY(0); }
}
