/* Mobile-Optimized Farm Details Page Styles */

/* Mobile-first responsive design */
@media screen and (max-width: 768px) {
    /* Stack all grid columns on mobile */
    .farm-details-grid .mantine-Grid-col {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
    
    /* Compact farm header */
    .farm-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    .farm-header .mantine-Group-root {
        flex-wrap: wrap;
    }
    
    /* Mobile-friendly cards */
    .farm-detail-card {
        margin-bottom: 16px !important;
        padding: 12px !important;
    }
    
    .farm-detail-card .mantine-Card-root {
        padding: 12px !important;
    }
    
    /* Compact farmer info grid */
    .farmer-info-grid .mantine-Grid-col {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        margin-bottom: 8px;
    }
    
    /* Mobile map adjustments */
    .farm-location-map {
        height: 200px !important;
        margin-bottom: 16px;
    }
    
    /* Geographic info mobile layout */
    .geographic-info-grid .mantine-Grid-col {
        flex: 1 1 50% !important;
        max-width: 50% !important;
    }
    
    /* Units table mobile optimization */
    .units-table-container {
        overflow-x: auto !important;
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    .units-table {
        min-width: 600px;
        font-size: 12px !important;
    }
    
    .units-table th,
    .units-table td {
        padding: 6px 4px !important;
        font-size: 11px !important;
    }
    
    /* Hide less important columns on mobile */
    .units-table .hide-mobile {
        display: none !important;
    }
    
    /* DAF units mobile cards */
    .daf-units-mobile {
        display: block !important;
    }
    
    .daf-units-desktop {
        display: none !important;
    }
    
    .daf-unit-card {
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 12px;
        background: white;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .daf-unit-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
        font-weight: 600;
    }
    
    .daf-unit-species {
        color: #007bff;
        font-size: 14px;
        font-weight: 600;
    }
    
    .daf-unit-count {
        background: #f8f9fa;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 500;
    }
    
    .daf-unit-details {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .daf-unit-field {
        display: flex;
        justify-content: space-between;
        margin-bottom: 4px;
    }
    
    .daf-unit-label {
        color: #666;
        font-weight: 500;
    }
    
    .daf-unit-value {
        color: #333;
        text-align: right;
    }
    
    /* Mobile-friendly buttons */
    .farm-action-buttons {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .farm-action-buttons .mantine-Button-root {
        width: 100% !important;
    }
    
    /* Navigation breadcrumbs */
    .farm-navigation {
        margin-bottom: 16px !important;
    }
    
    .farm-navigation .mantine-Button-root {
        padding: 8px 12px !important;
        font-size: 14px !important;
    }
    
    /* Statistics cards mobile layout */
    .stats-grid .mantine-Grid-col {
        flex: 1 1 50% !important;
        max-width: 50% !important;
    }
    
    .stat-card {
        text-align: center;
        padding: 12px 8px !important;
    }
    
    .stat-card .stat-value {
        font-size: 18px !important;
        font-weight: 700;
    }
    
    .stat-card .stat-label {
        font-size: 11px !important;
        margin-top: 4px;
    }
    
    /* Mobile section headers */
    .section-header {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }
    
    .section-header .mdi {
        font-size: 20px !important;
    }
    
    /* Accordion adjustments for mobile */
    .farm-accordion .mantine-Accordion-content {
        padding: 12px !important;
    }
    
    .farm-accordion .mantine-Accordion-label {
        font-size: 16px !important;
        padding: 12px 16px !important;
    }
}

/* Tablet adjustments */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Two-column layout on tablet */
    .farm-details-grid .mantine-Grid-col[data-span="6"] {
        flex: 1 1 50% !important;
        max-width: 50% !important;
    }
    
    .farm-details-grid .mantine-Grid-col[data-span="4"] {
        flex: 1 1 33.333% !important;
        max-width: 33.333% !important;
    }
    
    /* Show DAF desktop table on tablet */
    .daf-units-mobile {
        display: none !important;
    }
    
    .daf-units-desktop {
        display: block !important;
    }
    
    /* Larger map on tablet */
    .farm-location-map {
        height: 300px !important;
    }
}

/* Desktop styles */
@media screen and (min-width: 1025px) {
    /* Hide mobile-specific elements */
    .daf-units-mobile {
        display: none !important;
    }
    
    .daf-units-desktop {
        display: block !important;
    }
    
    /* Full-size map on desktop */
    .farm-location-map {
        height: 400px !important;
    }
    
    /* Show all table columns on desktop */
    .units-table .hide-mobile {
        display: table-cell !important;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .farm-action-buttons .mantine-Button-root {
        min-height: 44px !important;
        font-size: 16px !important;
    }
    
    /* DAF unit cards touch improvements */
    .daf-unit-card:active {
        background-color: #f8f9fa;
    }
    
    /* Better spacing for touch */
    .farm-detail-card {
        margin-bottom: 20px !important;
    }
}

/* Loading states */
.farm-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 16px;
    color: #666;
}

/* Error states */
.farm-error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 10px 0;
}

/* Mobile-specific utility classes */
@media screen and (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-visible {
        display: block !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
    }
}
