:root {
    --institutional-color: #00a3a6;
    --declination1: #66d1bf;
    --declination2: #00b8be;
    --declination3: #275662;
    --black: #000;
    --white: #fff;
    --complementary1: #9dc544;
    --complementary2: #9ed6e3;
    --complementary3: #423089;
    --complementary4: #ed6e6c;
    --complementary5: #797870;
    --complementary6: #c4d0b3;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--black);
    background-color: var(--white);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    flex: 0 0 250px;
    padding: 20px;
    background: linear-gradient(180deg, var(--declination3) 0%, var(--institutional-color) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 2px 0 5px var(--shadow-color);
    overflow-y: auto;
    transition: width 0.3s ease;
}

.sidebar:hover {
    width: 300px;
}

.sidebar .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-img {
    width: 200px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.sidebar:hover .logo-img {
    transform: scale(1.1);
}

.logo-text {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--white);
    text-align: center;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    flex-grow: 1;
}

.sidebar ul li {
    margin: 10px 0;
}

.sidebar ul li a {
    color: var(--white);
    text-decoration: none;
    font-size: 1em;
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.sidebar ul li a .icon {
    margin-right: 10px;
}

.sidebar ul li a.active, .sidebar ul li a:hover {
    background-color: var(--declination1);
    color: var(--black);
    transform: translateX(5px);
}

.sidebar-footer {
    font-size: 0.8em;
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--white);
    color: var(--white);
}

.content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
}

.top-section {
    display: flex;
    flex-direction: column;
}

.parameters-header {
    background-color: var(--declination1);
    color: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--declination1), var(--declination2));
    position: relative;
    overflow: hidden;
}

.parameters-header::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    z-index: 0;
    animation: floating 6s linear infinite;
}

.parameters-header::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    z-index: 0;
    animation: floating 6s linear infinite reverse;
}

@keyframes floating {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(15px);
    }
    100% {
        transform: translateY(0);
    }
}

.parameters-header h1 {
    font-size: 1.5em;
    margin: 0;
    z-index: 1;
    position: relative;
}

.parameters-header p {
    font-size: 1em;
    margin: 10px 0 0 0;
    z-index: 1;
    position: relative;
}

.parameters-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.parameters-table th, .parameters-table td {
    padding: 10px;
    border: 1px solid var(--declination2);
    text-align: left;
    background-color: var(--white);
}

.parameters-table th {
    background-color: var(--declination2);
    color: var(--white);
}

.parameters-table td ul {
    list-style-type: none;
    padding: 0;
}

.parameters-table td ul li {
    margin-bottom: 10px;
}

.parameters-table td ul li:last-child {
    margin-bottom: 0;
}

.parameter-input {
    width: 60px;
    padding: 5px;
    margin: 5px 0;
    border: 1px solid var(--declination2);
    border-radius: 5px;
    box-shadow: 0 1px 3px var(--shadow-color);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.parameter-input:focus {
    border-color: var(--complementary3);
    box-shadow: 0 0 5px rgba(66, 48, 137, 0.5);
}

.formu {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.styled-select, .styled-input {
    padding: 10px;
    border: 1px solid var(--declination2);
    border-radius: 5px;
    box-shadow: 0 1px 3px var(--shadow-color);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.styled-select {
    flex: 1;
}

.styled-input {
    flex: 2;
}

.styled-select:focus, .styled-input:focus {
    border-color: var(--complementary3);
    box-shadow: 0 0 5px rgba(66, 48, 137, 0.5);
}

.map-section {
    display: flex;
    justify-content: space-between;
    flex-grow: 1;
    margin-top: 20px;
    margin-bottom: 20px;
    height: auto;
}

.map {
    width: 68%;
    height: 500px;
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.butt {
    width: 30%;
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow-color);
    padding: 20px;
    height: fit-content;
    margin-left: 20px;
}

.bu, .calcbutton {
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    background-color: var(--complementary4);
    color: var(--white);
    padding: 15px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px var(--shadow-color);
    margin-bottom: 15px;
}

.bu:hover, .calcbutton:hover {
    transform: scale(1.05);
}

.calcbutton {
    background-color: var(--complementary1);
}

.listitem {
    flex: 1;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--declination2);
    border-radius: 5px;
    box-shadow: 0 1px 3px var(--shadow-color);
    margin-top: 10px;
}

/* Spinner overlay */
#loading-overlay.hidden {
    display: none;
}

/* Spinner overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #00A3A6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Popups */
.infopopup, .sucpopup, .errorpopup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #00A3A6;
    padding: 10px 20px;
    border-radius: 5px;
    display: none;
    z-index: 10000;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.errorpopup {
    background: #D32F2F;
}

.msginfo, .msgerror {
    margin-top: auto;
    margin-bottom: auto;
    margin-left: 15px;
    color: white;
}

.footer {
    display: none;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .content {
        margin-left: 0;
        padding: 10px;
    }

    .map-section {
        flex-direction: column;
        height: auto;
    }

    .map {
        width: 100%;
        height: 50vh;
    }

    .butt {
        width: 100%;
        margin-left: 0;
    }
}

.parametrage .parameters-header {
    background-color: var(--declination1);
    color: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--declination1), var(--declination2));
    position: relative;
    overflow: hidden;
}

