/* styles.css */

/* Variables globales */
:root {
    --primary-color: #001533;
    --secondary-color: #592720;
    --accent-color: #f0f0f0;
    --text-color: #333;
    --link-color: #0056b3;
    --hover-color: #004494;
    --border-color: #ddd;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Styles de base */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: var(--text-color);
}

.container, .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Barre de navigation */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 0;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.navbar h1 {
    font-size: 1.8rem;
    margin: 0;
}

.navbar h1 a {
	color: #fff;
	text-decoration: none;
}

.navbar p {
    margin: 5px 0 0;
    font-size: 1rem;
    opacity: 0.9;
}

/* Carte pour les filtres et résultats */
.card {
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Formulaire de recherche */
.form-label {
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 21, 51, 0.25);
}

.form-check {
    margin-bottom: 8px;
}

.search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: var(--hover-color);
}

.overflow-auto {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    padding: 10px;
    border-radius: 4px;
}

.form-check {
    margin-bottom: 6px;
    padding-left: 24px;
}

.category {
    margin-bottom: 10px;
}

.category-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: bold;
    padding: 5px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.toggle-icon {
    margin-right: 10px;
    font-weight: bold;
    display: inline-block;
    width: 10px;
    text-align: center;
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 15px;
}

.category-content.expanded {
    max-height: 1000px;
}

.category-checkbox {
    margin-right: 10px;
}

.sub-items {
    margin-top: 8px;
}

/* Tableaux de résultats */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th {
    background-color: #f8f9fa;
    padding: 10px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.table tr:hover {
    background-color: #f5f5f5;
}

/* Message aucun résultat */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 20px 0;
    list-style: none;
}

.pagination li {
    margin: 0 2px;
}

.pagination .page-link {
    display: block;
    padding: 8px 12px;
    color: var(--primary-color);
    text-decoration: none;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.pagination .page-link:hover {
    background-color: #f0f0f0;
}

.pagination .active .page-link {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}



.pagination .disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: white;
}

/* Pied de page */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.9rem;
    color: #6c757d;
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--link-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 15px;
    }
    
    .table {
        display: block;
        overflow-x: auto;
    }
}

.navbar {
    background-color: #003366;
    color: white;
    padding: 15px 0;
    margin-bottom: 20px;
}


footer {
    margin-top: 30px;
    padding: 15px 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Styles spécifiques pour la mise en page à deux colonnes */
.search-panel {
    margin-bottom: 20px;
}

/* Liste des résultats */
#results-list {
    overflow-y: auto;
    border-top: 1px solid rgba(0,0,0,.125);
}

#results-list .list-group-item {
    border-left: none;
    border-right: none;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#results-list .list-group-item:first-child {
    border-top: none;
}

#results-list .list-group-item:hover {
    background-color: #f8f9fa;
}

#results-list .list-group-item.active {
    background-color: #e9f0f9;
    border-color: #c6d9ec;
    color: #003366;
    font-weight: 500;
}

#results-list .list-group-item.active:hover {
    background-color: #dae8f6;
}

#decision-title {
	font-weight: 700;
}

/* Détail de la décision */
.decision-text {
    line-height: 1.6;
    text-align: justify;
    margin-top: 20px;
}

.meta-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.meta-info dt {
    font-weight: bold;
}

/* Style pour le surlignage des termes de recherche */
.highlight {
    background-color: #d0d3ff;
    padding: 0 2px;
    border-radius: 2px;
}

/* Pagination améliorée */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    color: #003366;
    border-color: #dee2e6;
    padding: 0.25rem 0.5rem;
}

.pagination .page-item.active .page-link {
    background-color: #003366;
    border-color: #003366;
}

/* Style pour la recherche */
.search-btn {
    background-color: #003366;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background-color: #002347;
}

/* Catégories de juridictions */
.category {
    margin-bottom: 10px;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 5px;
    cursor: pointer;
    font-weight: 500;
}

.category-header.expanded {
    background-color: #f1f8ff;
    border-radius: 4px;
}

.toggle-icon {
    display: inline-block;
    width: 16px;
    text-align: center;
    margin-right: 5px;
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 25px;
}

.category-content.expanded {
    max-height: 1000px;
}

/* Responsive */
@media (max-width: 767.98px) {
    #results-list {
        max-height: 400px;
    }
}

/* Styles pour la fonctionnalité de pliage/dépliage des critères de recherche */
.toggle-search-panel {
    background: none;
    border: none;
    color: #003366;
    transition: transform 0.3s ease;
}

.toggle-search-panel:hover {
    color: #002347;
}

.toggle-search-panel:focus {
    box-shadow: none;
    outline: none;
}

.card-header {
    padding: 0.75rem 1.25rem;
}

/* Animation pour le pliage/dépliage */
.card-body.collapse {
    transition: height 0.3s ease;
}

/* Styles pour les boutons de navigation entre décisions */
.decision-navigation {
    padding: 10px 0;
}

.decision-navigation button {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.decision-navigation button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#results-list .list-group-item {
    border-left: 4px solid transparent;
}

#results-list .list-group-item.active {
    background-color: #e2edf8;
    border-left: 4px solid #003366;
}

/* Style pour le cadre des critères de recherche */
.card:has(#searchForm) .card-header {
    cursor: pointer;
}