/* General Styles */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100vh;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #2c2c2c;
    color: #e0e0e0;
}

header {
    background-color: #4CAF50;
    width: 100%;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

header h1 {
    margin: 0;
    color: #fff;
    font-size: 2rem;
}

.language-switch {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.language-switch img {
    width: 40px;
    height: 30px;
    margin-left: 5px;
    cursor: pointer;
}

.theme-toggle {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.theme-label {
    margin-left: 10px;
    cursor: pointer;
    font-size: 1rem;
    color: #fff;
}

body.dark-mode .theme-label {
    color: #e0e0e0;
}

main {
    flex: 1;
    width: 90%;
    max-width: 1200px;
    margin: 20px 0;
}

.controls, .parameters {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: background-color 0.3s, color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

body.dark-mode .controls, body.dark-mode .parameters {
    background-color: #444;
    color: #e0e0e0;
}

.controls form, .date-picker, .forecast, .selected-dates {
    flex: 1 1 auto;
    margin: 10px;
}

.controls label, .parameters label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.controls select, .controls input, .parameters input {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode .controls select, body.dark-mode .controls input, body.dark-mode .parameters input {
    background-color: #666;
    color: #e0e0e0;
    border: 1px solid #888;
}

#loadingIndicator {
    display: none;
    background-color: rgba(255, 255, 255, 0.8);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 18px;
    color: #4CAF50;
    z-index: 9999;
}

#chartContainer {
    width: 100%;
    height: 500px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

body.dark-mode #chartContainer {
    background-color: #444;
}

canvas {
    width: 100% !important;
    height: 100% !important;
}

.parameters {
    margin-top: 20px;
    width: 100%;
}

.flex-container {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

body.dark-mode button {
    background-color: #66BB6A;
    color: #444;
}

.info {
    position: relative;
    display: inline-block;
}

.info-icon {
    font-size: 16px;
    cursor: pointer;
    margin-left: 5px;
    color: #4CAF50;
}

body.dark-mode .info-icon {
    color: #66BB6A;
}

.info-tooltip {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

body.dark-mode .info-tooltip {
    background-color: #333;
}

.info-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

body.dark-mode .info-tooltip::after {
    border-color: #333 transparent transparent transparent;
}

.info:hover .info-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Mobile Styles */
@media only screen and (max-width: 600px) {
    header {
        padding: 0.5rem;
    }

    header h1 {
        text-align: center;
        font-size: 1.5rem;
        padding-left: 6%;
    }

    .language-switch img {
        width: 30px;
        height: 20px;
    }

    .theme-toggle .switch {
        width: 50px;
        height: 28px;
    }

    .theme-toggle .slider:before {
        height: 22px;
        width: 22px;
        left: 3px;
        bottom: 3px;
    }

    .controls, .parameters {
        flex-direction: column;
    }

    .flex-container {
        flex-direction: column;
        align-items: stretch;
    }

    .controls form, .date-picker, .forecast, .selected-dates {
        margin: 8px 0;
        margin-right: 6%;
    }

    .info-tooltip {
        width: 150px;
        margin-left: -75px;
    }

    .language-switch, .theme-toggle {
        position: static;
        transform: none;
        justify-content: center;
        margin-top: 10px;
    }

    .theme-toggle {
        margin-bottom: 10px;
    }

    header {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #chartContainer {
        width: 94%;
        height: auto;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        margin-bottom: 20px;
        padding: 10px;
        position: relative;
    }

    /* Adjust canvas for better display on mobile */
    canvas {
        width: 100% !important;
        height: 300px !important; /* Adjust height as needed */
    }

    /* Adjust button and info icon for better layout */
    .flex-container button {
        flex: 1;
        padding: 8px 10px;
    }

    .info {
        display: flex;
        align-items: center;
    }

    .info-icon {
        margin-left: 5px;
        font-size: 1rem;
    }

}