.parametrage .parameters-header::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    z-index: 0;
    animation: floating 6s linear infinite;
}

.parametrage .parameters-header::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    z-index: 0;
    animation: floating 6s linear infinite reverse;
}

@keyframes floating {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(15px);
    }
    100% {
        transform: translateY(0);
    }
}

.parametrage .parameters-header h1 {
    font-size: 1.5em;
    margin: 0;
    z-index: 1;
    position: relative;
}

.parametrage .parameters-header p {
    font-size: 1em;
    margin: 10px 0 0 0;
    z-index: 1;
    position: relative;
}

.parametrage .parameters-content {
    margin-bottom: 20px;
}

.parametrage .parameters-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.parametrage .parameters-table th, .parametrage .parameters-table td {
    padding: 10px;
    border: 1px solid var(--declination2);
    text-align: left;
    background-color: var(--white);
}

.parametrage .parameters-table th {
    background-color: var(--declination2);
    color: var(--white);
}

.parametrage .parameters-table td ul {
    list-style-type: none;
    padding: 0;
}

.parametrage .parameters-table td ul li {
    margin-bottom: 10px;
}

.parametrage .parameters-table td ul li:last-child {
    margin-bottom: 0;
}

.parameter-input {
    width: 60px;
    padding: 5px;
    margin: 5px 0;
    border: 1px solid var(--declination2);
    border-radius: 5px;
    box-shadow: 0 1px 3px var(--shadow-color);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.parameter-input:focus {
    border-color: var(--complementary3);
    box-shadow: 0 0 5px rgba(66, 48, 137, 0.5);
}

.itemlisted {
    margin: 10px 0;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.itemlisted button.add {
    margin-left: 10px;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
}

.itemlisted button.add:hover {
    background-color: #0056b3;
}

.hidden {
    display: none !important;
}

.section {
    display: none;
}

.section.active {
    display: block !important;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }
    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }
    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }
    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }
    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }
    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }
    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }
    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }
    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }
    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }
    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

.shake {
    animation: shake 0.5s;
    animation-iteration-count: 1;
}

.error {
    border: 2px solid red;
}

/* Style pour la liste des éléments */

#listElem {
    list-style-type: none;
    padding: 0;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
}

#listElem .elem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
    transition: background-color 0.3s, transform 0.3s;
}

#listElem .elem:last-child {
    border-bottom: none;
}

#listElem .elem:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

#listElem .elem input[type="hidden"] {
    display: none;
}

#listElem td {
    padding: 5px;
}

#listElem .delete-button {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
}

#listElem .delete-button:hover {
    background-color: #c82333;
}

#listElem .delete-button svg {
    width: 16px;
    height: 16px;
}

.list-item {
    padding: 8px;
}

tr.elem {
    background-color: #f9f9f9;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.3s;
    margin-top: 5px;
}

tr.elem:hover {
    background-color: #f1f1f1;
}

/* Styles pour le rapport */
#rapport {
    display: flex;
    flex-direction: row;
}

#summary {
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100vh;
    overflow-y: auto; /* Pour permettre le défilement */
    background: #f8f9fa;
    padding: 10px;
    border-left: 1px solid #ddd;
}

#summary h2 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

#summary-list {
    list-style: none;
    padding: 0;
}

#summary-list li {
    margin-bottom: 5px;
}

#summary-list a {
    text-decoration: none;
    color: var(--black);
    transition: color 0.3s;
}

#summary-list a:hover {
    color: var(--declination2);
}

#summary-list a.active {
    background-color: var(--declination1);
    color: var(--white);
    transform: translateX(5px);
}

#results {
    flex: 1;
    padding: 10px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    margin-right: 28%;
    overflow-x: auto;
}

.styleSection {
    padding-bottom: 25px;
}

#results h3 {
    background-color: var(--declination1);
    color: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    text-align: center;
    background: linear-gradient(135deg, var(--declination1), var(--declination2));
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

#results h3::before, #results h3::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    z-index: 0;
}

#results h3::before {
    top: -50px;
    left: -50px;
    animation: floating 6s linear infinite;
}

