/**
 * Soil Query System - Custom Styles
 */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #00833f 0%, #005a2c 100%);
    padding: 30px;
    border-radius: 8px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Map Container */
#soil-map {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ol-control button {
    background-color: #00833f !important;
}

.ol-control button:hover {
    background-color: #005a2c !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 8px;
    margin-bottom: 20px;
}

.card-header {
    border-radius: 8px 8px 0 0 !important;
    font-weight: 600;
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

/* Form Elements */
.form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
}

.form-control:focus {
    border-color: #00833f;
    box-shadow: 0 0 0 0.2rem rgba(0, 131, 63, 0.25);
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* Buttons */
.btn-primary {
    background-color: #00833f;
    border-color: #00833f;
    font-weight: 600;
    border-radius: 6px;
    padding: 12px 24px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #005a2c;
    border-color: #005a2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-outline-secondary {
    border-radius: 6px;
    border-width: 2px;
}

/* Loading Indicator */
#loading-indicator {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spinner-border {
    border-width: 4px;
}

/* Results Container */
#results-container {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    color: #666;
    font-weight: 600;
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: #00833f;
    background-color: #f8f9fa;
}

.nav-tabs .nav-link.active {
    color: #00833f;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid #00833f;
}

/* Table */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 700;
    color: #333;
    padding: 12px 15px;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Layer Selection */
.form-check {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.form-check:last-child {
    border-bottom: none;
}

.form-check-input {
    cursor: pointer;
    width: 1.2em;
    height: 1.2em;
}

.form-check-input:checked {
    background-color: #00833f;
    border-color: #00833f;
}

.form-check-label {
    cursor: pointer;
    margin-left: 8px;
    font-weight: 500;
}

/* Alerts */
.alert-info {
    background-color: #e7f3ff;
    border-color: #b3d9ff;
    color: #004085;
    border-radius: 6px;
}

.alert-light {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-description {
        font-size: 0.9rem;
    }
    
    #soil-map {
        height: 400px !important;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .card-header,
    .btn,
    #soil-map,
    .nav-tabs,
    .page-header {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .table {
        border: 1px solid #000;
    }
    
    .table th,
    .table td {
        border: 1px solid #000;
    }
}

/* Icon Styles */
.fas, .fa {
    margin-right: 6px;
}

/* Scrollbar personnalisé */
.card-body::-webkit-scrollbar {
    width: 8px;
}

.card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.card-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.card-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Success badge for data availability */
.data-available {
    color: #28a745;
    font-weight: bold;
}

.data-unavailable {
    color: #dc3545;
    font-style: italic;
}