/* Horticulture Advisory Platform - Modern UX Design */

:root {
    --primary: #16a34a;
    --primary-dark: #15803d;
    --primary-light: #22c55e;
    --secondary: #f59e0b;
    --accent: #3b82f6;
    --danger: #ef4444;
    --success: #10b981;
    --whatsapp: #25D366;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--white);
    color: var(--text);
    padding: 14px 20px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.header h1 { font-size: 1.35rem; font-weight: 700; margin-bottom: 2px; color: var(--text); }
.header p { font-size: 0.85rem; color: var(--text-light); }

/* Brand header — Hortic logo + name + slogan */
.brand-row {
    display: flex; align-items: center; justify-content: center;
    gap: 9px; margin-bottom: 2px;
}
.brand-row img { width: 30px; height: 30px; display: block; }
.brand-row .brand-name {
    font-size: 1.35rem; font-weight: 800; letter-spacing: 0.01em; line-height: 1.1;
    color: var(--text);
}
.brand-slogan {
    font-size: 0.78rem; font-weight: 500; color: var(--text-light); margin-bottom: 2px;
}

/* Verified checkmark shown inline next to the user chip */
.verified-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
    background: #dcfce7; color: #15803d;
}
.verified-badge svg { width: 11px; height: 11px; display: block; }

/* Market map (नजिकको बजार) */
.horti-map-wrap { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.horti-map-wrap iframe { width: 100%; height: 320px; border: 0; display: block; }
@media (min-width: 640px) { .horti-map-wrap iframe { height: 400px; } }
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.back-btn:hover { color: var(--primary); }

/* Content */
.content {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 16px; }
.card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; color: var(--primary); }

/* Form Elements - Fixed Dropdown */
.input-group {
    margin-bottom: 20px;
}
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
}
.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    max-width: 400px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--white);
    appearance: none;
    -webkit-appearance: none;
}
.input-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
    cursor: pointer;
}
.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4); }
.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-secondary:hover { background: var(--primary); color: var(--white); }
.btn-whatsapp {
    background: var(--whatsapp);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}
.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4); }
.btn-block { width: 100%; max-width: 400px; }

/* Module Grid */
.module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (min-width: 640px) { .module-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .module-grid { grid-template-columns: repeat(4, 1fr); } }
.module-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.module-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.module-icon {
    font-size: 2.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: var(--radius);
}
.module-title { font-size: 0.95rem; font-weight: 600; }

/* Plot Cards */
.plots-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.plot-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: all 0.2s;
}
.plot-card:hover { box-shadow: var(--shadow); }
.plot-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; color: var(--primary); }
.plot-card p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 4px; }
.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 12px;
}

/* Weather */
.weather-current {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    margin-bottom: 24px;
    text-align: center;
}
.weather-current h2 { color: white; margin-bottom: 16px; }
.weather-temp { font-size: 4rem; font-weight: 700; margin-bottom: 8px; }
.weather-desc { font-size: 1.25rem; opacity: 0.9; margin-bottom: 16px; }
.weather-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }
@media (min-width: 640px) { .weather-details { grid-template-columns: repeat(4, 1fr); } }
.weather-detail-item {
    background: rgba(255,255,255,0.15);
    padding: 16px;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}
.weather-detail-item .label { font-size: 0.85rem; opacity: 0.85; margin-bottom: 4px; }
.weather-detail-item .value { font-size: 1.25rem; font-weight: 700; }

/* Forecast */
.forecast-list { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 640px) { .forecast-list { flex-direction: row; flex-wrap: wrap; } .forecast-item { flex: 1; min-width: 140px; } }
.forecast-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}
@media (min-width: 640px) { .forecast-item { flex-direction: column; text-align: center; gap: 8px; } }
.forecast-item:hover { box-shadow: var(--shadow); }
.forecast-item .day { font-weight: 600; color: var(--text); }
.forecast-item .temp { color: var(--text-light); font-size: 0.9rem; }
.forecast-item .rain { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

/* Price Cards */
.price-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}
.price-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.price-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.price-info p { font-size: 0.85rem; color: var(--text-light); }
.price-value { text-align: right; }
.price-value .amount { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.price-value .unit { font-size: 0.8rem; color: var(--text-light); }

/* Advisory Cards */
.advisory-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    border-left: 4px solid var(--secondary);
    transition: all 0.2s;
}
.advisory-card:hover { box-shadow: var(--shadow); }
.advisory-card h4 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.advisory-card p { font-size: 0.95rem; color: var(--text-light); line-height: 1.6; }
.advisory-card.alert { border-left-color: var(--danger); background: #fef2f2; }
.advisory-card.success { border-left-color: var(--success); background: #f0fdf4; }

/* Nursery Cards */
.nursery-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    border-left: 4px solid var(--secondary);
    transition: all 0.2s;
}
.nursery-card:hover { box-shadow: var(--shadow); }
.nursery-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }
.nursery-card p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }

/* NPK Grid */
.npk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 480px) { .npk-grid { grid-template-columns: 1fr; } }
.npk-item { text-align: center; padding: 20px; border-radius: var(--radius); background: var(--bg); transition: all 0.2s; }
.npk-item:hover { transform: scale(1.02); }
.npk-item.nitrogen { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); }
.npk-item.phosphorus { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
.npk-item.potassium { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); }
.npk-item .label { font-size: 0.9rem; color: var(--text-light); margin-bottom: 8px; }
.npk-item .value { font-size: 2rem; font-weight: 700; color: var(--text); }
.npk-item .unit { font-size: 0.85rem; color: var(--text-light); }

/* Location Status */
.location-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    text-align: center;
}
.location-status.success { background: #f0fdf4; color: var(--primary); border: 1px solid #bbf7d0; }
.location-status.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state .icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { font-size: 1.1rem; margin-bottom: 8px; }

/* Loading */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.loading-spinner::before {
    content: '';
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 10px 0;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 100;
    border-top: 1px solid var(--border);
}
.nav-item {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.82rem;
    text-align: center;
    padding: 8px 24px;
    border-radius: var(--radius);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
.nav-item > span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-item:hover, .nav-item.active { color: var(--primary); background: #f0fdf4; }
.nav-item.active { font-weight: 600; }
.nav-item span:first-child { font-size: 1.25rem; }

/* Section Headers */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-header h2 { font-size: 1.25rem; font-weight: 600; }

/* Utility */
.hidden { display: none !important; }
.text-muted { color: var(--text-light); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }

/* WhatsApp Login Button */
.btn-whatsapp-large {
    width: 100%;
    max-width: 400px;
    padding: 16px 24px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    max-width: 400px;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.divider span {
    padding: 0 16px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Cross-link card used to jump between the government registry lists */
.next-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding: 14px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.next-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.next-card .nc-icon { font-size: 1.5rem; flex-shrink: 0; }
.next-card .nc-text { flex: 1; min-width: 0; }
.next-card .nc-text strong { display: block; color: var(--primary); font-size: 0.92rem; margin-bottom: 2px; }
.next-card .nc-text small { display: block; color: var(--text-light); font-size: 0.78rem; line-height: 1.5; }
.next-card .nc-go { color: var(--primary); font-weight: 700; flex-shrink: 0; }