#results h3::after {
    bottom: -50px;
    right: -50px;
    animation: floating 6s linear infinite reverse;
}

#results .chart-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--complementary6);
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    margin-bottom: 20px;
}

#results .chart-container h4 {
    margin: 0;
}

#results .chart {
    width: 100%;
    max-width: 600px;
    height: 300px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    padding: 10px;
}

#results .data-container {
    flex: 1;
    padding: 10px;
    background-color: var(--complementary2);
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    margin-bottom: 20px;
}

#results .data-container h4 {
    margin-top: 0;
    color: var(--declination3);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--declination2);
}

#results .data-container p {
    margin: 5px 0;
}

.data-container {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Add space between the elements */
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.chart {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    box-shadow: 0 2px 8px var(--shadow-color);
    width: 100%; /* Ensure the chart takes the full width */
    max-width: 600px; /* Optional: limit the maximum width */
    align-self: center; /* Center the chart horizontally */
}

/* Ensure that the chart canvas takes the full width of its container */
.jqplot-grid-canvas {
    width: 100% !important;
}


.subsection-header {
    margin: 20px 0 10px;
    padding: 10px;
    border-bottom: 1px solid var(--declination2);
    font-size: 1.2em;
    font-weight: bold;
}

/* Dynamic summary fixed on the right-hand side */
#dynamic-summary {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 250px;
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 8px var(--shadow-color);
    overflow-y: auto;
    max-height: 90vh;
    z-index: 1000;
}

#dynamic-summary h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

#dynamic-summary ul {
    list-style: none;
    padding: 0;
}

#dynamic-summary ul li {
    margin: 5px 0;
}

#dynamic-summary ul li a {
    color: var(--declination3);
    text-decoration: none;
    transition: color 0.3s ease;
}

#dynamic-summary ul li a:hover {
    color: var(--complementary4);
}

#summary {
    width: 250px;
    margin-right: 20px;
    background-color: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow-color);
    color: var(--black);
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

#summary h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--white);
    text-align: center;
    background: linear-gradient(135deg, var(--declination1), var(--declination2));
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

#summary h2::before, #summary h2::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    z-index: 0;
}

#summary h2::before {
    top: -50px;
    left: -50px;
    animation: floating 6s linear infinite;
}

#summary h2::after {
    bottom: -50px;
    right: -50px;
    animation: floating 6s linear infinite reverse;
}

#summary-list {
    list-style: none;
    padding: 0;
}

#summary-list > li {
    margin-bottom: 10px;
}

#summary-list > li > a {
    display: block;
    padding: 10px;
    border-radius: 5px;
    background-color: var(--white);
    color: var(--declination3);
    text-decoration: none;
    transition: background-color 0.3s, transform 0.3s, color 0.3s;
}

#summary-list > li > a.active,
#summary-list > li > a:hover {
    background-color: var(--declination1);
    color: var(--white);
    transform: translateX(5px);
}

#summary-list ul {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
}

#summary-list ul li a {
    display: block;
    padding: 5px 10px;
    border-radius: 5px;
    background-color: var(--white);
    color: var (--declination3);
    text-decoration: none;
    transition: background-color 0.3s, transform 0.3s, color 0.3s;
}

#summary-list ul li a.active,
#summary-list ul li a:hover {
    background-color: var(--declination1);
    color: var(--white);
    transform: translateX(5px);
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
}

.styled-table th, .styled-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #ddd;
}

.styled-table th {
    background-color: #f2f2f2;
}

.data-row {
    font-size: 16px;
}

.data-value {
    font-weight: bold;
}

.formule-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.formules-content {
    background-color: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px var (--shadow-color);
    margin-top: 20px;
}

.equation {
    font-family: "Courier New", Courier, monospace;
    display: block;
    margin: 20px 0;
}

.legend {
    font-size: 0.9em;
    color: #555;
}

.epp-table {
    width: 700px;
}

.epp-cell-val {
    font-weight: 300;
    text-align: center;
    height: 30px;
}

.epp-cell-col-title {
    font-weight: 100;
    text-align: center;
    height: 30px;
}

.epp-cell-row-title {
    font-weight: 100;
    height: 30px;
}

.epp-cell-sub-sum {
    font-weight: 500;
    text-align: center;
    height: 30px;
}

.epp-cell-sum {
    text-align: center;
    font-weight: 900;
    height: 30px;
    align-items: center;
}

.cal-lev1 {
    font-weight: 500;
}

.cal-lev2 {
    font-weight: 300;
}

.cal-lev3 {
    font-weight: 100;
}

.val-lev1 {
    font-weight: 600;
}

.val-lev2 {
    font-weight: 400;
}

.val-lev3 {
    font-weight: 200;
}
