/* ==========================================================================
   FloraCare - Modern Mobile-First Botanical UI Stylesheet
   ========================================================================== */

:root {
    --primary: #15803d;
    --primary-dark: #166534;
    --primary-light: #22c55e;
    --primary-soft: #f0fdf4;
    --primary-border: #bbf7d0;

    --bg-app: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --border: #e2e8f0;
    --border-focus: #16a34a;

    --healthy: #16a34a;
    --healthy-bg: #ecfdf5;
    --healthy-border: #a7f3d0;

    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;

    --sick: #ea580c;
    --sick-bg: #fff7ed;
    --sick-border: #fed7aa;

    --critical: #dc2626;
    --critical-bg: #fef2f2;
    --critical-border: #fecaca;

    --recovering: #2563eb;
    --recovering-bg: #eff6ff;
    --recovering-border: #bfdbfe;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --bottom-nav-height: 64px;
    --header-height: 68px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   App Shell & Layout
   ========================================================================== */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--primary-dark);
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
    flex-shrink: 0;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-text {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary-dark);
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-full);
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-link.active {
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Language Dropdown */
.lang-selector {
    position: relative;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s ease;
}

.lang-btn:hover {
    background: var(--bg-subtle);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 175px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    display: none;
    flex-direction: column;
    z-index: 50;
}

.flag-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.flag-img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.15);
    display: inline-block;
    vertical-align: middle;
}

