/* Font import removed: fonts defined via SASS variables */

/* Variables */
:root {
    --primary: #cc271d;
    --bg-color: #fff;
    --text-color: #303030;
    --switch-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.1) inset;
    --transition: all 0.3s cubic-bezier(0.76, 0, 0.24, 1);
}

.dark body {
    --bg-color: #292639;
    --text-color: #ebeaf7;
    --switch-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.5) inset;
}

@media (prefers-color-scheme: dark) {
    body {
        --bg-color: #292639;
        --text-color: #ebeaf7;
        --switch-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.5) inset;
    }
    .light body {
        --bg-color: #fff;
        --text-color: #303030;
        --switch-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.1) inset;
    }
}

/* Setting font-families */

body {
    font-family: 'Nunito', sans-serif;
}

footer strong {
    font-weight: inherit !important;
}
.theme-transition {
    transition: background-color 0.3s ease, color 0.3s ease;
}


/* Divs & classes */

body::-webkit-scrollbar{
    display: none;
}

.container {
    padding-top: 1em;
    padding-bottom: 1em;
}

.row {
    padding-top: 0.5em;
    padding-bottom: 0.5em;
}

.card {
    margin-top: calc(1em + 20px);
    margin-bottom: calc(1em + 20px);
}

#criteresProd label,
#criteresDemo label {
    width: 20%;
    margin-bottom: 1em;
}
#exclusionProd label {
    width: 100%;
    margin-bottom: 0.5em;
}

.send-form {
    float: right;
    margin: 2em;
}

.welcome-banner {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.centering {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.carousel-item img {
    object-fit: cover !important;
    object-position: center !important;
    overflow: hidden !important;
}

.overlay {
    background-color: rgba(0, 0, 0, 0.25);
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100%;
    z-index: 1;
}

.carousel-item {
    position: relative;
}

.carousel-caption {
    position: absolute;
    top: 300px !important;
    bottom: 0 !important;
    z-index: 2;
}

.static-caption {
    position: absolute;
    z-index: 100;
    top: 300px;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    padding: 10px;
}

.static-caption h1 span, .carousel h2 span, .carousel h3 span {
    color: white;
    padding: 0 5px;
}

.main-content {
    width: 100vw;
    position: relative;
    z-index: 1;
    margin-bottom: 50px; /* Vous pouvez ajuster cette valeur selon vos besoins */
}

.no-center {
    justify-content: left;
    align-items: flex-start;
    text-align: left;
}

.scrollable-area {
    max-height: 500px;
    overflow: auto;
}

.timeline {
    border-left: 1px solid hsl(0, 0%, 90%);
    position: relative;
    list-style: none;
}

.timeline .timeline-item {
    position: relative;
}

.timeline .timeline-item:after {
    position: absolute;
    display: block;
    top: 0;
}

.timeline .timeline-item:after {
    background-color: hsl(0, 0%, 90%);
    left: -38px;
    border-radius: 50%;
    height: 11px;
    width: 11px;
    content: "";
}

svg path,
svg rect {
    fill: var(--primary);
}

/* Plugin colors */

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--primary) !important;
}

.irs--round .irs-handle {
    border: 4px solid var(--primary) !important;
}

.irs--round .irs-bar,
.irs--round .irs-from,
.irs--round .irs-to,
.irs--round .irs-single {
    background-color: var(--primary) !important;
}

.irs--round .irs-from:before,
.irs--round .irs-to:before,
.irs--round .irs-single:before {
    border-top-color: var(--primary) !important;
}

/* Responsive */

@media (max-width: 767px) {
    #criteresProd label,
    #criteresDemo label {
        width: 30%;
        margin-bottom: 1em;
    }
    #exclusionProd label {
        width: 100%;
    }
}


/* link outils and wiki mda */

.zoom-on-hover {
    transition: transform 0.3s ease; /* Transition douce */
}

.zoom-on-hover:hover {
    transform: scale(1.1);
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.6s ease, box-shadow 0.3s ease;
    z-index: 1;
}

/* barre de recherche */

.custom-search-bar {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.2rem;
}

/* glassmorphism effect */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.glass:hover {
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 40px rgba(31, 38, 135, 0.3);
    transform: translateY(-2px);
}
.card.glass {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.card.glass:hover {
    box-shadow: 0 8px 40px rgba(31, 38, 135, 0.3);
}
.modal-content.glass {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.modal-content.glass:hover {
    box-shadow: 0 8px 40px rgba(31, 38, 135, 0.3);
}
.card.glass .card-header {
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Gallery cards */
.gallery-card {
    min-height: 130px;
}

.gallery-card i {
    font-size: 2rem;
    color: var(--primary);
}

/* Exclusion production cards */
.exclusion-prod-card {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Dropdown animation */
.dropdown-menu {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
}
#navbar {
    position: relative;
    z-index: 1050;
}
.navbar .nav-item.dropdown:hover > .dropdown-menu,
.navbar .nav-item.dropdown:focus-within > .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transition: transform 0.2s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.25);
}

/* Hover effect for production buttons in light mode */
.theme-light #criteresProd .btn-outline-primary:hover {
    background-color: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.25);
}

/* Dark mode removed */

