:root {
    --primary-color: #3F3D8C;
    --secondary-color: #FFB81C;
    --background-color: #ffffff;
    --card-bg: #f8f9fa;
    --text-color: #333;
    --border-color: #e0e0e0;
}

.dark-theme {
    --primary-color: #f0f0f0;
    --secondary-color: #FFB81C;
    --background-color: #1A1A2E;
    --card-bg: #2D2D44;
    --text-color: #fff;
    --border-color: #444;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.container {
    max-width: 480px;
    margin: 20px auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.calculator-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.mode-selector {
    margin-bottom: 20px;
}

select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 16px;
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 16px;
    box-sizing: border-box;
}

.section-title {
    font-weight: 600;
    margin: 20px 0 15px;
    display: flex;
    align-items: center;
}

.section-title .dots {
    margin-left: 10px;
    display: flex;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    margin-right: 5px;
}

.dot.empty {
    background-color: var(--border-color);
}

.result-section {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 15px 0;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

button {
    flex: 1;
    padding: 15px;
    border-radius: 30px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calculate-btn {
    background-color: var(--secondary-color);
    color: #000;
}

.reset-btn {
    background-color: #ccc;
    color: #333;
}

.calculate-btn:hover {
    opacity: 0.9;
}

.toggle-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.toggle-option {
    display: flex;
    align-items: center;
}

.toggle-label {
    margin: 0 10px;
    padding: 0 5px;
    font-weight: 500;
}

.color-palette {
    display: flex;
    gap: 5px;
}

.color-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
}

/* Theme switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-top: 0;
}

.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: var(--secondary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* History Section Styles */
.history-section {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
}

#history-title {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    max-height: 200px; /* Limit height and add scroll if needed */
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
}

#history-list li {
    padding: 8px 5px;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.9rem;
}

#history-list li:last-child {
    border-bottom: none;
}

.clear-history-btn {
    display: block; /* Make it a block element */
    width: 100%; /* Full width */
    padding: 12px;
    border-radius: 10px;
    border: none;
    background-color: #dc3545; /* Red color for delete/clear */
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 10px; /* Add some space above */
}

.clear-history-btn:hover {
    background-color: #c82333; /* Darker red on hover */
}
