:root {
    --primary: #4CAF50;
    --primary-dark: #388E3C;
    --secondary: #FF9800;
    --accent: #2196F3;
    --dark: #2C3E50;
    --light: #F5F7FA;
    --white: #FFFFFF;
    --success: #8BC34A;
    --error: #F44336;
    --warning: #FFC107;
    --info: #00BCD4;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.15s ease;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --mobile-breakpoint: 768px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    color: var(--dark);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Backgrounds for different pages */
body.home {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(33, 150, 243, 0.1)), 
                url('/static/images/pexels-jplenio-1423600.jpeg') no-repeat center center fixed;
    background-size: cover;
}

body.login {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(33, 150, 243, 0.1)), 
                url('/static/images/login_background.jpeg') no-repeat center center fixed;
    background-size: cover;
}

body.farmer_dashboard {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(33, 150, 243, 0.1)), 
                url('/static/images/farmer_bg.jpeg') no-repeat center center fixed;
    background-size: cover;
}

body.govt_dashboard {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(33, 150, 243, 0.1)), 
                url('/static/images/govt_bg.png') no-repeat center center fixed;
    background-size: cover;
}

body.admin_dashboard {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(33, 150, 243, 0.1)), 
                url('/static/images/admin_bg.jpeg') no-repeat center center fixed;
    background-size: cover;
}

body.disease-detection {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(33, 150, 243, 0.1)), 
                url('/static/images/disease_bg.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* Header Styles */
header {
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    padding-bottom: 5rem;
}

header .overlay {
    width: 100%;
    padding: 3rem 1.5rem 5rem;
    color: var(--white);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

header h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.2;
    background: linear-gradient(to right, var(--white), #f3f3f3);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: fadeInDown 0.8s ease;
}

.header-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeIn 1s ease 0.3s both;
}

/* Floating particles animation */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
    }
}

/* Main Container */
.main-container {
    width: 100%;
    max-width: 1400px;
    margin: -3rem auto 0;
    padding: 0 1.5rem 3rem;
    position: relative;
    z-index: 2;
}

/* Card Styles */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0.1)
    );
    transform: rotate(30deg);
    z-index: -1;
}

.card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-xl);
}

.card-title {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    position: relative;
    padding-bottom: 0.75rem;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border-radius: 2px;
}

/* Glassmorphism effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

/* Form Styles */
.form-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.75rem;
    position: relative;
    animation: fadeInUp 0.5s ease;
}

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-control {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
    font-size: 1rem;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.3);
    border-color: var(--accent);
    transform: translateY(-2px);
}

textarea.form-control {
    border-radius: var(--border-radius);
    min-height: 140px;
    resize: vertical;
    padding: 1.25rem;
}

/* Floating Labels */
.floating-label-group {
    position: relative;
    margin-bottom: 1.75rem;
}

.floating-label {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    color: #777;
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition-fast);
    background: white;
    padding: 0 0.5rem;
    border-radius: 20px;
}

.form-control:focus + .floating-label,
.form-control:not(:placeholder-shown) + .floating-label {
    top: -0.6rem;
    left: 1rem;
    font-size: 0.8rem;
    color: var(--accent);
    background: linear-gradient(to bottom, white 50%, transparent 50%);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    min-width: 140px;
    height: 48px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    z-index: -1;
    transition: var(--transition);
    opacity: 0;
}

.btn:hover::before {
    opacity: 1;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, var(--secondary), #FF8A00);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.4);
}

.btn-danger {
    background: linear-gradient(45deg, #FF416C, #FF4B2B);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.btn i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Flash Messages */
.flashes-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem;
    animation: slideInDown 0.5s ease;
}

.flash {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: 500;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.flash::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
}

.flash.success {
    background-color: rgba(139, 195, 74, 0.9);
    color: #fff;
    border: 1px solid rgba(139, 195, 74, 0.3);
}

.flash.success::before {
    background-color: var(--success);
}

.flash.error {
    background-color: rgba(244, 67, 54, 0.9);
    color: #fff;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.flash.error::before {
    background-color: var(--error);
}

.flash.info {
    background-color: rgba(0, 188, 212, 0.9);
    color: #fff;
    border: 1px solid rgba(0, 188, 212, 0.3);
}

.flash.info::before {
    background-color: var(--info);
}

.flash.warning {
    background-color: rgba(255, 193, 7, 0.9);
    color: #fff;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.flash.warning::before {
    background-color: var(--warning);
}

/* User Type Selector */
.user-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.user-type-btn {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--success);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    flex: 1;
    min-width: 160px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.user-type-btn.active {
    background: var(--white);
    color: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.user-type-btn i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Horizontal Button Row */
.button-row {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.button-row form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.button-row .btn {
    flex: 1 1 auto;
    min-width: 160px;
}

/* Grid Container for Data Cards */
.grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
    margin-top: 1.75rem;
}

/* Data Card Styles */
.data-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.data-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.data-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.data-card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.1)
    );
    transform: rotate(30deg);
    z-index: 0;
}

