:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --card-background: #ffffff;
    --secondary-text: #64748b;
    --link-color: #2563eb;
    --link-hover: #1d4ed8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.calculator-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.settings-panel, .devices-section, .time-section, .results-section {
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.settings-panel {
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.settings-panel .input-group {
    margin-bottom: 1.5rem;
}

.settings-panel .input-group:last-child {
    margin-bottom: 0;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.input-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--primary-hover);
}

.btn.secondary {
    background-color: var(--background-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn.secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.device-item {
    background-color: var(--card-background);
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.device-item .device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.device-item .remove-device {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.25rem;
}

.total-cost, .total-energy {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: #64748b;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #64748b;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 1rem;
}

#devicesList {
    margin-top: 1.5rem;
}

.breakdown-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.breakdown-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item .device-name {
    font-weight: 500;
}

.breakdown-item .device-cost {
    color: var(--primary-color);
}

.breakdown-item .device-energy {
    font-size: 0.9rem;
    color: #64748b;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .calculator-section {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

.comparison-section {
    background-color: var(--card-background);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.comparison-results {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.comparison-difference,
.comparison-percentage,
.comparison-details > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.75rem 0;
    font-size: 1.1em;
}

.comparison-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.positive-change {
    color: #10b981;
}

.negative-change {
    color: #ef4444;
}

.savings-section {
    background-color: var(--card-background);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
}

.savings-chart {
    margin-top: 1rem;
    min-height: 200px;
    background-color: var(--background-color);
    border-radius: 0.375rem;
    padding: 1rem;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: var(--background-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button input {
    flex: 1;
}

.input-with-button button {
    padding: 0.75rem;
    min-width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-with-button button span {
    font-size: 1.25rem;
    line-height: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: block;
}

.modal-content {
    position: relative;
    background-color: var(--card-background);
    border-radius: 0.5rem;
    width: 90%;
    max-width: 500px;
    margin: 2rem auto;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    animation: modalSlideIn 0.3s ease-out;
    z-index: 1001;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.5rem;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-footer .btn {
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
}

.modal-footer .btn.primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.modal-footer .btn.primary:hover {
    background-color: var(--primary-hover);
}

.modal-footer .btn.secondary {
    background-color: var(--background-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.modal-footer .btn.secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.intro-section {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.intro-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.intro-section p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.intro-section p:last-child {
    margin-bottom: 0;
}

.input-help {
    font-size: 0.875rem;
    color: var(--secondary-text);
    margin-top: 0.5rem;
}

.energy-saving-tips {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 1rem;
    margin-top: 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.energy-saving-tips h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.energy-saving-tips p {
    margin-bottom: 1rem;
}

.energy-saving-tips ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.energy-saving-tips li {
    margin-bottom: 0.5rem;
}

.energy-saving-tips a {
    color: var(--link-color);
    text-decoration: none;
}

.energy-saving-tips a:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

footer p {
    margin-bottom: 0.5rem;
} 