body {
    font-family: sans-serif;
    background: #f0f0f0;
    color: #000;
    margin: 0;
    transition: background 0.3s, color 0.3s;
}
header {
    background: #333;
    color: white;
    padding: 10px 20px;
}
nav a {
    color: white;
    margin-right: 20px;
    text-decoration: none;
}
.theme-toggle {
    float: right;
    display: inline-block;
    position: relative;
    width: 50px;
    height: 24px;
}
.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0;
    right: 0; bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.4s;
}
.slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.4s;
}
input:checked + .slider:before {
    transform: translateX(26px);
}
input:checked + .slider {
    background: #2196F3;
}

main {
    padding: 20px;
}
.controls {
    margin-bottom: 20px;
}
.device-card {
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}
#compare {
    background: #fff;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 6px;
}

/* Темная тема */
body.dark {
    background: #121212;
    color: #eee;
}
body.dark header {
    background: #222;
}
body.dark .device-card,
body.dark #compare {
    background: #1e1e1e;
    border-color: #444;
}
.add-device-card {
    text-align: center;
    color: #888;
    border: 2px #ccc;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}
.add-device-card:hover {
    background: #f0f0f0;
}
body.dark .add-device-card {
    background: #1c1c1c;
    border-color: #444;
    color: #aaa;
}
body.dark .add-device-card:hover {
    background: #2a2a2a;
}
        body.dark {
            background: #121212;
            color: #e0e0e0;
        }
        header {
            background: #333;
            color: #fff;
            padding: 10px 20px;
        }
        nav a {
            color: #fff;
            margin-right: 15px;
            text-decoration: none;
        }
        .device-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            padding: 20px;
        }
        .device-card {
            flex: 1 1 300px;
            background: #fff;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 0 6px rgba(0,0,0,0.1);
            position: relative;
        }
        body.dark .device-card {
            background: #1e1e1e;
            box-shadow: 0 0 6px rgba(255,255,255,0.05);
        }
        .device-actions a {
            margin: 0 5px;
            text-decoration: none;
            padding: 5px 10px;
            background: #007bff;
            color: white;
            border-radius: 4px;
        }
        .compare-checkbox {
            position: absolute;
            top: 10px;
            right: 10px;
        }
        #chart-container {
            margin: 20px;
            background: #fff;
            padding: 15px;
            border-radius: 8px;
        }
        body.dark #chart-container {
            background: #1e1e1e;
        }
        .toggle-theme {
            position: fixed;
            top: 10px;
            right: 10px;
        }
.plus-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #ddd;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    transition: background 0.2s;
}
.add-device-card:hover .plus-circle {
    background-color: #ccc;
}
body.dark .plus-circle {
    background-color: #333;
    color: #ccc;
}
body.dark .add-device-card:hover .plus-circle {
    background-color: #444;
}
.device-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
}
.device-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    color: white;
    cursor: pointer;
}
.device-btn.open {
    background-color: #28a745;
}
.device-btn.close {
    background-color: #dc3545;
}
.device-btn:hover {
    opacity: 0.85;
}
body.dark .device-btn.open {
    background-color: #2ecc71;
}
body.dark .device-btn.close {
    background-color: #e74c3c;
}
.device-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
}
.device-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    color: white;
    cursor: pointer;
}
.device-btn.open {
    background-color: #28a745;
}
.device-btn.close {
    background-color: #dc3545;
}
.device-btn:hover {
    opacity: 0.85;
}
body.dark .device-btn.open {
    background-color: #2ecc71;
}
body.dark .device-btn.close {
    background-color: #e74c3c;
}
.modal {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}
.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  width: 300px;
  border-radius: 5px;
  position: relative;
}
.close {
  position: absolute;
  top: 10px; right: 15px;
  font-size: 20px;
  cursor: pointer;
}
.modal {
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex; align-items: center; justify-content: center;
}
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    min-width: 300px;
}
.modal-content .close {
    position: absolute;
    right: 10px; top: 10px;
    font-size: 20px;
    cursor: pointer;
}
.dark .modal-content {
    background: #333;
    color: white;
}