.data-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.status-badge.complete {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
}

.status-badge.incomplete {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
}

.data-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    background: var(--white);
}

.data-card-body p {
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    color: var(--dark);
}

.data-card-body i {
    width: 1.5rem;
    text-align: center;
    color: var(--accent);
    font-size: 1.1rem;
}

.data-card-footer {
    padding: 1.25rem;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: right;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.data-card-footer .btn {
    min-width: auto;
    padding: 0.5rem 1rem;
    height: auto;
}

/* Search and Filter Styles */
.search-filter-container {
    margin-bottom: 2.5rem;
}

.search-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.75rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-md);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 1.1rem;
}

.input-with-icon .form-control {
    padding-left: 50px;
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.filter-row .form-group {
    flex: 1;
    min-width: 220px;
    margin-bottom: 0;
}

.filter-row .btn {
    height: fit-content;
    padding: 0.75rem 1.5rem;
}

/* Government Dashboard Specific Styles */
.dashboard-overview {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.summary-card {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(33, 150, 243, 0.1));
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: inline-block;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.action-card {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.action-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--shadow-xl);
}

.action-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
    transition: var(--transition);
}

.action-card:hover i {
    transform: scale(1.2);
    color: var(--accent);
}

.action-card span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    transition: var(--transition);
}

.action-card:hover span {
    color: var(--primary-dark);
}

.crop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.crop-card {
    background: rgba(72, 219, 169, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(72, 219, 169, 0.2);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.crop-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    background: rgba(72, 219, 169, 0.2);
}

.crop-card input[type="radio"] {
    display: none;
}

.crop-card label {
    display: block;
    padding: 1rem;
    text-align: center;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    background-color: rgba(72, 219, 169, 0.1);
    transition: var(--transition);
    cursor: pointer;
}

.crop-card input[type="radio"]:checked + label {
    border-color: var(--primary);
    background-color: rgba(72, 219, 169, 0.3);
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.current-crop {
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(18, 177, 209, 0.1);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.current-crop h4 {
    margin-bottom: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.current-crop-badge {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Farmer Dashboard Specific Styles */
/* Farmer Profile Overview Styles - Unique Classes */
.farmer-profile-overview {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 3rem;
    perspective: 1000px;
}

.farmer-profile-card {
    background: rgba(14, 112, 92, 0.98);
    border-radius: var(--border-radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transform-style: preserve-3d;
    animation: cardFloat 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.farmer-profile-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(76, 175, 80, 0.1),
        rgba(33, 150, 243, 0.1)
    );
    transform: rotate(30deg);
    z-index: 0;
}

/* @keyframes cardFloat {
    0%, 100% {
        transform: translateY(0) rotateY(0deg);
    }
    50% {
        transform: translateY(-20px) rotateY(5deg);
    }
} */

.farmer-profile-title {
    color: var(--primary-dark);
    font-size: 2.2rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.farmer-profile-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border-radius: 2px;
}

.farmer-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.farmer-stat-item {
    background: rgba(248, 249, 253, 0.9);
    border-radius: var(--border-radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(5px);
    transform-style: preserve-3d;
    transform: translateZ(0);
}

.farmer-stat-item:hover {
    transform: translateY(-10px) translateZ(10px);
    box-shadow: var(--shadow-lg);
    background: white;
}

.farmer-stat-item i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: block;
    transition: var(--transition);
}

.farmer-stat-item:hover i {
    transform: scale(1.2);
    color: var(--accent);
}

.farmer-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    transition: var(--transition);
}

.farmer-stat-item:hover .farmer-stat-value {
    color: var(--primary-dark);
}

.farmer-stat-label {
    font-size: 1.1rem;
    color: var(--dark);
    opacity: 0.9;
    font-weight: 500;
    transition: var(--transition);
}

.farmer-stat-item:hover .farmer-stat-label {
    opacity: 1;
}

/* Temperature Specific Styles */
.farmer-temperature-item {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 152, 0, 0.15));
    border: 1px solid rgba(255, 152, 0, 0.1);
}

.farmer-temperature-item i {
    color: var(--secondary);
}

.farmer-temperature-item .farmer-stat-value {
    color: var(--secondary);
}

/* Disease Detection Page */
.disease-detection-container {
    max-width: 800px;
    margin: 0 auto;
}

.tips-card {
    background: rgba(255, 255, 255, 0.95);
    margin-top: 2rem;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.tips-card h3 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tips-card h3 i {
    color: var(--secondary);
}

.tips-list {
    list-style: none;
    padding-left: 0;
}

.tips-list li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(76, 175, 80, 0.1);
    border-radius: var(--border-radius);
    position: relative;
    padding-left: 2.5rem;
    transition: var(--transition);
}

.tips-list li::before {
    content: '✓';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-weight: bold;
}

.tips-list li:hover {
    transform: translateX(10px);
    background: rgba(76, 175, 80, 0.2);
}

/* ====================================
   ENHANCED DISEASE DETECTION STYLES
   ==================================== */

.disease-detection-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    animation: fadeIn 0.6s ease;
}

.disease-header {
    display: flex;
    align-items: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 12px; /* Rounded rectangle */
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--white);
    margin-right: 1.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(-3px);
    box-shadow: var(--shadow-md);
}

