:root {
    --background-light: #f0f4f8;
    --background-dark: #000000;
    --text-light: #333;
    --text-dark: #ffffff;
    --button-bg: #4CAF50;
    --button-hover-bg: #45a049;
    --button-active-bg: #3e8e41;
    --button-focus-outline: #4CAF50;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-light);
    color: var(--text-light);
    padding: 30px;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
}

body.dark-mode {
    background-color: var(--background-dark);
    color: var(--text-dark);
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0px 10px 25px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    color: #000000;
}

body.dark-mode h1 {
    color: #ffffff;
}


h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-top: 30px;
    color: #000;
}

body.dark-mode h2 {
    color: #ffffff;
}

h3 {
    text-align: center;
    font-size: 1.4rem;
    margin-top: 20px;
    color: #333;
}

body.dark-mode h3 {
    color: #ffffff;
}

/* Centering the image container */
.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

.image-container img {
    max-width: 75px;
    height: auto;
}

/* Centering the button using Flexbox */
.button-container {
    display: flex;
    justify-content: center; /* Center horizontally */
    margin-top: 20px; /* Add space from content above */
}

body.dark-mode .container {
    background-color: #333;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Button hover effect */
.button:hover {
    background-color: #45a049;
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

/* Button focus effect */
.button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(57, 107, 0, 0.6);
}

/* Button active effect */
.button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.table-container, .chart-container {
    width: 48%;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

body.dark-mode table, body.dark-mode th, body.dark-mode td {
    background-color: #333;
    color: #fff;
}

body.dark-mode th {
    background-color: #444;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

body.dark-mode tr:nth-child(even) {
    background-color: #444; 
}

tr:nth-child(odd) {
    background-color: #ffffff;
}

body.dark-mode tr:nth-child(odd) {
    background-color: #333;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px 15px; /* Increase padding for more breathing space */
    text-align: left;
    font-size: 1rem;
}

th {
    background-color: #f4f4f4;
    font-weight: 600;
    color: #333;
}

tr:hover {
    background-color: #f9f9f9; /* Light hover effect */
}

tr:nth-child(even) {
    background-color: #f9f9f9; /* Stripes for better readability */
}

tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Flexbox layout for the charts-container */
.charts-container {
    display: flex;
    justify-content: space-between; /* Spread elements evenly */
    align-items: flex-start; /* Align items to the top */
    gap: 20px; /* Space between the table and the chart */
    margin-top: 50px;
}

/* Style for the chart and legend container */
.chart-legend-container {
    flex: 1; /* Allow chart and legend to take up remaining space */
    text-align: center;
}

/* SVG container styles */
.chart-container {
    text-align: center;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

.legend div {
    width: 80px;
    height: 30px;
    margin: 5px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}

.switch-container {
    display: flex;
    justify-content: center;
  }
  
  .switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
  }


.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #bbbbbb;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #89C445;
}

input:focus + .slider {
  box-shadow: 0 0 1px #89C445;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .charts-container {
        flex-direction: column; /* Stack elements vertically */
        align-items: center;
    }

    .table-container, .chart-legend-container {
        width: 100%; /* Take full width */
    }
}

/* Make the layout responsive */
@media (max-width: 768px) {
    .charts-container {
        flex-direction: column; /* Stack elements on top of each other */
        align-items: center;
    }

    table {
        width: 45%;  /* Largeur de chaque tableau */
        margin: 20px auto;  /* Centrer le tableau horizontalement */
    }

    #chart-container {
        width: 80%; /* Chart takes up more space on smaller screens */
    }
}

@media (max-width: 480px) {
    table {
        font-size: 12px; /* Make text smaller for small screens */
    }

    #chart-container {
        width: 100%;
    }
}
