/* ===== VECTOR FARM — GLASSMORPHISM DESIGN SYSTEM ===== */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-bg-hover: rgba(255, 255, 255, 0.10);
    --glass-bg-active: rgba(255, 255, 255, 0.14);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-hover: rgba(255, 255, 255, 0.22);
    --glass-blur: 18px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);

    --text-primary: #f0f4f8;
    --text-secondary: rgba(240, 244, 248, 0.65);
    --text-muted: rgba(240, 244, 248, 0.4);

    --emerald: #34d399;
    --emerald-glow: rgba(52, 211, 153, 0.25);
    --amber: #fbbf24;
    --amber-glow: rgba(251, 191, 36, 0.25);
    --sky: #38bdf8;
    --sky-glow: rgba(56, 189, 248, 0.25);
    --rose: #fb7185;
    --rose-glow: rgba(251, 113, 133, 0.25);
    --violet: #a78bfa;
    --violet-glow: rgba(167, 139, 250, 0.25);
    --orange: #fb923c;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;

    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-med: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}
html { font-size: 15px; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.55;
}

/* --- Animated Background --- */
.bg-layer {
    position: fixed; inset: 0; z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(52, 211, 153, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(56, 189, 248, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse 70% 55% at 50% 50%, rgba(167, 139, 250, 0.07) 0%, transparent 50%),
        linear-gradient(160deg, #0a0f1a 0%, #111827 50%, #0f172a 100%);
    animation: bgShift 25s ease-in-out infinite alternate;
}
@keyframes bgShift {
    0% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(8deg) brightness(1.04); }
    100% { filter: hue-rotate(-5deg) brightness(0.97); }
}
.bg-grain {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px;
}

/* --- Weather Overlay --- */
.weather-overlay {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    transition: opacity var(--transition-slow);
    opacity: 0;
}
.weather-overlay.rain {
    opacity: 1;
    background: repeating-linear-gradient(
        transparent 0px, transparent 4px,
        rgba(56, 189, 248, 0.06) 4px, rgba(56, 189, 248, 0.06) 5px
    );
    animation: rainFall 0.4s linear infinite;
}
@keyframes rainFall {
    0% { background-position: 0 0; }
    100% { background-position: -10px 20px; }
}
.weather-overlay.storm {
    opacity: 1;
    background: repeating-linear-gradient(
        transparent 0px, transparent 3px,
        rgba(100, 140, 200, 0.1) 3px, rgba(100, 140, 200, 0.1) 4px
    );
    animation: rainFall 0.25s linear infinite, stormFlash 4s ease-in-out infinite;
}
@keyframes stormFlash {
    0%, 90%, 100% { box-shadow: none; }
    93% { box-shadow: inset 0 0 120px rgba(255,255,255,0.15); }
    95% { box-shadow: none; }
    97% { box-shadow: inset 0 0 80px rgba(255,255,255,0.1); }
}
.weather-overlay.sunny {
    opacity: 1;
    background: radial-gradient(ellipse 40% 30% at 75% 10%, rgba(251, 191, 36, 0.08) 0%, transparent 70%);
}
.weather-overlay.drought {
    opacity: 1;
    background: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(251, 113, 50, 0.10) 0%, transparent 70%);
}
.weather-overlay.frost {
    opacity: 1;
    background:
        radial-gradient(ellipse 80% 60% at 30% 80%, rgba(147, 197, 253, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 70% 20%, rgba(200, 220, 255, 0.06) 0%, transparent 50%);
}

/* --- Glass Panel --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.glass-panel:hover {
    border-color: var(--glass-border-hover);
}

/* --- App Container --- */
.app-container {
    position: relative; z-index: 2;
    max-width: 1420px;
    margin: 0 auto;
    padding: 12px 20px 30px;
    min-height: 100vh;
}

/* --- Top Bar --- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    margin-bottom: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    flex-wrap: wrap;
}
.top-bar-left { display: flex; align-items: center; gap: 8px; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 1.6rem; }
.logo-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--emerald), var(--sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.top-bar-center { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }

.stat-pill {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    white-space: nowrap;
}
.stat-icon { font-size: 1rem; }
.stat-label { color: var(--text-muted); font-weight: 500; }
.stat-value { font-weight: 600; color: var(--text-primary); }

.money-pill .stat-value { color: var(--amber); }
.level-pill .stat-value { color: var(--violet); }

.xp-bar-container {
    width: 80px; height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
}
.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--violet), var(--sky));
    border-radius: 99px;
    transition: width var(--transition-med);
}

/* --- Tab Navigation --- */
.tab-nav {
    display: flex;
    gap: 6px;
    padding: 6px;
    margin-bottom: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}
.tab-btn {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.tab-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}
.tab-btn.active {
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.25);
    color: var(--emerald);
    font-weight: 600;
}
.tab-icon { font-size: 1.15rem; }