.back-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.4);
    outline-offset: 2px;
}


.disease-title {
    font-size: 2rem;
    color: var(--white);
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    background: linear-gradient(to right, var(--white), #f3f3f3);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Image Upload Section */
.upload-section {
    margin-bottom: 3rem;
}

.upload-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.upload-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.upload-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.upload-header i {
    font-size: 1.8rem;
    color: var(--accent);
    margin-right: 1rem;
}

.upload-header h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin: 0;
}

.upload-instructions {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Enhanced Preview Area */
.preview-area {
    width: 100%;
    height: 350px;
    border: 2px dashed var(--accent);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-color: rgba(248, 249, 253, 0.8);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.preview-area:hover {
    border-color: var(--primary);
    background-color: rgba(248, 249, 253, 0.9);
    transform: translateY(-3px);
}

.preview-area.dragover {
    border-color: var(--primary);
    background-color: rgba(139, 195, 74, 0.1);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.default-message {
    text-align: center;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: var(--transition);
}

.default-message i {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
    transition: var(--transition);
}

.preview-area:hover .default-message i {
    transform: translateY(-5px) scale(1.1);
    color: var(--primary);
}

.small-text {
    font-size: 0.9rem;
    margin-top: 0.75rem;
    color: #999;
    max-width: 300px;
    line-height: 1.5;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: none;
}

/* Upload Button Styles */
.upload-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.upload-btn {
    position: relative;
    overflow: hidden;
    padding: 1rem 2rem;
    border-radius: 50px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.upload-btn i {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.upload-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading State */
.upload-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: var(--border-radius);
}

.progress-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(33, 150, 243, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.progress-text {
    color: var(--dark);
    font-weight: 500;
    margin-top: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.results-section {
    display: none;
    animation: fadeInUp 0.6s ease;
}

.results-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-top: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(76, 175, 80, 0.2);
}

.results-title {
    font-size: 1.75rem;
    color: var(--primary-dark);
    margin: 0;
    display: flex;
    align-items: center;
}

.results-title i {
    color: var(--accent);
    margin-right: 0.75rem;
}

.confidence-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.confidence-badge.high {
    background: linear-gradient(45deg, var(--success), #4CAF50);
    color: white;
}

.confidence-badge.medium {
    background: linear-gradient(45deg, var(--warning), #FFA000);
    color: var(--dark);
}

.confidence-badge.low {
    background: linear-gradient(45deg, var(--error), #E53935);
    color: white;
}

/* Enhanced Report Sections */
.report-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 1.5rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.report-item {
    display: flex;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.item-label {
    font-weight: 600;
    color: var(--dark);
    min-width: 150px;
    flex-shrink: 0;
}

.item-value {
    color: #555;
    flex: 1;
}

/* Treatment and Prevention Styles */
.treatment-section, .prevention-section {
    background: rgba(76, 175, 80, 0.05);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.treatment-type, .prevention-type {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.treatment-type i, .prevention-type i {
    margin-right: 0.75rem;
    color: var(--accent);
}

.treatment-list, .prevention-list {
    list-style: none;
    padding-left: 0;
}

.treatment-list li, .prevention-list li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    position: relative;
    padding-left: 2.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.treatment-list li::before, .prevention-list li::before {
    content: '✓';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-weight: bold;
}

.treatment-list li:hover, .prevention-list li:hover {
    transform: translateX(5px);
    background: white;
}

/* Error Message */
.file-error {
    color: var(--error);
    margin-top: 0.75rem;
    font-size: 0.9rem;
    text-align: center;
    min-height: 20px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .disease-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .back-button {
        margin-bottom: 1rem;
        margin-right: 0;
    }
    
    .preview-area {
        height: 250px;
    }
    
    .report-item {
        flex-direction: column;
    }
    
    .item-label {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .disease-title {
        font-size: 1.5rem;
    }
    
    .upload-card {
        padding: 1.5rem;
    }
    
    .preview-area {
        height: 200px;
    }
    
    .default-message i {
        font-size: 2.5rem;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .upload-card, .results-card {
        background: rgba(30, 41, 59, 0.9);
        color: var(--dark);
    }
    
    .preview-area {
        background-color: rgba(15, 23, 42, 0.7);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .preview-area:hover {
        background-color: rgba(15, 23, 42, 0.9);
    }
    
    .default-message {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .default-message i {
        color: var(--accent);
    }
    
    .upload-instructions {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .item-label {
        color: #a5b4fc;
    }
    
    .item-value {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .treatment-list li, .prevention-list li {
        background: rgba(15, 23, 42, 0.7);
        color: rgba(255, 255, 255, 0.9);
    }
    
    .treatment-list li:hover, .prevention-list li:hover {
        background: rgba(30, 41, 59, 0.9);
    }
    
    .upload-progress {
        background: rgba(2, 6, 23, 0.9);
    }
    
    .progress-text {
        color: var(--dark);
    }
}
/* Loading animation styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loader {
    --background: linear-gradient(135deg, var(--primary), var(--accent));
    --shadow: rgba(39, 94, 254, 0.28);
    --text: var(--dark);
    --page: rgba(255, 255, 255, 0.36);
    --page-fold: rgba(255, 255, 255, 0.52);
    --duration: 3s;
    width: 200px;
    height: 140px;
    position: relative;
}
  
.loader:before, .loader:after {
    --r: -6deg;
    content: "";
    position: absolute;
    bottom: 8px;
    width: 120px;
    top: 80%;
    box-shadow: 0 16px 12px var(--shadow);
    transform: rotate(var(--r));
}
  
.loader:before {
    left: 4px;
}
  
.loader:after {
    --r: 6deg;
    right: 4px;
}
  
.loader div {
    width: 100%;
    height: 100%;
    border-radius: 13px;
    position: relative;
    z-index: 1;
    perspective: 600px;
    box-shadow: 0 4px 6px var(--shadow);
    background-image: var(--background);
}
  
.loader div ul {
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
}
  
.loader div ul li {
    --r: 180deg;
    --o: 0;
    --c: var(--page);
    position: absolute;
    top: 10px;
    left: 10px;
    transform-origin: 100% 50%;
    color: var(--c);
    opacity: var(--o);
    transform: rotateY(var(--r));
    animation: var(--duration) ease infinite;
}
  
.loader div ul li:nth-child(2) {
    --c: var(--page-fold);
    animation-name: page-2;
}
  
.loader div ul li:nth-child(3) {
    --c: var(--page-fold);
    animation-name: page-3;
}
  
.loader div ul li:nth-child(4) {
    --c: var(--page-fold);
    animation-name: page-4;
}
  
.loader div ul li:nth-child(5) {
    --c: var(--page-fold);
    animation-name: page-5;
}
  
.loader div ul li svg {
    width: 90px;
    height: 120px;
    display: block;
}
  
.loader div ul li:first-child {
    --r: 0deg;
    --o: 1;
}
  
.loader div ul li:last-child {
    --o: 1;
}
  
.loading-overlay span {
    display: block;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 30px;
    text-align: center;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 500;
    max-width: 300px;
}

.btn-disabled {
    pointer-events: none;
    opacity: 0.7;
    transform: none !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .farmer-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .farmer-stat-item {
        padding: 1.5rem 1rem;
    }
    
    .farmer-stat-value {
        font-size: 1.8rem;
    }
    
    .farmer-profile-title {
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .farmer-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .farmer-profile-title {
        font-size: 1.8rem;
    }
    
    .farmer-profile-card {
        padding: 2rem 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .btn {
        min-width: 100%;
    }
    
    .button-row .btn {
        min-width: 100%;
    }
    
    .user-type-btn {
        min-width: 100%;
    }
}

/* Large Desktop Screens */
@media (min-width: 1200px) {
    .main-container {
        padding: 0 2rem 4rem;
    }
    
    .dashboard-overview {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .action-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    header h1 {
        font-size: 4rem;
    }
    
    .farmer-profile-title {
        font-size: 2.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #f5f7fa;
        --light: #2C3E50;
    }
    
    body {
        color: var(--dark);
    }
    
    .card, .data-card, .stat-item, .action-card, .crop-card, .farmer-stat-item {
        background: rgba(30, 41, 59, 0.9);
        color: var(--dark);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .form-control, textarea.form-control {
        background: rgba(15, 23, 42, 0.7);
        color: var(--dark);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .form-label, .data-card-body p, .stat-label, .farmer-stat-label {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .data-card-body i {
        color: var(--accent);
    }
    
    .data-card-footer {
        background: rgba(15, 23, 42, 0.7);
        border-color: rgba(255, 255, 255, 0.05);
    }
    
    .loading-overlay {
        background: rgba(15, 23, 42, 0.9);
    }
    
    .disease-report tr:nth-child(even) {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    .disease-report tr:hover {
        background-color: rgba(76, 175, 80, 0.1);
    }
}

/* Add this at the end of your styles.css file */

/* ======================
   DARK MODE ENHANCEMENTS 
   ====================== */
   @media (prefers-color-scheme: dark) {
    :root {
        --dark: #21f3e8;  /* Light text for dark mode */
        --light: #1e293b;  /* Dark background */
        --white: #0f172a;  /* Darker white for cards */
        --glass-bg: rgba(15, 23, 42, 0.7);
        --glass-border: rgba(255, 255, 255, 0.1);
    }

    body {
        color: var(--dark);
        background-blend-mode: overlay;
    }

    /* Text contrast fixes */
    .card-title,
    .farmer-profile-title,
    .stat-value,
    .farmer-stat-value,
    .data-card-header h3,
    .detail-label,
    .detail-value,
    .form-label,
    .floating-label,
    .current-crop h4,
    .disease-result h3,
    .tips-card h3,
    .btn-outline {
        color: var(--dark) !important;
    }

    /* Background adjustments */
    .card,
    .data-card,
    .stat-item,
    .action-card,
    .crop-card,
    .farmer-stat-item,
    .search-form,
    .current-crop,
    .disease-result,
    .tips-card,
    .form-control,
    textarea.form-control,
    .data-card-footer,
    .user-type-btn.active {
        background: rgba(15, 23, 42, 0.9);
        border-color: rgba(255, 255, 255, 0.1);
    }

    /* Special card backgrounds */
    .data-card-header {
        background: linear-gradient(135deg, #1a3a1a, #0d47a1) !important;
    }

    /* Form elements */
    .form-control,
    textarea.form-control {
        background: rgba(15, 23, 42, 0.7);
        color: var(--dark);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .form-control:focus {
        box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.5) !important;
    }

    /* Data display elements */
    .data-card-body p,
    .stat-label,
    .farmer-stat-label,
    .detail-item,
    .result-content,
    .tips-list li,
    .disease-report td {
        color: rgba(255, 255, 255, 0.9) !important;
    }

    .data-card-body i {
        color: var(--accent) !important;
    }

    /* Tables and lists */
    .disease-report tr:nth-child(even) {
        background-color: rgba(255, 255, 255, 0.05) !important;
    }

    .disease-report tr:hover {
        background-color: rgba(76, 175, 80, 0.1) !important;
    }

    /* Loading overlay */
    .loading-overlay {
        background: rgba(2, 6, 23, 0.9) !important;
    }

    .loading-overlay span {
        color: var(--dark) !important;
    }

    /* Button adjustments */
    .btn-outline {
        border-color: var(--dark) !important;
        color: var(--dark) !important;
    }

    .btn-outline:hover {
        background: rgba(255, 255, 255, 0.1) !important;
    }

    /* Status badges */
    .status-badge {
        color: var(--dark) !important;
    }

    /* Image upload area */
    .preview-area {
        background-color: rgba(15, 23, 42, 0.7) !important;
        border-color: rgba(255, 255, 255, 0.2) !important;
    }

    .preview-area:hover {
        background-color: rgba(15, 23, 42, 0.9) !important;
    }

    .default-message {
        color: rgba(255, 255, 255, 0.7) !important;
    }

    .default-message i {
        color: var(--accent) !important;
    }

    /* Flash messages */
    .flash {
        color: white !important;
    }

    .flash.success {
        background-color: rgba(46, 125, 50, 0.9) !important;
    }

    .flash.error {
        background-color: rgba(198, 40, 40, 0.9) !important;
    }

    .flash.info {
        background-color: rgba(2, 119, 189, 0.9) !important;
    }

    .flash.warning {
        background-color: rgba(245, 124, 0, 0.9) !important;
    }

    /* User type selector */
    .user-type-btn {
        background: rgba(255, 255, 255, 0.1) !important;
        border-color: rgba(255, 255, 255, 0.2) !important;
        color: var(--dark) !important;
    }

    .user-type-btn.active {
        background: rgba(255, 255, 255, 0.2) !important;
        color: var(--dark) !important;
    }

    /* Crop cards */
    .crop-card {
        background: rgba(76, 175, 80, 0.1) !important;
        border-color: rgba(76, 175, 80, 0.2) !important;
    }

    .crop-card:hover {
        background: rgba(76, 175, 80, 0.2) !important;
    }

    /* Current crop badge */
    .current-crop-badge {
        color: white !important;
    }

    /* Tips list */
    .tips-list li {
        background: rgba(76, 175, 80, 0.1) !important;
    }

    .tips-list li:hover {
        background: rgba(76, 175, 80, 0.2) !important;
    }

    /* Input with icon */
    .input-with-icon i {
        color: var(--accent) !important;
    }

    /* Detail items */
    .detail-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    /* Hero section adjustments */
    header .overlay {
        background: linear-gradient(135deg, rgba(26, 58, 26, 0.8), rgba(13, 71, 161, 0.8)) !important;
    }

    /* Login page specific */
    body.login {
        background: linear-gradient(135deg, rgba(26, 58, 26, 0.7), rgba(13, 71, 161, 0.7)), 
                    url('/static/images/login_background.jpg') no-repeat center center fixed !important;
    }

    /* Dashboard backgrounds */
    body.farmer_dashboard {
        background: linear-gradient(135deg, rgba(26, 58, 26, 0.7), rgba(13, 71, 161, 0.7)), 
                    url('/static/images/farmer_bg.jpeg') no-repeat center center fixed !important;
    }

    body.govt_dashboard {
        background: linear-gradient(135deg, rgba(26, 58, 26, 0.7), rgba(13, 71, 161, 0.7)), 
                    url('/static/images/govt_bg.png') no-repeat center center fixed !important;
    }

    body.admin_dashboard {
        background: linear-gradient(135deg, rgba(26, 58, 26, 0.7), rgba(13, 71, 161, 0.7)), 
                    url('/static/images/admin_bg.jpg') no-repeat center center fixed !important;
    }

    body.disease-detection {
        background: linear-gradient(135deg, rgba(26, 58, 26, 0.7), rgba(13, 71, 161, 0.7)), 
                    url('/static/images/disease_bg.jpg') no-repeat center center fixed !important;
    }

    /* Home page specific */
    body.home .hero-title,
    body.home .hero-text {
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5) !important;
    }

    /* Ensure all text is visible in dark mode */
    .text-danger,
    .text-muted,
    .small-text,
    .detail-label,
    .detail-value,
    .data-card-body p,
    .stat-label,
    .farmer-stat-label,
    .form-label,
    .floating-label,
    .current-crop h4,
    .disease-result h3,
    .tips-card h3,
    .btn-outline,
    .header-actions a,
    .welcome-msg {
        color: var(--dark) !important;
    }

    /* Fix for disabled buttons */
    .btn-disabled {
        opacity: 0.5 !important;
    }

    /* Fix for active states */
    .user-type-btn.active,
    .crop-card input[type="radio"]:checked + label {
        border-color: var(--accent) !important;
    }
}

/* Add this to the dark mode section of your styles.css */
@media (prefers-color-scheme: dark) {
    /* Disease Detection Results Table - Enhanced Dark Mode Styling */
    .disease-report {
        background: rgba(30, 41, 59, 0.9) !important;
        border-radius: var(--border-radius) !important;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    }

    .disease-report table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .disease-report tr:first-child td {
        background: rgba(33, 150, 243, 0.2) !important;
        border-bottom: 2px solid var(--accent) !important;
        color: var(--accent) !important;
        font-weight: 600;
    }

    .disease-report td {
        padding: 1rem 1.25rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        color: rgba(255, 255, 255, 0.9) !important;
        vertical-align: middle !important;
    }

    .disease-report td:first-child {
        color: #a5b4fc !important; /* Light purple for labels */
        font-weight: 500;
        width: 35% !important;
    }

    .disease-report tr:nth-child(even) td {
        background: rgba(255, 255, 255, 0.03) !important;
    }

    .disease-report tr:hover td {
        background: rgba(76, 175, 80, 0.15) !important;
    }

    .disease-report b {
        color: #4ade80 !important; /* Bright green for emphasis */
    }

    .disease-report u {
        color: #60a5fa !important; /* Light blue for underlined text */
        text-decoration-color: #60a5fa !important;
    }

    .disease-report i {
        color: #cbd5e1 !important; /* Light gray for italic text */
    }

    /* Special styling for the header row */
    .disease-report tr:first-child:hover td {
        background: rgba(33, 150, 243, 0.25) !important;
    }

    /* Add subtle animation for row hover */
    .disease-report tr {
        transition: background-color 0.2s ease;
    }

    /* Ensure the table fits well in the card */
    .disease-result .result-content {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Disease Report Styling - Responsive */
.disease-report {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Poppins', sans-serif;
    color: var(--dark);
}

.report-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.section-title {
    color: var(--primary-dark);
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 10px;
}

.report-item {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.report-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.item-label {
    font-weight: 600;
    color: var(--dark);
    width: 150px;
    flex-shrink: 0;
}

.item-value {
    flex: 1;
    min-width: 200px;
}

.treatment-item {
    margin-bottom: 1.2rem;
}

.treatment-type {
    display: block;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.treatment-list {
    padding-left: 1.5rem;
    margin: 0;
}

.treatment-list li {
    margin-bottom: 0.5rem;
    position: relative;
}

.treatment-list li::before {
    content: '→';
    position: absolute;
    left: -1.5rem;
    color: var(--primary);
}

.prevention-item {
    margin-bottom: 1rem;
}

.prevention-type {
    font-weight: 600;
    color: var(--secondary);
    display: block;
    margin-bottom: 0.3rem;
}

.prevention-detail {
    display: block;
    padding-left: 1rem;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .disease-report {
        color: var(--dark);
    }
    
    .report-section {
        background: rgba(30, 41, 59, 0.9);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .section-title {
        color: var(--primary);
        border-color: var(--primary);
    }
    
    .item-label {
        color: #a5b4fc;
    }
    
    .item-value {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .report-item {
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .treatment-type {
        color: #4ade80;
    }
    
    .prevention-type {
        color: #60a5fa;
    }
    
    .treatment-list li::before {
        color: var(--primary);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .report-item {
        flex-direction: column;
    }
    
    .item-label {
        width: 100%;
        margin-bottom: 0.3rem;
    }
    
    .item-value {
        width: 100%;
        min-width: 100%;
    }
    
    .report-section {
        padding: 1.2rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
}

.crop-recommendation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.crop-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
}

.crop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.crop-header h4 {
    margin: 0;
    color: #2c3e50;
}

.coverage-warning {
    color: #e74c3c;
    font-size: 14px;
}

.crop-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-item {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item i {
    width: 16px;
    text-align: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .crop-recommendation-grid {
        grid-template-columns: 1fr;
    }
    
    .crop-card {
        padding: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .crop-card {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .crop-header h4 {
        color: #ecf0f1;
    }
    
    .meta-item {
        color: #bdc3c7;
    }
}

/* Enhanced Dashboard Styles */
.dashboard-overview {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.welcome-card {
    background: linear-gradient(135deg, rgba(83, 215, 193, 0.703), rgba(8, 244, 201, 0.808));
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.welcome-card h2 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 2.2rem;
    font-weight: 700;
}

.welcome-card p {
    color: var(--dark);
    opacity: 0.8;
    font-size: 1.1rem;
    margin: 0;
}

/* Enhanced Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon.farmers { background: #3498db; }
.stat-icon.active { background: #27ae60; }
.stat-icon.locations { background: #9b59b6; }
.stat-icon.rainfall { background: #2980b9; }
.stat-icon.temperature { background: #e74c3c; }
.stat-icon.actions { background: #f39c12; }

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
    line-height: 1;
}

.stat-content p {
    margin: 0.5rem 0 0 0;
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Enhanced Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(52, 152, 219, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transition: left 0.5s ease;
}

.action-card:hover::before {
    left: 100%;
}

.action-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.action-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
    display: block;
    transition: var(--transition);
}

.action-card:hover .action-icon {
    transform: scale(1.1);
    color: var(--accent);
}

.action-content h3 {
    margin: 0 0 0.75rem 0;
    color: var(--dark);
    font-size: 1.4rem;
    font-weight: 600;
}

.action-content p {
    color: #6c757d;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Enhanced Locations List */
.locations-list {
    display: grid;
    gap: 1.25rem;
}

.location-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.location-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.location-item h4 {
    color: var(--dark);
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.location-item p {
    color: #6c757d;
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
}

.location-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.location-stats .stat {
    background: rgba(52, 152, 219, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--dark);
    border: 1px solid rgba(52, 152, 219, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Enhanced Farmer Cards */
.farmers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.farmer-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.farmer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: background-color 0.3s ease;
}

.farmer-card[data-status="active"]::before {
    background: var(--success);
}

.farmer-card[data-status="inactive"]::before {
    background: var(--warning);
}

.farmer-card[data-status="pending"]::before {
    background: var(--error);
}

.farmer-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.farmer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.farmer-header h3 {
    margin: 0;
    color: var(--dark);
    font-size: 1.25rem;
    font-weight: 600;
}

.status-badge {
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-active { background: #d4edda; color: #155724; }
.status-inactive { background: #fff3cd; color: #856404; }
.status-pending { background: #f8d7da; color: #721c24; }

.farmer-body {
    margin-bottom: 1.25rem;
}

.farmer-info p {
    margin: 0.5rem 0;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.farmer-info i {
    width: 1rem;
    color: var(--accent);
}

.farmer-crops {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(248, 249, 250, 0.8);
    border-radius: var(--border-radius);
}

.current-crop {
    color: var(--success);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.previous-crop {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.soil-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: #6c757d;
    font-size: 0.85rem;
}

.farmer-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.farmer-actions .btn {
    flex: 1;
    min-width: 80px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* Enhanced Crop Recommendation Grid */
.crop-recommendation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.crop-card {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.crop-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--success);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.crop-card:hover {
    border-color: var(--success);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.crop-card:hover::before {
    opacity: 1;
}

.crop-card.selected {
    border-color: var(--success);
    background: rgba(40, 167, 69, 0.05);
}

.crop-card.selected::before {
    opacity: 1;
}

.crop-card.low-coverage {
    border-color: var(--warning);
}

.crop-card.low-coverage::before {
    background: var(--warning);
}

.crop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.crop-header h4 {
    margin: 0;
    color: var(--dark);
    font-size: 1.2rem;
    font-weight: 600;
}

.coverage-warning {
    background: #fff3cd;
    color: #856404;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.crop-details {
    margin-bottom: 1rem;
}

.crop-meta {
    display: grid;
    gap: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.meta-item i {
    color: var(--accent);
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.meta-label {
    font-weight: 500;
    color: var(--dark);
}

.no-metadata {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crop-select-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--success);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 1.25rem;
}

.crop-card.selected .crop-select-indicator {
    opacity: 1;
}

/* Enhanced Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label.required::after {
    content: '*';
    color: var(--error);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 1;
}

.input-with-icon .form-control {
    padding-left: 3rem;
}

/* Enhanced Search and Filter */
.search-filter-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: end;
}

@media (max-width: 992px) {
    .search-row {
        grid-template-columns: 1fr;
    }
}

.search-group {
    margin-bottom: 0;
}

.filter-group {
    margin-bottom: 0;
    min-width: 200px;
}

/* Enhanced Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-info {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.btn-info:hover {
    background: #138496;
    border-color: #138496;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-block {
    width: 100%;
}

/* Enhanced Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-title {
    color: var(--dark);
    margin: 0 0 1.5rem 0;
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(52, 152, 219, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(52, 152, 219, 0.1);
}

/* Enhanced Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-left: 4px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Enhanced Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 1rem 0;
    color: var(--dark);
    font-size: 1.5rem;
}

.empty-state p {
    margin: 0 0 2rem 0;
    font-size: 1.1rem;
}

/* Enhanced Stats Row */
.stats-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(52, 152, 219, 0.1);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    flex: 1;
    min-width: 120px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* Enhanced Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #aaa;
    font-size: 1.75rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: var(--error);
    background: rgba(220, 53, 69, 0.1);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
    color: var(--primary);
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-spinner p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 992px) {
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .search-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .welcome-card {
        padding: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .farmers-grid {
        grid-template-columns: 1fr;
    }
    
    .crop-recommendation-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .farmer-actions {
        flex-direction: column;
    }
    
    .stats-row {
        flex-direction: column;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

