/* TLA Intervention Styles - Aligned with new brand colors */

/* Primary brand colors aligned with TLA theme */
.intervention-primary {
    color: #009933;
}

.intervention-secondary {
    color: #007722;
}

.intervention-dark {
    color: #004c28;
}

/* Button styles for interventions */
.btn-intervention {
    background-color: #009933;
    border-color: #009933;
    color: #fff;
}

.btn-intervention:hover {
    background-color: #007722;
    border-color: #007722;
    color: #fff;
}

.btn-intervention:focus,
.btn-intervention.focus {
    background-color: #009933;
    border-color: #009933;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(0, 153, 51, 0.5);
}

/* Intervention card styling */
.intervention-card {
    border-left: 4px solid #009933;
    background-color: rgba(0, 153, 51, 0.05);
    transition: all 0.3s ease;
}

.intervention-card:hover {
    border-left-color: #007722;
    background-color: rgba(0, 153, 51, 0.1);
}

/* Status indicators */
.intervention-status-active {
    color: #009933;
    background-color: #ccf2d9;
    border: 1px solid #99e6b8;
}

.intervention-status-pending {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
}

.intervention-status-completed {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #28a745;
}

.intervention-status-cancelled {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #dc3545;
}

/* Alert styles for interventions */
.alert-intervention {
    background-color: #ccf2d9;
    border-color: #99e6b8;
    color: #003d14;
}

.alert-intervention .alert-link {
    color: #007722;
}

/* Form styling */
.form-intervention .form-control:focus {
    border-color: #009933;
    box-shadow: 0 0 0 0.2rem rgba(0, 153, 51, 0.25);
}

.form-intervention .form-check-input:checked {
    background-color: #009933;
    border-color: #009933;
}

/* Table styling for intervention data */
.table-intervention {
    --bs-table-accent-bg: rgba(0, 153, 51, 0.05);
}

.table-intervention th {
    background-color: #007722;
    color: white;
    border-color: #009933;
}

.table-intervention td {
    border-color: rgba(0, 153, 51, 0.2);
}

.table-intervention tbody tr:hover {
    background-color: rgba(0, 153, 51, 0.1);
}

/* Intervention Page Specific Styles */
.condition-section {
    background: white;
    border-left: 4px solid #007E20;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0 5px 5px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.condition-header {
    background: #007E20;
    color: white;
    padding: 1rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    border-radius: 0 5px 0 0;
}

.condition-item {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid #007E20;
}

.period-badge {
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.species-tag {
    background: #6c757d;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
    display: inline-block;
}

.layer-info {
    background: #e9ecef;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

.no-conditions {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

/* Tables */
.conditions-table,
.unified-conditions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.conditions-table th,
.unified-conditions-table th {
    background: #007E20;
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: bold;
    font-size: 0.9rem;
}

.conditions-table td,
.unified-conditions-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
    font-size: 0.9rem;
}

.conditions-table tbody tr:hover,
.unified-conditions-table tbody tr:hover {
    background: #f8f9fa;
}

/* Category Badges */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.category-habitat { background: #28a745; }
.category-fauna { background: #fd7e14; }
.category-flora { background: #20c997; }
.category-generale { background: #6c757d; }

.condition-name {
    font-weight: bold;
    color: #007E20;
    margin-bottom: 0.25rem;
}

.condition-description {
    font-size: 0.85rem;
    color: #666;
}

/* Buttons */
.species-count-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
}

.species-count-btn:hover {
    background: #138496;
}

.download-btn {
    background: #007E20;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    margin: 0.125rem;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    background: #005d17;
    color: white;
}

.download-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.excel-download {
    margin-bottom: 1rem;
    text-align: right;
}

/* Modal Styles */
.species-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.species-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 60%;
    max-width: 600px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.species-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.species-modal-body {
    flex: 1;
    overflow-y: auto;
    max-height: calc(70vh - 100px);
    padding-right: 0.5rem;
}

.species-modal-body::-webkit-scrollbar {
    width: 8px;
}

.species-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.species-modal-body::-webkit-scrollbar-thumb {
    background: #007E20;
    border-radius: 4px;
}

.species-modal-body::-webkit-scrollbar-thumb:hover {
    background: #005d17;
}

.species-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.species-close:hover {
    color: black;
}

.species-item {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.species-item:hover {
    background-color: #f8f9fa;
}

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

.species-count-indicator {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
    font-style: italic;
}

/* --- Spacing refinements for Intervento page --- */
/* Più aria nei box e testo meno vicino ai bordi */
.card {
    margin-bottom: 1.25rem;
}
.card .card-section {
    padding: 1.25rem 1.5rem;
}
/* Migliore ritmo tipografico dentro ai box */
.card .card-section h4,
.card .card-section h5 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}
.card .card-section p,
.card .card-section li {
    line-height: 1.6;
}
.card .card-section ul,
.card .card-section ol {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}
/* Compattezza su schermi piccoli */
@media (max-width: 640px) {
    .card .card-section {
        padding: 1rem 1.125rem;
    }
}
