/* Rice Crop Analytics - Modern Professional Theme */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700&display=swap');

:root {
    /* Modern Color Palette */
    --primary: #059669;
    /* Emerald green - main brand */
    --primary-light: #10b981;
    /* Lighter emerald */
    --primary-dark: #047857;
    /* Darker emerald */
    --primary-bg: #ecfdf5;
    /* Very light green bg */

    --secondary: #1e40af;
    /* Deep blue for accents */
    --accent: #f59e0b;
    /* Warm amber for highlights */
    --warning: #f59e0b;
    --danger: #ef4444;
    --success: #22c55e;
    --info: #3b82f6;

    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--gray-900);
}

/* Navigation - Modern Glass Effect */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    opacity: 0.9;
}

.navbar-nav .nav-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* KPI Cards - Glassmorphism Style */
.kpi-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.kpi-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.kpi-icon.bg-success-subtle {
    background: var(--primary-bg);
    color: var(--primary);
}

.kpi-icon.bg-primary-subtle {
    background: #eff6ff;
    color: var(--secondary);
}

.kpi-icon.bg-warning-subtle {
    background: #fffbeb;
    color: var(--accent);
}

.kpi-icon.bg-danger-subtle {
    background: #fef2f2;
    color: var(--danger);
}

.kpi-number {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-trend {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.kpi-trend.up {
    background: var(--primary-bg);
    color: var(--primary);
}

.kpi-trend.down {
    background: #fef2f2;
    color: var(--danger);
}

/* Cards - Clean Modern Style */
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-100);
    padding: 1rem 1.25rem;
}

.card-header .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header .card-title i {
    color: var(--primary);
}

.card-body {
    padding: 1.25rem;
}

/* Tables - Modern Clean Style */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
    padding: 0.875rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--primary-bg);
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-active {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.status-pending {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-inactive {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Badges - Modern Pills */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375em 0.75em;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.badge.bg-success {
    background: var(--primary-bg) !important;
    color: var(--primary) !important;
}

.badge.bg-primary {
    background: #eff6ff !important;
    color: var(--secondary) !important;
}

.badge.bg-warning {
    background: #fffbeb !important;
    color: #b45309 !important;
}

.badge.bg-danger {
    background: #fef2f2 !important;
    color: var(--danger) !important;
}

.badge.bg-info {
    background: #eff6ff !important;
    color: var(--info) !important;
}

.badge.bg-secondary {
    background: var(--gray-100) !important;
    color: var(--gray-600) !important;
}

.badge.bg-brown {
    background: #fef3c7 !important;
    color: #92400e !important;
}

/* Buttons - Modern Style */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    border: none;
}

.btn-success,
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-success:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-dark) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-success {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-success:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

/* Progress Bars - Sleek Style */
.progress {
    height: 6px;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transition: width 0.6s ease;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, var(--success) 0%, #4ade80 100%);
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%);
}

/* Recommendation Cards */
.recommendation-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.recommendation-card.best-employee {
    border-top: 3px solid var(--accent);
}

.recommendation-card.best-area {
    border-top: 3px solid var(--primary);
}

.recommendation-card.cost-alert {
    border-top: 3px solid var(--danger);
}

.recommendation-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.25rem;
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Alerts - Modern Style */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.alert-success {
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border-left: 4px solid var(--danger);
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-left: 4px solid var(--info);
}

/* Insight Cards */
.insight-card {
    padding: 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.insight-card h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
}

/* Season Analysis Bars */
.season-analysis {
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    margin-bottom: 0.75rem;
}

/* Action Items */
.action-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.action-item:last-child {
    border-bottom: none;
}

.action-priority {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Predictions */
.prediction {
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

/* Footer */
footer {
    background: var(--gray-900) !important;
    color: var(--gray-400);
    padding: 1.5rem 0;
    margin-top: 3rem;
}

footer p {
    margin: 0;
    font-size: 0.875rem;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ranking Icons */
.ranking-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 992px) {
    .kpi-number {
        font-size: 1.75rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .kpi-number {
        font-size: 1.5rem;
    }

    .kpi-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .chart-container {
        height: 250px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 200px;
    }

    .kpi-card .card-body {
        padding: 1rem;
    }

    .table thead th {
        font-size: 0.7rem;
    }
}

/* Print Styles */
@media print {

    .navbar,
    .btn,
    footer {
        display: none !important;
    }

    .card {
        border: 1px solid var(--gray-300) !important;
        break-inside: avoid;
    }

    body {
        background: white;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Text utilities */
.text-success {
    color: var(--primary) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: #b45309 !important;
}

.text-primary {
    color: var(--secondary) !important;
}

.text-muted {
    color: var(--gray-500) !important;
}

/* Background utilities */
.bg-success {
    background-color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--secondary) !important;
}

/* Author Footer Section */
.footer-author {
    background: linear-gradient(135deg, var(--gray-900) 0%, #0f172a 100%);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer-author::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
}

.author-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.author-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.author-info h3 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.author-role {
    color: var(--primary-light);
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    margin-bottom: 0.5rem;
    display: block;
}

.author-institution {
    color: var(--gray-400);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-desc {
    color: var(--gray-300);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.author-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-social {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-social:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    color: white;
}

/* Mobile Responsiveness for Footer */
@media (max-width: 768px) {
    .author-content {
        flex-direction: column;
        text-align: center;
        padding: 0 1rem;
    }

    .author-institution {
        justify-content: center;
    }

    .author-links {
        justify-content: center;
    }

    .footer-author {
        padding: 3rem 0 1.5rem;
    }
}