/* --- Tab Panels --- */
.tab-panel { display: none; animation: fadeIn 0.35s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* --- Panel Titles --- */
.panel-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--emerald), #10b981);
    color: #fff;
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: 0 4px 15px var(--emerald-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px var(--emerald-glow);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background: rgba(255,255,255,0.07);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary);
}
.btn-danger {
    background: rgba(251, 113, 133, 0.15);
    color: var(--rose);
    border: 1px solid rgba(251, 113, 133, 0.2);
}
.btn-danger:hover {
    background: rgba(251, 113, 133, 0.25);
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-advance {
    min-width: 160px;
    font-size: 1rem;
    padding: 12px 28px;
}

/* --- FARM TAB --- */
.farm-layout {
    display: grid;
    grid-template-columns: 220px 1fr 240px;
    gap: 14px;
    align-items: start;
}

/* Farm Sidebar */
.farm-sidebar { padding: 16px; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 10px 4px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.tool-emoji { font-size: 1.2rem; }
.tool-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.tool-btn.active {
    background: rgba(52,211,153,0.12);
    border-color: rgba(52,211,153,0.3);
    color: var(--emerald);
}

.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 14px 0;
}

.inventory-list, .seed-selector {
    display: flex; flex-direction: column; gap: 5px;
    max-height: 200px;
    overflow-y: auto;
}
.inventory-item, .seed-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.inventory-item:hover, .seed-item:hover {
    background: rgba(255,255,255,0.07);
}
.seed-item.selected {
    background: rgba(52,211,153,0.1);
    border-color: rgba(52,211,153,0.25);
}
.item-name { display: flex; align-items: center; gap: 5px; }
.item-count {
    background: rgba(255,255,255,0.1);
    padding: 2px 7px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* Farm Grid */
.farm-grid-wrapper {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.farm-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 18px;
    width: 100%;
}
.farm-cell {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    font-size: 0.7rem;
}
.farm-cell:hover {
    border-color: rgba(52,211,153,0.4);
    transform: scale(1.04);
    z-index: 3;
}
.farm-cell.selected {
    border-color: var(--emerald);
    box-shadow: 0 0 15px var(--emerald-glow), inset 0 0 15px var(--emerald-glow);
}

/* Cell States */
.farm-cell.locked {
    background: rgba(255,255,255,0.02);
    border-style: dashed;
    border-color: rgba(255,255,255,0.08);
}
.farm-cell.locked .cell-emoji { opacity: 0.3; }
.farm-cell.empty {
    background: rgba(101, 67, 33, 0.15);
    border-color: rgba(101, 67, 33, 0.25);
}
.farm-cell.planted {
    background: rgba(52, 211, 153, 0.06);
    border-color: rgba(52, 211, 153, 0.15);
}
.farm-cell.growing {
    background: rgba(52, 211, 153, 0.10);
    border-color: rgba(52, 211, 153, 0.22);
}
.farm-cell.ready {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.3);
    animation: readyPulse 2s ease-in-out infinite;
}
@keyframes readyPulse {
    0%, 100% { box-shadow: 0 0 8px var(--amber-glow); }
    50% { box-shadow: 0 0 20px var(--amber-glow), inset 0 0 10px var(--amber-glow); }
}
.farm-cell.wilted {
    background: rgba(251, 113, 133, 0.08);
    border-color: rgba(251, 113, 133, 0.2);
}
.farm-cell.dead {
    background: rgba(100, 100, 100, 0.08);
    border-color: rgba(100, 100, 100, 0.15);
}

.cell-emoji { font-size: 1.6rem; line-height: 1; }
.cell-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-progress {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.06);
}
.cell-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald), var(--amber));
    transition: width var(--transition-med);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.cell-water-indicator {
    position: absolute; top: 4px; right: 4px;
    font-size: 0.6rem;
    opacity: 0.7;
}
.cell-fertilize-indicator {
    position: absolute; top: 4px; left: 4px;
    font-size: 0.6rem;
    opacity: 0.7;
}

