/**
 * CSS personnalisé pour Banque Info
 */

/* Variables CSS */
:root {
    --primary-color: #000000;
    --secondary-color: #6c757d;
    --orange-color: #ff6900;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
}

/* Styles généraux */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

/* Header */
header img {
    transition: opacity 0.3s ease;
}

header img:hover {
    opacity: 0.8;
}

/* Cards personnalisées */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.bank-card .card-body {
    padding: 1.5rem;
}

.bank-card img {
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

/* Section 118 418 */
.service-118 {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--orange-color);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.service-118:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 105, 0, 0.2);
}

.service-118 .btn-118 {
    background-color: var(--orange-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: bold;
    display: inline-block;
    transform: skew(-10deg);
    margin: 0 0.25rem;
}

.service-118 .btn-118:hover {
    background-color: #e55a00;
}

/* Horaires */
.schedule-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.schedule-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 1rem;
}

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

.schedule-table tr:last-child td {
    border-bottom: none;
}

.schedule-closed {
    color: var(--secondary-color);
    font-style: italic;
}

/* Cartes de départements */
.dept-columns {
    column-count: 3;
    column-gap: 2rem;
    column-fill: balance;
}

@media (max-width: 768px) {
    .dept-columns {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .dept-columns {
        column-count: 1;
    }
}

.dept-item {
    break-inside: avoid;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: white;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.dept-item:hover {
    background-color: var(--light-gray);
    text-decoration: none;
    color: var(--primary-color);
}

/* Carte Leaflet */
.map-container {
    height: 300px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Breadcrumb personnalisé */
.breadcrumb {
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--secondary-color);
}

/* Services et équipements */
.equipment-list {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.equipment-list ul {
    margin: 0;
    padding-left: 1.5rem;
}

.equipment-list li {
    margin-bottom: 0.5rem;
}

/* Responsive images */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Utilitaires */
.text-small {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.section-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.hero-section .row.align-items-center {
    align-items: stretch !important;
}

.hero-section .col-md-6 {
    display: flex;
    flex-direction: column;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: white;
}

.hero-section h2 {
    color: white;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.9);
}

/* Logo container dans hero */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

/* CTA dans hero section */
.hero-section .cta-primary {
    display: flex;
    align-items: center;
    min-height: 120px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--orange-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 0;
}

.hero-section .cta-primary h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.hero-section .cta-primary p {
    color: #666;
    margin-bottom: 0;
}

.hero-section .cta-secondary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--orange-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 0;
}

.hero-section .cta-secondary h2 {
    color: #333;
}

.hero-section .cta-secondary p {
    color: #666;
}

/* Garder le texte blanc dans les boutons oranges */
.hero-section .btn-118 {
    color: white !important;
}

/* Texte blanc spécifique pour la page département */
.text-white-department {
    color: white !important;
}

/* Override Bootstrap primary color avec noir */
.btn-primary,
.btn-primary:link,
.btn-primary:visited,
.btn-primary:active,
.btn-primary:focus {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: white !important;
}

.btn-primary:hover,
.btn-primary:focus:hover {
    background-color: #333333 !important;
    border-color: #333333 !important;
    color: white !important;
}

.btn-primary i,
.btn-primary:hover i,
.btn-primary:focus i,
.btn-primary:active i {
    color: white !important;
}

/* Règles spécifiques pour contrer les liens oranges */
a.btn-primary,
a.btn-primary:hover,
a.btn-primary:focus,
a.btn-primary:active,
a.btn-primary:visited {
    color: white !important;
    text-decoration: none !important;
}

a.btn-primary i,
a.btn-primary:hover i,
a.btn-primary:focus i,
a.btn-primary:active i,
a.btn-primary:visited i {
    color: white !important;
}

/* Règle ultra-spécifique pour contrer le hover orange */
.btn.btn-primary:hover,
.btn.btn-primary:hover *,
a.btn.btn-primary:hover,
a.btn.btn-primary:hover * {
    color: white !important;
}

.btn-outline-primary {
    color: #000000 !important;
    border-color: #000000 !important;
}

.btn-outline-primary:hover {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: white !important;
}

.bg-primary {
    background-color: #000000 !important;
}

.text-primary {
    color: #000000 !important;
}

.badge.bg-primary {
    background-color: #000000 !important;
}

/* Section titles et autres éléments */
.section-title {
    color: #000000 !important;
    border-bottom-color: #000000 !important;
}

.card-header.bg-primary {
    background-color: #000000 !important;
}

/* Liens en orange */
a {
    color: var(--orange-color) !important;
}

a:hover {
    color: #e55a00 !important;
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section .cta-primary {
        min-height: auto;
        margin-top: 1rem;
    }
    
    .logo-container {
        min-height: auto;
        margin-bottom: 1rem;
    }
}

/* Cards d'agences cliquables */
.agency-card-clickable {
    transition: all 0.3s ease;
}

.agency-card-clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

a:hover .agency-card-clickable .card-title {
    color: var(--bs-primary) !important;
}

/* Lignes de tableau cliquables */
.table-row-clickable {
    transition: background-color 0.2s ease;
}

.table-row-clickable:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
}

/* Formulaire de recherche sur la home */
.search-form {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 3px solid var(--orange-color);
    box-shadow: 0 8px 25px rgba(255, 105, 0, 0.15);
    transition: all 0.3s ease;
}

.search-form:hover {
    box-shadow: 0 12px 35px rgba(255, 105, 0, 0.25);
}

.search-form h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.search-form h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--orange-color), #ff8533);
    border-radius: 2px;
}

