/* Polygon Features CSS - TaniMapping */

/* Polygon Area Section Styling */
.polygon-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.polygon-section .card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.polygon-section .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

/* Polygon Drawing Controls */
.polygon-controls {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.polygon-controls .btn-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.polygon-controls .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.polygon-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Drawing Mode Active State */
.polygon-controls .btn.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #0056b3;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* Coordinate Input Styling */
.coordinate-input-group {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.coordinate-input-group .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.coordinate-input-group .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Coordinate Display */
.coordinate-display {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.coordinate-display:focus {
    outline: none;
    border-color: #007bff;
    background: #fff;
}

/* Polygon Type Badges */
.polygon-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.polygon-type-badge.lahan {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.polygon-type-badge.irigasi {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.polygon-type-badge.buffer {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.polygon-type-badge.lainnya {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* Map Polygon Styling */
.leaflet-polygon {
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.leaflet-polygon:hover {
    stroke-width: 4;
    opacity: 0.8;
}

/* Polygon Point Markers */
.polygon-point-marker {
    z-index: 1000;
}

.polygon-point-marker div {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
}

/* Status Messages */
.polygon-status {
    border-radius: 8px;
    padding: 12px 15px;
    margin: 10px 0;
    font-weight: 500;
    border-left: 4px solid;
}

.polygon-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

.polygon-status.success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.polygon-status.warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

.polygon-status.error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .polygon-section {
        padding: 15px;
    }
    
    .polygon-controls .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .coordinate-input-group {
        padding: 10px;
    }
    
    .coordinate-display {
        font-size: 11px;
        padding: 10px;
    }
}

/* Animation Effects */
.polygon-section .card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects */
.polygon-section .btn:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

.polygon-section .form-control:hover {
    border-color: #adb5bd;
    transition: border-color 0.2s ease;
}

/* Loading States */
.polygon-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.polygon-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
