/* styles.css - Estilos completos do AgroGestor */

:root {
    --primary-color: #198754;
    --secondary-color: #20c997;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 15px;
    --box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

/* Reset e configurações base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border: none;
    padding: 1.25rem;
}

/* Product Cards */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .product-info {
    margin-top: auto;
}

/* Grid de produtos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
}

/* Botões */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    padding: 0.5rem 1.5rem;
}

.btn-success {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(25, 135, 84, 0.3);
}

/* Formulários */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Mapa */
#map, #farmer-map, #modal-map {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    height: 300px;
}

.leaflet-popup-content {
    margin: 1rem;
}

.leaflet-popup-content-wrapper {
    border-radius: 10px;
}

/* Estados vazios */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Toast notifications */
.toast {
    border-radius: 10px;
    border: none;
    box-shadow: var(--box-shadow);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
}

.badge-organic {
    background: linear-gradient(45deg, #198754, #20c997);
}

/* Farmer dashboard específico */
.farmer-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.stats-card {
    transition: transform 0.2s;
    text-align: center;
}

.stats-card:hover {
    transform: translateY(-2px);
}

.product-item, .location-item {
    transition: transform 0.2s;
}

.product-item:hover, .location-item:hover {
    transform: translateX(5px);
}

/* Modal */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-map-container {
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
}

/* Responsividade */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .products-grid {
        gap: 1rem;
    }
}

/* Estados de validação */
.is-valid {
    border-color: var(--success-color) !important;
}

.is-invalid {
    border-color: var(--danger-color) !important;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-color);
}

.map-container {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

/* Estilos específicos para o mapa no modal */
#modal-map {
    width: 100%;
    height: 400px;
    min-height: 400px;
}

/* Garantir que o modal tenha altura suficiente */
.modal-dialog.modal-lg {
    max-width: 800px;
}

.modal-body {
    padding: 1.5rem;
}

/* Ajustes para o popup do mapa */
.leaflet-popup-content {
    margin: 12px;
    min-width: 200px;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.leaflet-popup-tip {
    box-shadow: none;
}

/* Garantir que o mapa se ajuste ao container */
.leaflet-container {
    background: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Botão no popup do mapa */
.map-popup .btn {
    margin-top: 8px;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}