.lang-item-name {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.lang-item-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.lang-menu.show {
    display: flex;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    transition: background 0.1s ease;
}

.lang-item:hover, .lang-item.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.btn-header-scan {
    display: none;
}

/* Main Container */
.app-main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1rem 5.5rem 1rem;
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.35rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(22, 101, 52, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(22, 101, 52, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: #cbd5e1;
}

.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border-color: var(--primary-border);
}

.btn-outline:hover {
    background: var(--primary-soft);
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-lg {
    padding: 0.95rem 1.6rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

/* Status Badges */
.badge-health {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-health.healthy {
    background: var(--healthy-bg);
    color: var(--healthy);
    border: 1px solid var(--healthy-border);
}

.badge-health.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.badge-health.sick {
    background: var(--sick-bg);
    color: var(--sick);
    border: 1px solid var(--sick-border);
}

.badge-health.critical {
    background: var(--critical-bg);
    color: var(--critical);
    border: 1px solid var(--critical-border);
}

.badge-health.recovering {
    background: var(--recovering-bg);
    color: var(--recovering);
    border: 1px solid var(--recovering-border);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* Watering Status Badges */
.water-badge-ok {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.water-badge-due {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.water-badge-overdue {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    animation: pulse-soft 2s infinite;
}

.water-badge-upcoming {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* ==========================================================================
   Hero & Dashboard Cards
   ========================================================================== */
.hero-card {
    background: linear-gradient(135deg, #166534 0%, #15803d 50%, #10b981 100%);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    color: #ffffff;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -30px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    backdrop-filter: blur(4px);
}

.hero-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.hero-desc {
    font-size: 0.98rem;
    opacity: 0.92;
    max-width: 580px;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn-hero-primary {
    background: #ffffff;
    color: var(--primary-dark);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-hero-primary:hover {
    background: #f8fafc;
    color: var(--primary);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Stats Row */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon.green { background: #ecfdf5; color: #059669; }
.stat-icon.emerald { background: #f0fdf4; color: #16a34a; }
.stat-icon.amber { background: #fffbeb; color: #d97706; }
.stat-icon.blue { background: #eff6ff; color: #2563eb; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* Plant Card Grid */
.plants-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .plants-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .plants-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.plant-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.plant-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.plant-card-media {
    position: relative;
    width: 100%;
    height: 200px;
    background: #e2e8f0;
    overflow: hidden;
}

.plant-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.plant-card:hover .plant-card-img {
    transform: scale(1.03);
}

.plant-card-overlay {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.location-tag {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.plant-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.plant-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.plant-card-species {
    font-size: 0.88rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.plant-card-diag {
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.plant-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--bg-surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-desc {
    color: var(--text-muted);
    max-width: 440px;
    margin: 0 auto 1.5rem;
    font-size: 0.95rem;
}

/* ==========================================================================
   Scan & Camera Screen
   ========================================================================== */
.scan-container {
    max-width: 760px;
    margin: 0 auto;
}

.scan-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.scan-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg-app);
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 1.5rem;
}

.scan-dropzone:hover, .scan-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.dropzone-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1rem;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.dropzone-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.dropzone-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.dropzone-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* Image Preview Container */
.preview-container {
    display: none;
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 420px;
    background: #0f172a;
    border: 2px solid var(--primary);
}

.preview-container img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    margin: 0 auto;
}

.preview-remove-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.15s ease;
}

.preview-remove-btn:hover {
    background: rgba(220, 38, 38, 0.9);
}

/* Organ Selector */
.organ-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 480px) {
    .organ-selector {
        grid-template-columns: repeat(5, 1fr);
    }
}

.organ-option input {
    display: none;
}

.organ-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.65rem 0.5rem;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.15s ease;
}

.organ-pill .icon {
    font-size: 1.25rem;
}

.organ-option input:checked + .organ-pill {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-dark);
}

/* Symptom Checkbox Grid */
.symptom-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 540px) {
    .symptom-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.symptom-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.15s ease;
}

.symptom-label:hover {
    background: var(--bg-subtle);
    border-color: #cbd5e1;
}

.symptom-label input[type="checkbox"] {
    margin-top: 0.2rem;
    accent-color: var(--primary);
    width: 17px;
    height: 17px;
    cursor: pointer;
}

.symptom-label:has(input:checked) {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    color: var(--primary-dark);
}

/* Results Section */
.result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1.75rem;
}

.result-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #ffffff;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.result-score {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 1.15rem;
    font-weight: 800;
}

.result-body {
    padding: 1.5rem;
}

.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tax-item strong {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.tax-item span {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Health Diagnosis Box */
.diagnosis-box {
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.diagnosis-box.healthy { background: var(--healthy-bg); border: 1px solid var(--healthy-border); }
.diagnosis-box.warning { background: var(--warning-bg); border: 1px solid var(--warning-border); }
.diagnosis-box.sick { background: var(--sick-bg); border: 1px solid var(--sick-border); }
.diagnosis-box.critical { background: var(--critical-bg); border: 1px solid var(--critical-border); }

.diagnosis-box-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diagnosis-text {
    font-size: 0.92rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.plan-list {
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    font-size: 0.88rem;
    line-height: 1.7;
    white-space: pre-line;
    border: 1px solid rgba(0,0,0,0.06);
}

/* Reference Images Gallery */
.ref-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.ref-img {
    height: 90px;
    width: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ==========================================================================
   Weekly Timeline & Plant Detail
   ========================================================================== */
.plant-detail-header {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .plant-detail-header {
        flex-direction: row;
        align-items: center;
    }
}

.detail-avatar {
    width: 100%;
    max-width: 240px;
    height: 240px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #e2e8f0;
    flex-shrink: 0;
}

.detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    flex: 1;
}

.timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: #cbd5e1;
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
}

.timeline-week {
    font-size: 1.1rem;
    font-weight: 800;
}

.timeline-date {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.timeline-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .timeline-grid {
        grid-template-columns: 160px 1fr;
    }
}

.timeline-photo {
    height: 140px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #e2e8f0;
}

.timeline-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   Mobile Bottom Navigation Bar
   ========================================================================== */
.mobile-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: #ffffff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 50;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 768px) {
    .mobile-nav-bar {
        display: none;
    }
    .desktop-nav {
        display: flex;
    }
    .btn-header-scan {
        display: inline-flex;
    }
    .app-main {
        padding-bottom: 2.5rem;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    flex: 1;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    transition: color 0.15s ease;
}

.mobile-nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

.mobile-nav-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Center Elevated FAB */
.nav-fab {
    position: relative;
    top: -14px;
}

.fab-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(21, 128, 61, 0.4);
    border: 3px solid #ffffff;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-fab:active .fab-circle {
    transform: scale(0.92);
}

/* ==========================================================================
   Footer (Desktop)
   ========================================================================== */
.app-footer {
    display: none;
    border-top: 1px solid var(--border);
    background: #ffffff;
    padding: 1.75rem 1rem;
    margin-top: auto;
}

@media (min-width: 768px) {
    .app-footer {
        display: block;
    }
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-brand .brand-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.footer-tagline {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-meta a {
    color: var(--primary);
    text-decoration: underline;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

@media (min-width: 640px) {
    .toast-container {
        left: auto;
        width: 380px;
    }
}

.toast {
    background: #0f172a;
    color: #ffffff;
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
}

.toast.success { background: #065f46; border: 1px solid #059669; }
.toast.error { background: #991b1b; border: 1px solid #dc2626; }
.toast.warning { background: #92400e; border: 1px solid #d97706; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

/* ==========================================================================
   Modern App Showcase & Mobile Store UI
   ========================================================================== */
.app-showcase-hero {
    background: linear-gradient(135deg, #064e3b 0%, #166534 45%, #059669 85%, #10b981 100%);
    border-radius: var(--radius-lg);
    padding: 3rem 2.25rem;
    color: #ffffff;
    box-shadow: 0 20px 40px -15px rgba(6, 78, 59, 0.4);
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
    position: relative;
    overflow: hidden;
}

@media (min-width: 820px) {
    .app-showcase-hero {
        grid-template-columns: 1.25fr 1fr;
        padding: 3.5rem 3rem;
    }
}

.app-showcase-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(167, 243, 208, 0.25) 0%, rgba(167, 243, 208, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.store-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.store-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    text-decoration: none;
}

.store-badge-btn:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
}

.store-badge-btn:active {
    transform: translateY(0);
}

/* Phone Mockup */
.phone-mockup-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-frame {
    width: 250px;
    height: 480px;
    background: #1e293b;
    border-radius: 36px;
    padding: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 255, 255, 0.15);
    position: relative;
}

.phone-speaker {
    width: 50px;
    height: 4px;
    background: #475569;
    border-radius: 2px;
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #f8fafc;
    border-radius: 26px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #0f172a;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.phone-status-bar {
    display: flex;
    justify-content: space-between;
    padding: 6px 14px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
}

/* Pulse Dot Animation for Healthy Plant Badges */
.badge-health .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.badge-health.healthy .dot {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    animation: pulseHealthy 2s infinite;
}

@keyframes pulseHealthy {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(22, 163, 74, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
    }
}

/* Floating PWA Install Bar */
.pwa-floating-bar {
    position: fixed;
    bottom: 74px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 520px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.15rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.3);
    z-index: 45;
    animation: slideUpFloat 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFloat {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@media (min-width: 768px) {
    .pwa-floating-bar {
        bottom: 24px;
        right: 24px;
        left: auto;
        transform: none;
    }
    @keyframes slideUpFloat {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Card Lift & Polish */
.plant-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
    border: 1px solid var(--border);
}

.plant-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.1);
    border-color: #cbd5e1;
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.08);
}