/* Plus d'espace entre le titre et le premier label */
.search-form .search-step:first-child {
    margin-top: 2rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

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

.search-result-item::before {
    content: '\f3c5';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--orange-color);
}

.search-result-item:hover {
    background: linear-gradient(90deg, rgba(255, 105, 0, 0.1) 0%, rgba(255, 105, 0, 0.05) 100%);
    padding-left: 2rem;
    border-left: 3px solid var(--orange-color);
}

.search-result-item:hover::before {
    opacity: 1;
}

.search-result-item .result-type {
    font-size: 0.75rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-weight: 600;
}

.search-result-item .result-name {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 1rem;
    transition: color 0.3s ease;
}

.search-result-item:hover .result-name {
    color: var(--orange-color);
    font-weight: 600;
}

/* Select personnalisé avec logos */
.custom-select-wrapper {
    position: relative;
}

.bank-logo-option {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
}

.bank-logo-option img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-right: 0.5rem;
}

/* Bouton orange pour le formulaire de recherche */
.btn-orange {
    background-color: var(--orange-color) !important;
    border-color: var(--orange-color) !important;
    color: white !important;
}

.btn-orange:hover {
    background-color: #e55a00 !important;
    border-color: #e55a00 !important;
    color: white !important;
}

.btn-orange:disabled {
    background-color: #cccccc !important;
    border-color: #cccccc !important;
    color: #666666 !important;
}

/* Formulaire de recherche en deux étapes */
.search-step {
    transition: all 0.3s ease;
}

.search-step:not(:first-child) {
    margin-top: 1.5rem;
}

/* Amélioration des labels */
.search-form .form-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.search-form .form-label::before {
    content: '\f3c5';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 0.5rem;
    font-size: 1rem;
    color: var(--orange-color);
}

.search-form .form-label[for="bankSelect"]::before {
    content: '\f19c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* Amélioration des champs */
.search-form .form-control,
.search-form .form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

.search-form .form-control:focus,
.search-form .form-select:focus {
    border-color: var(--orange-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 105, 0, 0.25);
    background-color: #fff;
}

.search-form .form-control::placeholder {
    color: #8e9aaf;
    font-style: italic;
}

/* Animation d'apparition de l'étape 2 */
#step2 {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    margin-top: 1.5rem;
}

#step2.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}


/* Container pour le champ postal avec position relative */
.mb-3:has(#postalCodeInput) {
    position: relative;
}

/* Résultats d'autocomplétion pour code postal */
#postalCodeResults {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#postalCodeResults.show {
    display: block;
}

/* Amélioration des boutons du formulaire */
.search-form .btn {
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-form .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.search-form .btn:hover::before {
    width: 300px;
    height: 300px;
}

.search-form .btn i {
    transition: transform 0.3s ease;
}

.search-form .btn:hover i {
    transform: translateX(3px);
}

/* Bouton continuer avec style spécial */
#continueBtn {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: linear-gradient(45deg, var(--primary-color), #333333);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#continueBtn:not([style*="display: none"]) {
    opacity: 1;
    transform: scale(1) translateY(0);
}

#continueBtn:hover {
    background: linear-gradient(45deg, #333333, var(--primary-color));
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Bouton rechercher orange amélioré */
#searchBtn {
    background: linear-gradient(45deg, var(--orange-color), #ff8533);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 105, 0, 0.3);
    position: relative;
}

#searchBtn:hover {
    background: linear-gradient(45deg, #ff8533, var(--orange-color));
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 0, 0.4);
}

#searchBtn:disabled {
    background: #cccccc;
    box-shadow: none;
    transform: none;
}


/* Cartes de banques pour la page département */
.bank-card {
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.bank-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.bank-card a {
    color: inherit !important;
    text-decoration: none !important;
}

.bank-card a:hover {
    color: inherit !important;
}

.bank-card .card-body {
    padding: 1.25rem;
}

.bank-card .bank-logo {
    flex-shrink: 0;
    width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bank-card .bank-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.bank-card .bank-info {
    flex: 1;
}

.bank-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--primary-color) !important;
    transition: color 0.3s ease;
}

.bank-card:hover .card-title {
    color: var(--orange-color) !important;
}

.bank-card .card-text {
    font-size: 0.9rem;
    color: var(--secondary-color) !important;
    margin-bottom: 0;
}