/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Roboto', sans-serif;
    background-color: #121212;
    color: #E0E0E0;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Header Styling */
header {
    background-color: #1F1F1F;
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: #00E5FF;
    margin-bottom: 10px;
}

header p {
    font-size: 1rem;
    color: #A0A0A0;
}

/* Main Section */
main {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Controls Section */
#controls {
    max-width: 800px;
    width: 100%;
    background-color: #1E1E1E;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    margin-bottom: 40px;
    transition: box-shadow 0.3s ease;
}

#controls:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

#controls h2 {
    font-size: 1.5rem;
    color: #00E5FF;
    margin-bottom: 15px;
}

#controls label {
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: #9E9E9E;
}

#controls input[type="text"] {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #555;
    border-radius: 5px;
    background-color: #2C2C2C;
    color: #E0E0E0;
    margin-bottom: 20px;
    transition: border-color 0.2s, background-color 0.2s;
}

#controls input[type="text"]:focus {
    outline: none;
    border-color: #00E5FF;
    background-color: #333;
}

.slider-container {
    display: flex;
    align-items: center;
    position: relative;
}

#riskTolerance {
    width: 70%;
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    border-radius: 5px;
    background: #333;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    cursor: pointer;
}

#riskTolerance:hover {
    opacity: 1;
}

#riskTolerance::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00E5FF;
    cursor: pointer;
}

#riskTolerance::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00E5FF;
    cursor: pointer;
}

#riskValue {
    color: #00E5FF;
    font-weight: bold;
    margin-left: 10px;
}

#optimizeButton {
    background-color: #00E5FF;
    color: #121212;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

#optimizeButton:hover {
    background-color: #00B8D4;
    transform: scale(1.05);
}

/* Visualization Section */
#visualization {
    max-width: 900px;
    width: 100%;
    text-align: center;
}

#visualization h2 {
    font-size: 1.5rem;
    color: #00E5FF;
    margin-bottom: 15px;
}

#chartContainer {
    margin: 0 auto;
    width: 800px;
    height: 400px;
    background-color: #1E1E1E;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

#chartContainer:hover {
    transform: scale(1.02);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Footer Styling */
footer {
    text-align: center;
    padding: 15px;
    background-color: #1F1F1F;
    border-top: 1px solid #333;
}

footer p {
    font-size: 0.9rem;
    color: #A0A0A0;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        padding: 10px;
    }

    #controls, #chartContainer {
        max-width: 100%;
    }

    #chartContainer {
        width: 100%;
        height: auto;
    }

    canvas {
        width: 100%;
        height: auto;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 0.9rem;
    }
}