/* ==========================================================================
   LERUOCARE DESIGN SYSTEM & CSS VARIABLES
   Rustic Cyber-Agri Palette for Botswana Farmers
   Calibrated for High-Contrast Outdoor Sunlight Readability & Tactile Touch
   ========================================================================== */

:root {
    /* High-Contrast Kalahari Earth Tones */
    --primary-brown: #8C5E3C;
    --primary-brown-dark: #684227;
    --primary-dark: #1E150F;
    --primary-hover: #754C2E;
    
    /* Backgrounds & Canvas */
    --bg-sand: #F6F4EB;
    --bg-sand-light: #FAF9F3;
    --bg-card: #FFFFFF;
    --bg-card-alt: #F4F1E6;
    
    /* Ecological Status Colors (WCAG AAA Contrast Compliant) */
    --accent-green: #2E7D32;
    --accent-green-dark: #1B5E20;
    --accent-green-light: #E8F5E9;
    
    --alert-red: #C62828;
    --alert-red-dark: #8E0000;
    --alert-red-light: #FFEBEE;
    
    --warning-orange: #D84315;
    --warning-orange-light: #FBE9E7;
    
    --info-blue: #1565C0;
    --info-blue-light: #E3F2FD;

    /* Tactile Borders & Lines */
    --border-color: #DDD6C1;
    --border-card: #C8BF9E;
    --border-focus: #8C5E3C;
    
    /* Glare-Resistant Typography Colors */
    --text-main: #1C252C;
    --text-dark: #0A0D10;
    --text-muted: #566573;
    --text-inverse: #FFFFFF;
    
    /* Tactile Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-elevated: 0 12px 32px rgba(30, 21, 15, 0.15);
    
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Mobile Touch Targets */
    --touch-target-min: 48px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: 'PT Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-sand);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-dark);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

p {
    margin: 0;
}

a {
    color: var(--primary-brown);
    text-decoration: none;
}

/* ==========================================================================
   BUTTON SYSTEM (Minimum 48px Touch Targets for Gloved / Field Use)
   ========================================================================== */
.btn-primary {
    background-color: var(--primary-brown);
    color: var(--text-inverse);
    border: none;
    min-height: var(--touch-target-min);
    padding: 10px 22px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--primary-dark);
    border: 2px solid var(--border-card);
    min-height: var(--touch-target-min);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-secondary:hover {
    background-color: var(--bg-sand-light);
    border-color: var(--primary-brown);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* ==========================================================================
   CARD & BENTO SYSTEMS
   ========================================================================== */
.bento-card {
    background: var(--bg-card);
    border: 2px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.bento-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-brown);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* ==========================================================================
   BADGES & STATUS PILLS (High-Contrast Outdoor Colors)
   ========================================================================== */
.badge-healthy {
    background-color: var(--accent-green-light);
    color: var(--accent-green-dark);
    border: 1px solid rgba(46, 125, 50, 0.4);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-alert {
    background-color: var(--alert-red-light);
    color: var(--alert-red-dark);
    border: 1px solid rgba(198, 40, 40, 0.4);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-warning {
    background-color: var(--warning-orange-light);
    color: var(--warning-orange);
    border: 1px solid rgba(216, 67, 21, 0.4);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-neutral {
    background-color: #ECEFF1;
    color: #37474F;
    border: 1px solid #CFD8DC;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
}

.meta-tag {
    background-color: var(--bg-sand-light);
    color: var(--primary-dark);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-block;
}

/* Filter Pills */
.filter-pills-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-pill {
    background: var(--bg-card);
    border: 2px solid var(--border-card);
    color: var(--text-main);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s ease;
}

.filter-pill:hover {
    border-color: var(--primary-brown);
    background: var(--bg-sand-light);
}

.filter-pill.active {
    background: var(--primary-dark);
    color: var(--text-inverse);
    border-color: var(--primary-dark);
}

/* ==========================================================================
   PROGRESS BARS
   ========================================================================== */
.progress-track {
    background: #E0DDD0;
    height: 8px;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-fill.fill-green {
    background: var(--accent-green);
}

.progress-fill.fill-brown {
    background: var(--primary-brown);
}

.progress-fill.fill-red {
    background: var(--alert-red);
}

/* Utilities */
.text-green { color: var(--accent-green-dark) !important; }
.text-red { color: var(--alert-red-dark) !important; }
.text-brown { color: var(--primary-brown) !important; }

/* Responsive Grid Fallbacks */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}