.farm-controls {
    display: flex; gap: 10px; align-items: center;
}

/* Plot Info Panel */
.plot-info { padding: 16px; }
.plot-detail { font-size: 0.85rem; }
.plot-empty-msg { color: var(--text-muted); font-style: italic; }
.plot-stat {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.plot-stat:last-child { border-bottom: none; }
.plot-stat-label { color: var(--text-secondary); }
.plot-stat-value { font-weight: 600; }
.plot-actions { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

/* --- MARKET TAB --- */
.market-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.market-section { padding: 18px; }
.market-section:last-child { grid-column: 1 / -1; }
.market-grid { display: flex; flex-direction: column; gap: 8px; }
.market-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}
.market-item:hover { background: rgba(255,255,255,0.06); }
.market-item-info { display: flex; align-items: center; gap: 10px; }
.market-item-emoji { font-size: 1.4rem; }
.market-item-name { font-weight: 600; font-size: 0.9rem; }
.market-item-detail { color: var(--text-muted); font-size: 0.75rem; }
.market-item-price {
    font-weight: 700; font-size: 1rem;
    color: var(--amber);
}
.market-item-actions { display: flex; gap: 6px; align-items: center; }
.market-item-qty {
    width: 50px; text-align: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 5px;
    font-size: 0.85rem;
    font-family: var(--font-body);
}

.price-ticker { display: flex; flex-wrap: wrap; gap: 10px; }
.price-tag {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}
.price-tag-name { color: var(--text-secondary); }
.price-tag-value { font-weight: 700; color: var(--amber); }
.price-up { color: var(--emerald); }
.price-down { color: var(--rose); }

/* --- ANALYTICS TAB --- */
.analytics-layout { display: flex; flex-direction: column; gap: 14px; }
.analytics-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.analytics-stat-card {
    padding: 16px;
    text-align: center;
}
.analytics-stat-card .stat-icon { font-size: 1.5rem; display: block; margin-bottom: 6px; }
.analytics-stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
}
.analytics-stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 3px;
}

.analytics-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.chart-panel { padding: 18px; }
.chart-panel canvas { width: 100% !important; height: auto !important; border-radius: var(--radius-sm); }

.transaction-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 4px;
}
.transaction-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}
.transaction-item .tx-day { color: var(--text-muted); min-width: 55px; }
.transaction-item .tx-desc { flex: 1; margin: 0 12px; }
.transaction-item .tx-amount { font-weight: 600; }
.transaction-item .tx-amount.income { color: var(--emerald); }
.transaction-item .tx-amount.expense { color: var(--rose); }

/* --- ACHIEVEMENTS TAB --- */
.achievements-layout { display: flex; flex-direction: column; gap: 14px; }
.level-panel { padding: 22px; }
.level-header { display: flex; align-items: center; gap: 18px; }
.level-badge {
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--violet), var(--sky));
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 4px 20px var(--violet-glow);
}
.level-subtitle { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 8px; }
.level-progress-bar {
    width: 100%; height: 14px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}
