/* SnapID Shared Styles — Nature Theme */
:root {
    --primary: #2E7D32;
    --primary-dark: #1B5E20;
    --primary-light: #66BB6A;
    --secondary: #E8F5E9;
    --accent-gold: #FFB300;
    --accent-sky: #29B6F6;
    --tox-none: #4CAF50;
    --tox-mild: #FFC107;
    --tox-moderate: #FF9800;
    --tox-high: #F44336;
    --tox-deadly: #B71C1C;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #212121;
    --text-muted: #757575;
    --radius: 12px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121212;
        --card-bg: #1e1e1e;
        --text: #e0e0e0;
        --text-muted: #9e9e9e;
        --secondary: #1B5E20;
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }

.snapid-app { display: flex; flex-direction: column; min-height: 100vh; max-width: 600px; margin: 0 auto; }
.snapid-content { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: 80px; }

/* NAV */
.snapid-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center;
    background: var(--card-bg); border-top: 1px solid #e0e0e0; padding: 8px 0; z-index: 100; }
.nav-item { display: flex; flex-direction: column; align-items: center; padding: 6px 24px;
    text-decoration: none; color: var(--text-muted); font-size: 11px; transition: color 0.2s; }
.nav-item:hover, .nav-item.active { color: var(--primary); }
.nav-icon { font-size: 22px; }
.nav-label { margin-top: 2px; }

