/* Agricultural Theme CSS */
:root {
    --primary-green: #28a745;
    --secondary-brown: #8b4513;
    --accent-orange: #fd7e14;
    --light-green: #d4edda;
    --dark-green: #155724;
    --earth-brown: #6f4e37;
    --golden-yellow: #ffc107;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Navigation Styles */
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
}

/* KPI Cards */
.kpi-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.kpi-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.kpi-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
}

/* Chart Containers - FIXED DIMENSIONS */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Fixed Chart Container Heights */
canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Table Styles */
.table-hover tbody tr:hover {
    background-color: var(--light-green);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.table thead th {
    background-color: var(--primary-green);
    color: white;
    font-weight: 600;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Badge Styles */
.badge {
    font-size: 0.8rem;
    padding: 0.5em 0.8em;
}

.badge.bg-success { background-color: var(--primary-green) !important; }
.badge.bg-warning { background-color: var(--golden-yellow) !important; }
.badge.bg-danger { background-color: #dc3545 !important; }
.badge.bg-info { background-color: #17a2b8 !important; }

/* Button Styles */
.btn {
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-success {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-success:hover {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
}

/* Recommendation Cards */
.recommendation-card {
    border-left: 5px solid;
    transition: all 0.3s ease;
}

.recommendation-card.best-employee {
    border-left-color: var(--golden-yellow);
}

.recommendation-card.best-area {
    border-left-color: var(--primary-green);
}

.recommendation-card.cost-alert {
    border-left-color: #dc3545;
}

.recommendation-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Insight Cards */
.insight-card {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary-green);
}

.insight-card h6 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.insight-card ul li {
    margin-bottom: 0.5rem;
    padding: 0.3rem 0;
}

/* Season Analysis */
.season-analysis {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid;
}

.season-analysis:nth-child(1) {
    border-left-color: var(--primary-green);
}

.season-analysis:nth-child(2) {
    border-left-color: var(--golden-yellow);
}

.season-analysis:nth-child(3) {
    border-left-color: #17a2b8;
}

/* Action Items */
.action-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

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

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Prediction Cards */
.prediction {
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Alerts */
.alert {
    border: none;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--primary-green);
    background-color: var(--light-green);
}

.alert-warning {
    border-left-color: var(--golden-yellow);
}

.alert-danger {
    border-left-color: #dc3545;
}

.alert-info {
    border-left-color: #17a2b8;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kpi-number {
        font-size: 2rem;
    }
    
    .kpi-icon {
        width: 60px;
        height: 60px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    /* Smaller chart containers on mobile */
    canvas {
        max-height: 250px !important;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(40, 167, 69, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-green);
    animation: spin 1s ease-in-out infinite;
}

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

/* Export Button Animation */
.btn-export {
    position: relative;
    overflow: hidden;
}

.btn-export:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255,255,255,0.3);
    border-radius: 50%;
    transition: width 0.6s, height 0.6s, top 0.6s, left 0.6s;
}

.btn-export:active:before {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
}

/* Soil type colors */
.text-brown {
    color: var(--earth-brown) !important;
}

.bg-brown {
    background-color: var(--earth-brown) !important;
}

/* Card hover effects */
.card-hover {
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Form enhancements */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

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

.status-active {
    background-color: var(--primary-green);
}

.status-pending {
    background-color: var(--golden-yellow);
}

.status-inactive {
    background-color: #dc3545;
}

/* Tooltip enhancements */
.tooltip-inner {
    background-color: var(--dark-green);
    font-size: 0.8rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--dark-green);
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        break-inside: avoid;
    }
    
    .container {
        max-width: 100% !important;
    }
}

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

/* Prevent scroll issues with charts */
.card-body canvas {
    display: block;
    box-sizing: border-box;
}

/* Fixed chart responsiveness */
.chart-responsive {
    position: relative;
    overflow: hidden;
}

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

/* Smooth transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent layout shifts */
.container-fluid,
.container {
    min-height: 1px;
}

/* Optimize table performance */
.table-responsive {
    will-change: scroll-position;
}

/* Better mobile experience */
@media (max-width: 768px) {
    .navbar-collapse {
        background-color: var(--primary-green);
        margin: 0 -15px;
        padding: 15px;
        border-radius: 5px;
        margin-top: 10px;
    }
}
/* Project Info Section - NUEVO */
.project-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
    border-left: 4px solid var(--primary-green);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    border-left: 3px solid var(--primary-green);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.info-card h3 {
    color: var(--dark-green);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.info-card h3 i {
    color: var(--primary-green);
    margin-right: 0.5rem;
}

.info-card p {
    margin-bottom: 0.5rem;
    color: #666;
    line-height: 1.5;
}

.info-card p strong {
    color: var(--dark-green);
}

.github-link {
    display: inline-block;
    background: #333;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.github-link:hover {
    background: #555;
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.github-link i {
    margin-right: 0.5rem;
}

/* Responsive para móvil */
@media (max-width: 768px) {
    .project-info {
        padding: 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-card {
        padding: 1rem;
    }
}