body {
    font-family: 'Poppins', Arial, sans-serif;
    background: linear-gradient(135deg, #e5cbed, #e3eeff);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: background 0.3s, color 0.3s;
}

body.dark-mode {
    color: #ffffff;
    background: linear-gradient(135deg, #31516d, #e3eeff);
}

.container {
    width: 90%;
    max-width: 800px;
    background: #ffffff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    transition: background 0.3s, color 0.3s;
}

body.dark-mode .container {
    background: #34495e;
    color: #ecf0f1;
}

.horizontal-container {
    display: flex;
    width: 100%;
    gap: 20px;
    flex-wrap: nowrap;
}

.history-section, .chart-container {
    width: 50%; /* Set width to 50% for both sections */
    background: #f7f9fc;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    max-height: 400px;
    overflow: auto; /* Add both vertical and horizontal scroll */
    transition: background 0.3s, color 0.3s;
}

body.dark-mode .history-section, 
body.dark-mode .chart-container {
    background: #34495e;
    color: #ecf0f1;
}

h1, h2 {
    text-align: center;
    color: #2c3e50;
}

body.dark-mode h1, 
body.dark-mode h2 {
    color: #ecf0f1;
}

.input-section, .output-section {
    margin-bottom: 20px;
}

input {
    width: calc(100% - 22px);
    padding: 12px;
    margin: 10px 0;
    border-radius: 10px;
    border: 1px solid #ccc;
    transition: background-color 0.3s, color 0.3s;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#clear-url {
    padding: 12px 16px;
    border: none;
    background-color: #dc3545;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

#clear-url:hover {
    background-color: #c82333;
}

body.dark-mode #clear-url {
    background-color: #6c757d;
    color: #ffffff;
}

body.dark-mode #clear-url:hover {
    background-color: #5a6268;
}


body.dark-mode input {
    background-color: #2c2c2c;
    color: #ffffff;
    border: 1px solid #555;
}

button {
    padding: 12px 24px;
    border: none;
    background-color: #28a745;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s, color 0.3s;
}

button:hover {
    background-color: #218838;
}

body.dark-mode button {
    background-color: #6c757d;
    color: #ffffff;
}

body.dark-mode button:hover {
    background-color: #5a6268;
}

#output {
    margin-top: 20px;
    text-align: left;
    word-wrap: break-word;
    max-height: 200px;
    overflow: auto; /* Add both vertical and horizontal scroll */
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode #output {
    background: #e7e9eb;
    color: black;
}

#loading-spinner {
    width: 50px;
    height: 50px;
    border: 8px solid #f3f3f3;
    border-top: 8px solid #28a745;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.history-item {
    background: #fdfdfd;
    border: 1px solid #ddd;
    padding: 15px;
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode .history-item {
    background: #34495e;
    border: 1px solid #555;
    color: white;
}

body.dark-mode .history-item a {
    color: rgb(244, 247, 145);
}

.delete-history {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 10px;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode .delete-history {
    background-color: #c0392b;
    color: white;
}

#myChart {
    width: 100%;
    height: 100%;
}

#history {
    max-height: 300px;
    overflow: auto; /* Add both vertical and horizontal scroll */
}
