/* --- Dark Theme Variables --- */
:root {
    --bg-color: #222222;
    --surface-color: #2a2a40;
    --text-color: #e0e0f0;
    --primary-color: #89b4fa;
    --secondary-color: #cba6f7;
    --border-color: #44475a;
    --danger-color: #f38ba8;
    --danger-hover-color: #e6455f;
    --subtle-text: #a0a0c0;
    --slider-track-color: #44475a;
    --slider-thumb-color: var(--primary-color);
    --scrollbar-bg: var(--surface-color);
    --scrollbar-thumb: #626880;

    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color-scheme: dark;
}

/* --- General Styles --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

h1,
h2 {
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
}

h1 {
    color: var(--primary-color);
    margin-top: 15px;
    margin-bottom: 25px;
}

h2 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

#userAppliancesHeading .count {
    font-weight: normal; /* Make count slightly less bold than heading */
    font-size: 0.9em;   /* Slightly smaller */
    color: var(--subtle-text); /* Use a less prominent color */
    margin-left: 5px; /* Add a little space before the brackets */
}

/* --- Results Section --- */
#results {
    width: 100%;
    max-width: 600px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
}

#results h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--secondary-color);
    border-bottom: none;
}

#results p {
    margin: 10px 0;
    font-size: 1.1em;
}

#results strong {
    color: var(--primary-color);
    font-weight: 600;
}

#results .note {
    font-size: 0.75em;
}

/* --- Max Cost Checkbox Styling --- */
.max-cost-container {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    color: var(--subtle-text);
}

.max-cost-container input[type="checkbox"] {
    accent-color: var(--primary-color);
    /* Style checkbox color */
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.max-cost-container label {
    cursor: pointer;
}


/* --- Main Container & Sections --- */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
}

.appliance-section {
    flex: 1;
    min-width: 320px;
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* --- Appliance Lists --- */
.appliance-list {
    list-style-type: none;
    padding: 5px;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
}

.appliance-list::-webkit-scrollbar {
    width: 8px;
}

.appliance-list::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
    border-radius: 8px;
}

.appliance-list::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 8px;
    border: 2px solid var(--scrollbar-bg);
}

/* --- Individual List Items --- */
.appliance-list li {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin-bottom: 10px;
    border-radius: 8px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: background-color 0.2s ease;
}

.appliance-list.available li {
    flex-direction: row;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    gap: 15px;
}

.appliance-list.available li:hover {
    background-color: #3a3a52;
    border-color: var(--primary-color);
}

/* --- Remove Bar --- */
.remove-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 4px 8px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.remove-bar-button {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1.6em;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s ease, transform 0.1s ease;
}

.remove-bar-button:hover {
    color: var(--danger-hover-color);
    transform: scale(1.1);
}

/* --- Content inside User Selected LI --- */
.user-item-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 15px;
    gap: 10px 15px;
}

.user-item-content img {
    width: 35px;
    height: 35px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0.9) contrast(1.1);
}

.appliance-name {
    font-weight: 600;
    flex-grow: 1;
    color: var(--text-color);
}

.appliance-info {
    display: flex;
    align-items: center;
    flex-basis: 180px;
    flex-grow: 1;
    gap: 10px;
}

/* --- HIDE WATTAGE --- */
.appliance-wattage {
    display: none;
    /* Wattage is no longer displayed */
    /* Previous styles (optional to keep commented if you might bring it back)
    font-size: 0.8em;
    color: var(--subtle-text);
    margin-left: auto;
    white-space: nowrap;
    background-color: var(--surface-color);
    padding: 2px 6px;
    border-radius: 4px;
    */
}

.usage-controls {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 50px;
}

/* Add this rule or integrate into existing slider styles */
.usage-controls .slider-container label {
    min-width: 60px; /* Ensure labels align */
    text-align: right;
}

/* Optional: Style the quantity input specifically if needed */
.quantity-input {
    width: 70px; /* Adjust width as needed */
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color); /* Match theme */
    color: var(--text-color);
    font-size: 0.95em;
    text-align: center;
}


.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-container label {
    font-size: 0.9em;
    width: 60px;
    text-align: right;
    color: var(--subtle-text);
}

.slider-container input[type="range"] {
    flex-grow: 1;
    height: 6px;
    cursor: pointer;
    appearance: none;
    width: 100%;
    background: var(--slider-track-color);
    border-radius: 3px;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--slider-thumb-color);
    border-radius: 50%;
    cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--slider-thumb-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-value {
    font-size: 0.9em;
    font-weight: 600;
    min-width: 70px;
    text-align: left;
    color: var(--primary-color);
}



/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .appliance-section {
        min-width: 100%;
    }

    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.5em;
    }
}



@media (max-width: 480px) {

    h1 {
        font-size: 1.2em;
    }

    h2 {
        font-size: 1.1em;
    }

    .available-section {
        margin-bottom: 70px;
    }

    .usage-controls {
        padding-left: 15px;
    }
}