/* BUTTONS */
.btn { border: none; border-radius: var(--radius); padding: 12px 16px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: opacity 0.2s, transform 0.1s; display: inline-flex; align-items: center;
    justify-content: center; gap: 6px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #757575; color: white; }
.btn-camera { background: var(--primary); color: white; }
.btn-gallery { background: #757575; color: white; }
.btn-identify { background: var(--accent-gold); color: #000; }
.btn-share { background: var(--accent-sky); color: white; }
.btn-gold { background: var(--accent-gold); color: #000; }
.btn-delete { background: transparent; border: none; cursor: pointer; font-size: 18px; padding: 8px; }

/* ACTION BUTTONS */
.action-buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }

/* IDENTIFY PAGE */
.identify-page { display: flex; flex-direction: column; height: 100%; }
.tier-banner { background: var(--secondary); color: var(--primary-dark); text-align: center;
    padding: 8px 12px; border-radius: var(--radius); font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.photo-area { flex: 1; min-height: 200px; max-height: 50vh; border: 2px dashed #ccc; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: var(--card-bg); margin-bottom: 12px; }
.preview-image { width: 100%; height: 100%; object-fit: contain; max-height: 50vh; }
.placeholder { text-align: center; color: var(--text-muted); }
.placeholder-icon { font-size: 64px; display: block; margin-bottom: 12px; }
.placeholder-sub { font-size: 14px; }
.status-message { text-align: center; font-size: 14px; color: var(--text-muted); margin: 8px 0; }
.status-warning { color: var(--accent-gold); }
.status-error { color: var(--tox-high); }
.status-success { color: var(--primary); }

/* LOADING */
.loading-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex;
    flex-direction: column; align-items: center; justify-content: center; z-index: 200; color: white;
    backdrop-filter: blur(4px); gap: 16px; }
.loading { text-align: center; padding: 40px; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Analyzer animation */
.analyzer { position: relative; width: 100px; height: 100px; display: flex;
    align-items: center; justify-content: center; }
.analyzer-ring { position: absolute; inset: 0; border-radius: 50%;
    border: 3px solid transparent; border-top-color: var(--primary-light);
    border-right-color: var(--primary-light); animation: spin 1.2s linear infinite; }
.analyzer-ring-2 { border-top-color: var(--accent-gold); border-right-color: transparent;
    border-bottom-color: var(--accent-gold); animation-duration: 1.8s;
    animation-direction: reverse; inset: 8px; }
.analyzer-icon { font-size: 36px; animation: pulse-icon 2s ease-in-out infinite; z-index: 1; }
@keyframes pulse-icon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
}
.analyzer-title { font-size: 18px; font-weight: 600; letter-spacing: 0.5px; margin: 0; }
.analyzer-bars { display: flex; gap: 4px; align-items: end; height: 24px; }
.analyzer-bar { width: 4px; background: var(--primary-light); border-radius: 2px;
    animation: eq-bar 1s ease-in-out infinite; }
.analyzer-bar:nth-child(1) { animation-delay: 0s; }
.analyzer-bar:nth-child(2) { animation-delay: 0.15s; }
.analyzer-bar:nth-child(3) { animation-delay: 0.3s; }
.analyzer-bar:nth-child(4) { animation-delay: 0.45s; }
.analyzer-bar:nth-child(5) { animation-delay: 0.6s; }
@keyframes eq-bar {
    0%, 100% { height: 6px; opacity: 0.5; }
    50% { height: 22px; opacity: 1; }
}
.analyzer-sub { font-size: 13px; color: rgba(255,255,255,0.7); margin: 0;
    animation: fade-hint 2.5s ease-in-out infinite; }
@keyframes fade-hint {
    0% { opacity: 0; transform: translateY(4px); }
    15%, 85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-4px); }
}

/* RESULTS PAGE */
.results-page { }
.result-photo { border-radius: 16px; overflow: hidden; max-height: 250px; margin-bottom: 16px; }
.result-photo img { width: 100%; height: 250px; object-fit: cover; }
.result-header h1 { font-size: 28px; color: var(--primary); }
.scientific-name { font-style: italic; color: var(--text-muted); font-size: 16px; }
.badges { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.badge { padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.badge-category { background: var(--secondary); }
.badge-confidence { background: #E3F2FD; }
.toxicity-card { display: flex; gap: 10px; padding: 12px; border-radius: var(--radius);
    margin: 16px 0; color: white; align-items: center; }
.toxicity-icon { font-size: 24px; }
.toxicity-card p { font-size: 12px; margin-top: 2px; }
.toxicity-none { background: var(--tox-none); }
.toxicity-mild { background: var(--tox-mild); color: #000; }
.toxicity-moderate { background: var(--tox-moderate); color: #000; }
.toxicity-high { background: var(--tox-high); }
.toxicity-deadly { background: var(--tox-deadly); }
.toxicity-unknown { background: #9e9e9e; }
section { margin: 16px 0; }
section h2 { font-size: 18px; margin-bottom: 6px; }
.fun-facts { padding-left: 20px; }
.fun-facts li { margin-bottom: 4px; }
textarea { width: 100%; border: 1px solid #ccc; border-radius: 8px; padding: 10px;
    font-family: inherit; font-size: 14px; resize: vertical; }

/* JOURNAL PAGE */
.journal-page h1 { margin-bottom: 16px; }
.journal-list { display: flex; flex-direction: column; gap: 8px; }
.journal-card { display: flex; align-items: center; background: var(--card-bg);
    border-radius: var(--radius); padding: 12px; cursor: pointer; transition: box-shadow 0.2s; }
.journal-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.journal-card-content { flex: 1; }
.journal-card h3 { font-size: 16px; }
.scientific { font-style: italic; font-size: 12px; color: var(--text-muted); }
.card-meta { display: flex; gap: 12px; margin-top: 4px; }
.card-category { color: var(--primary); font-size: 11px; }
.card-date { color: var(--text-muted); font-size: 11px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 64px; display: block; margin-bottom: 12px; }
.empty-sub { font-size: 14px; }

/* SETTINGS PAGE */
.settings-page h1 { margin-bottom: 16px; }
.settings-section { margin-bottom: 24px; }
.settings-section h2 { font-size: 20px; margin-bottom: 8px; }
.plan-card { background: var(--card-bg); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.plan-card h3 { font-size: 18px; margin-bottom: 6px; }
.plan-card ul { padding-left: 20px; font-size: 13px; }
.plan-card li { margin-bottom: 2px; }
.plan-card .muted { color: var(--text-muted); }
.current-plan { background: var(--secondary); }
.plan-plus { border: 2px solid var(--accent-gold); }
.plan-pro { border: 2px solid var(--primary); }
.hint { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.hint a { color: var(--primary); }
input[type="password"] { width: 100%; border: 1px solid #ccc; border-radius: 8px;
    padding: 10px; font-size: 14px; margin-bottom: 8px; }
.app-info { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 24px; }

/* ACCOUNT / AUTH */
.account-card { background: var(--card-bg); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
    text-align: center; }
.account-card .avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 8px; }
.login-btn { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: var(--radius);
    font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; justify-content: center;
    border: 1px solid #ddd; background: white; color: #333; transition: box-shadow 0.2s; margin-bottom: 8px; }
.login-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.login-btn-google { border-color: #4285F4; }
.login-btn-apple { background: #000; color: white; border-color: #000; }

/* BANNED OVERLAY */
.banned-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: flex;
    flex-direction: column; align-items: center; justify-content: center; z-index: 300;
    color: white; padding: 32px; text-align: center; }
.banned-icon { font-size: 64px; margin-bottom: 16px; }
.banned-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; color: var(--tox-high); }
.banned-message { font-size: 14px; color: rgba(255,255,255,0.7); max-width: 300px; }
