/* Match existing React UI appearance */
:root {
    --foreground: #ffffff;
    --background-start: #0a0a0a;
    --background-end: #1e1e1e;
    --card-bg: #000000;
    --border-color: #334155;
    --green: #15803d;
    --green-border: #16a34a;
    --error: #dc2626;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--foreground);
    background: linear-gradient(to bottom, transparent, var(--background-end)) var(--background-start);
    min-height: 100vh;
}

.container {
    max-width: 42rem;
    margin: 0 auto;
    padding: 1.5rem;
}

.units-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.unit-card {
    background: var(--card-bg);
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1rem;
}

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

.unit-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    width: 6rem;
    margin-right: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selectors {
    display: flex;
    gap: 0.75rem;
}

.selector {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    color: white;
    cursor: pointer;
}

.selector:focus {
    outline: none;
    border-color: var(--border-color);
}

.unit-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.temp-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.temp-arrow {
    font-size: 0.875rem;
    color: white;
    padding: 0 0.25rem;
}

.current-temp {
    font-size: 0.875rem;
    color: white;
}

.power-btn {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: white;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.power-btn:hover {
    opacity: 0.9;
}

.power-btn.on {
    background: var(--green);
    border-color: var(--green-border);
}

/* Toast notifications */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    color: white;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast.success {
    background: var(--green);
}

.toast.error {
    background: var(--error);
}

@keyframes slideIn {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes fadeOut {
    from { 
        opacity: 1; 
    }
    to { 
        opacity: 0; 
    }
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .unit-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .unit-name {
        width: 100%;
        margin-right: 0;
    }

    .selectors {
        width: 100%;
        justify-content: flex-start;
    }
}
