:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --success-hover: #059669;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.header {
    text-align: center;
    padding: 20px 0;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.image-preview-container {
    width: 100%;
    height: 280px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px dashed var(--glass-border);
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.camera-icon {
    opacity: 0.5;
}

#imagePreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-success {
    background: var(--success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    margin-top: 20px;
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
    width: auto;
}

.metadata-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.heading-item {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.value {
    font-size: 14px;
    font-weight: 500;
    font-family: monospace;
}

.status-message {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.success-text { color: var(--success); }
.error-text { color: #ef4444; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.loading .camera-icon {
    animation: pulse 1.5s infinite;
}

/* Password Overlay */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.password-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lock-icon {
    margin-bottom: 20px;
    color: var(--text-primary);
    opacity: 0.8;
}

.password-card h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.password-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

#passwordInput {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 20px;
    outline: none;
    transition: all 0.2s ease;
}

#passwordInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Results Card Styling */
.results-card {
    margin-top: 24px;
    border-left: 4px solid #2ecc71;
    animation: slideIn 0.5s ease-out;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.results-header h3 {
    margin: 0;
    color: #2ecc71;
}

.address-display {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1e293b;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.spec-item {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.spec-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.spec-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.apn-display {
    font-size: 0.85rem;
    color: #64748b;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
