/* General Styling */


/* Basic styling for the body and general containers */

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
    text-align: center;
    transition: background 0.3s, color 0.3s;
}

.container,
.controls {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    /* Center the containers */
    padding: 0px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    margin: 10px;
}


/* Decimal Input Styling */


/* Styling for decimal input fields */

.decimal-input {
    width: 100px;
}

@media (min-width: 600px) {
    .decimal-input::-webkit-outer-spin-button,
    .decimal-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
}

.decimal-input:invalid {
    border: 1px solid red;
}


/* Button Styling */


/* Styling for buttons */

button {
    background: #007BFF;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

button:hover {
    background: #0056b3;
}

.center-button {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
}

.currency-toggle {
    margin-left: 10px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    border: 1px solid #007BFF;
    background: white;
    color: #007BFF;
    transition: background 0.3s, color 0.3s;
}

.currency-toggle:hover {
    background: #007BFF;
    color: white;
}


/* Controls Section */


/* Styling for the controls section */

.controls {
    max-width: 1200px;
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.index-select {
    margin-bottom: 20px;
}

label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

input {
    padding: 5px;
    font-size: 14px;
    width: 70px;
    text-align: center;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]:focus {
    outline: none;
    border: 2px solid #007BFF;
    border-radius: 5px;
}


/* Plot Styling */


/* Returns plotContainer Styling */

#plotContainer {
    width: 100%;
    display: none;
    background: white;
    border: 2px solid #ddd;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    /* Smooth the corners */
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    transition: background 0.3s, color 0.3s;
    height: 600px;
    /* Reduce height to match the plot size */
}


/* Returns Container Styling */


/* Styling for the returns container */

#returnsContainer,
#totalPortfolioValueContainer,
#performanceTableContainer {
    width: 100%;
    max-width: 100%;
    margin-top: 0px;
    margin-bottom: 20px;
    display: none;
    background: white;
    border: 2px solid #ddd;
    padding: 20px;
    border-radius: 10px;
    /* Smooth the corners */
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    transition: background 0.3s, color 0.3s;
}

#performanceTableContainer {
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin-top: 0px;
    margin-bottom: 20px;
    background: white;
    border: 2px solid #ddd;
    padding: 20px;
    border-radius: 10px;
    /* Smooth the corners */
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    transition: background 0.3s, color 0.3s;
}

#performanceTable {
    width: 95%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    margin-top: 20px;
    margin-bottom: 20px;
    margin-left: 20px;
    margin-right: 20px;
    font-size: 16px;
    text-align: center;
}

#performanceTable thead {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

#performanceTable th,
#performanceTable td {
    padding: 12px;
    border: 1px solid #ddd;
}

#performanceTable tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

#performanceTable tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#performanceTable tbody tr:hover {
    background-color: #d1e7ff;
    transition: 0.3s;
}

.highlight {
    background-color: #0703d1;
    font-weight: bold;
}


/* Dark Mode Styling */


/* Styling for dark mode */

.dark-mode {
    background-color: #1a1a1a;
    color: #f4f4f4;
}

.dark-mode .controls {
    border-color: #555;
    background: #222;
    color: white;
}

.dark-mode button {
    background: #ff9800;
    color: black;
}

.dark-mode button:hover {
    background: #cc8400;
}

.dark-mode #returnsContainer,
.dark-mode #totalPortfolioValueContainer,
.dark-mode #performanceTableContainer,
.dark-mode #plotContainer {
    background: #222;
    color: white;
    box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.1);
    border: 2px solid #444;
}

.dark-mode #performanceTable thead {
    background-color: #ffa500;
    color: black;
}

.dark-mode #performanceTable th,
.dark-mode #performanceTable td {
    border-color: #555;
    color: white;
}

.dark-mode #performanceTable tbody tr:nth-child(even) {
    background-color: #333;
}

.dark-mode #performanceTable tbody tr:nth-child(odd) {
    background-color: #222;
}

.dark-mode #performanceTable tbody tr:hover {
    background-color: #555;
}

.dark-mode .highlight {
    background-color: #18a4f5;
    color: black;
}


/* Responsive Styling */


/* Styling for responsiveness */

@media (max-width: 600px) {
    .controls {
        grid-template-columns: 1fr;
    }
    input {
        width: 100%;
        font-size: 16px;
    }
    button {
        width: 100%;
    }
}


/* Transition Styling */


/* Styling for transitions */

body,
.controls,
#plot,
#performanceTable {
    transition: background 0.3s ease, color 0.3s ease;
}


/* Progress Bar Styling */

.progress-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    display: none;
    justify-content: center;
    align-items: center;
}

.progress-bar {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 20px;
    width: 0;
    background-color: #007bff;
    transition: width 0.3s;
    border-radius: 25px;
}