.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--violet), var(--sky), var(--emerald));
    border-radius: 99px;
    transition: width var(--transition-med);
}
.level-progress-text {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 600;
    color: rgba(255,255,255,0.7);
}
.level-perks {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 14px;
}
.perk-tag {
    padding: 5px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 99px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.perk-tag.unlocked {
    background: rgba(52,211,153,0.1);
    border-color: rgba(52,211,153,0.2);
    color: var(--emerald);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.achievement-card {
    padding: 16px;
    display: flex; align-items: flex-start; gap: 12px;
    opacity: 0.5;
    transition: all var(--transition-fast);
}
.achievement-card.unlocked {
    opacity: 1;
    border-color: var(--amber) !important;
    box-shadow: 0 4px 15px var(--amber-glow);
}
.achievement-icon { font-size: 2rem; line-height: 1; }
.achievement-info { flex: 1; }
.achievement-name { font-weight: 600; font-size: 0.92rem; margin-bottom: 3px; }
.achievement-desc { color: var(--text-muted); font-size: 0.78rem; line-height: 1.4; }
.achievement-xp {
    font-size: 0.7rem; font-weight: 600;
    color: var(--violet);
    margin-top: 5px;
}

/* --- AI ADVISOR TAB --- */
.advisor-layout { display: flex; flex-direction: column; gap: 14px; }
.advisor-config { padding: 18px; }
.advisor-desc { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 12px; }
.api-key-input-group { display: flex; gap: 8px; }
.api-key-status { font-size: 0.8rem; margin-top: 8px; }
.api-key-status.success { color: var(--emerald); }
.api-key-status.error { color: var(--rose); }

.advisor-chat { padding: 18px; display: flex; flex-direction: column; }
.chat-messages {
    flex: 1;
    max-height: 420px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
    margin-bottom: 14px;
    padding: 4px;
}
.chat-msg {
    display: flex; gap: 10px; align-items: flex-start;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}
.chat-msg.user-msg { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.chat-bubble {
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-primary);
}
.user-msg .chat-bubble {
    background: rgba(52,211,153,0.1);
    border-color: rgba(52,211,153,0.2);
}
.chat-bubble.loading::after {
    content: '⠋';
    animation: dots 1s infinite steps(6);
}
@keyframes dots {
    0% { content: '⠋'; } 16% { content: '⠙'; } 33% { content: '⠹'; }
    50% { content: '⠸'; } 66% { content: '⠼'; } 83% { content: '⠴'; }
}

.chat-input-group { display: flex; gap: 8px; }

/* --- Input Fields --- */
.input-field {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: all var(--transition-fast);
}
.input-field:focus {
    border-color: rgba(52,211,153,0.4);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 12px var(--emerald-glow);
}
.input-field::placeholder { color: var(--text-muted); }

/* --- Toast Notifications --- */
.toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 18px;
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    font-size: 0.85rem;
    display: flex; align-items: center; gap: 8px;
    animation: toastIn 0.35s ease;
    max-width: 350px;
}
.toast.success { border-left: 3px solid var(--emerald); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.error { border-left: 3px solid var(--rose); }
.toast.info { border-left: 3px solid var(--sky); }
.toast.achievement { border-left: 3px solid var(--violet); border-color: rgba(167,139,250,0.3); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.toast-exit { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* --- Disclaimer Footer --- */
.disclaimer-footer {
    margin: 18px auto 28px;
    padding: 10px 16px;
    max-width: 1200px;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
    border-radius: 10px;
}
.disclaimer-footer .disclaimer-inner { background: rgba(255,255,255,0.02); padding: 8px 12px; border: 1px solid rgba(255,255,255,0.04); border-radius: 8px; }

/* --- Modal --- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.25s ease;
}
.modal {
    padding: 24px;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-close { margin-top: 14px; width: 100%; }
.crop-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.crop-option {
    display: flex; align-items: center; gap: 10px;
    padding: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.crop-option:hover {
    background: rgba(52,211,153,0.08);
    border-color: rgba(52,211,153,0.2);
}
.crop-option.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.crop-option-emoji { font-size: 1.5rem; }
.crop-option-info { flex: 1; }
.crop-option-name { font-weight: 600; font-size: 0.88rem; }
.crop-option-details { font-size: 0.72rem; color: var(--text-muted); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- Responsive --- */
@media (max-width: 1100px) {
    .farm-layout { grid-template-columns: 200px 1fr; }
    .plot-info { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
    html { font-size: 14px; }
    .app-container { padding: 8px 10px 20px; }
    .top-bar { padding: 10px 12px; flex-direction: column; gap: 8px; }
    .top-bar-center { justify-content: center; }
    .farm-layout { grid-template-columns: 1fr; }
    .farm-sidebar { order: 2; }
    .farm-grid-wrapper { order: 1; }
    .plot-info { order: 3; }
    .farm-grid { grid-template-columns: repeat(5, 1fr); }
    .market-layout { grid-template-columns: 1fr; }
    .analytics-stats-row { grid-template-columns: repeat(2, 1fr); }
    .analytics-charts-row { grid-template-columns: 1fr; }
    .tab-label { display: none; }
    .tab-btn { padding: 10px 8px; }
}