/* Bold accordion titles */
.card-header .btn {
    font-weight: bold;
    background: transparent;
    border: none;
    color: inherit;
    padding-left: 0;
}
.card-header .btn:hover {
    background: transparent;
    color: inherit;
    transform: none;
    box-shadow: none;
}

/* Responsive table in results */
@media (max-width: 767px) {
    #resultats table {
        font-size: 0.9rem;
    }
}
.card-header .btn:hover {
    transform: none;
    box-shadow: none;
}

/* Theme toggle icons */
.theme-dark .bi-moon {
    display: none;
}
.theme-light .bi-sun {
    display: none;
}

/* Dark mode toggle */
.theme-switch {
    display: flex;
    justify-content: center;
    align-items: center;
}

.theme-switch .checkbox {
    opacity: 0;
    position: absolute;
}

.theme-switch .label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 50px;
    position: relative;
    height: 40px;
    width: 80px;
    cursor: pointer;
    box-shadow: var(--switch-shadow);
    transition: var(--transition);
}

.theme-switch .label:hover .moon,
.theme-switch .label:hover .sun {
    transform: rotate(360deg);
}

.theme-switch .ball {
    transition: var(--transition);
    background-color: var(--text-color);
    position: absolute;
    border-radius: 50%;
    top: 5px;
    left: 5px;
    height: 30px;
    width: 30px;
}

.theme-switch .moon {
    color: #f1c40f;
    transform-origin: center center;
    transition: all 0.5s cubic-bezier(0.76, 0, 0.24, 1);
    transform: rotate(0);
}

.theme-switch .sun {
    color: #ff6b00;
    transform-origin: center center;
    transition: all 0.5s cubic-bezier(0.76, 0, 0.24, 1);
    transform: rotate(0);
}

.theme-switch .ball {
    transform: translatex(0);
}

/* Dark theme variables */
[data-bs-theme="dark"] {
    --bs-body-bg: #121212;
    --bs-body-color: #f8f9fa;
    --bs-link-color: #0d6efd;
    --bs-danger: #ff7a7a;
    --bs-danger-rgb: 255, 122, 122;
    --bs-primary: #ff7a7a;
    --bs-primary-rgb: 255, 122, 122;
    --primary: #ff7a7a;
    .btn-outline-primary {
        --bs-btn-color: #fff;
        color: var(--bs-body-color);
    }
    /* Ensure white text for all navbar items */
    .navbar .nav-link,
    .navbar .navbar-brand {
        color: #fff !important;
    }
    .navbar .nav-link:hover,
    .navbar .nav-link:focus {
        color: #fff !important;
    }
    /* Hover effect for production buttons in dark mode */
    #criteresProd .btn-outline-primary:hover {
        background-color: var(--primary);
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 8px 32px rgba(31, 38, 135, 0.25);
    }
    .btn-outline-dark {
        --bs-btn-color: #fff;
        --bs-btn-border-color: #fff;
        --bs-btn-hover-color: #212529;
        --bs-btn-hover-bg: #fff;
        --bs-btn-hover-border-color: #fff;
    }
    /* Make production icons white in dark mode */
    img[src*="images/simulation/production"] {
        filter: brightness(0) invert(1);
    }

    /* White color for slider min/max labels */
    .irs--round .irs-min,
    .irs--round .irs-max {
        color: var(--bs-body-color);
    }
    /* Force black text in select2 selections */
    .select2-selection__choice,
    .select2-selection__rendered {
        color: #000 !important;
        color: #000;
    }
    /* Black text for dropdown results */
    .select2-results__option {
        color: #000 !important;
    }
    /* Style for log detail buttons */
    .log-detail-btn {
        color: var(--bs-danger) !important;
        border: 1px solid var(--bs-danger) !important;
        padding: 0.125rem 0.5rem !important;
        border-radius: 0.25rem;
        transition: background-color 0.2s, color 0.2s;
    }

    .log-detail-btn:hover {
        background-color: var(--bs-danger);
        color: #fff !important;
    }
    /* Red text for log detail buttons */
    .log-detail-btn {
        color: var(--bs-danger) !important;
    }
.dark .theme-switch .ball {
    transform: translatex(40px);
}

/* Loader animation */
#loader-1 {
    width: 3rem;
    height: 3rem;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-color-scheme: dark) {
    .theme-switch .ball {
        transform: translatex(40px);
    }

    .light .theme-switch .ball {
        transform: translatex(0);
    }
}

}


/* Search email page */
.search-email-form .input-group { max-width: 600px; margin: 0 auto; }
.search-email-results { animation: fadeInUp 0.5s ease-in-out; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.search-email-tabs .nav-link { border-radius: .5rem; transition: background-color .3s ease; }
.search-email-tabs .nav-link.active { background-color: var(--primary); color: #fff; }
.search-email-results .card:hover { transform: translateY(-2px); }
.no-zoom:hover { transform: none; box-shadow: none; transition: none; z-index: auto; }

/* Exclusion geo tabs */
.exclusion-geo-tabs .nav-link { border-radius: .5rem; transition: background-color .3s ease; }
.exclusion-geo-tabs .nav-link.active { background-color: var(--primary); color: #fff; }

/* Hide default marker for details summary buttons */
details.exclusion-section summary.btn::-webkit-details-marker,
details.exclusion-section summary.btn::marker {
    display: none;
}
