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

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background 0.5s ease;
}

body.logged-out {
    background: rgba(0, 0, 0, 0.8);
}

.grid-container {
    display: grid;
    grid-template-areas: 
        "header"
        "main"
        "footer";
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    transition: filter 0.5s ease;
}

.grid-container.logged-out {
    filter: blur(5px);
}

.header {
    grid-area: header;
    background: linear-gradient(90deg, #2a5298, #1e3c72);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 40;
    animation: slideDown 0.5s ease;
}
@keyframes slideDown {
    from { transform: translateY(-80%); }
    to { transform: translateY(0); }
}

.header-title {
    font-size: 30px;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.header-title::before {
    content: "\f0eb";
    font-family: "Font Awesome 5 Free";
    margin-right: 10px;
    color: #ffd700;
    font-size: 18px;
}

.menu-icon, .header-right {
    cursor: pointer;
    transition: transform 1s ease;
}

.menu-icon:hover, .header-right:hover {
    transform: scale(1.2);
}

.material-icons-outlined {
    font-size: 24px;
}

.sidebar {
    grid-area: sidebar;
    background: #939292;
    padding: 15px;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform: translateX(-100%);
    position: fixed;
    height: 100%;
    width: 80%;
    max-width: 250px;
    z-index: 10;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar:not(.hidden) {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    font-weight: 700;
    color: #2a5298;
    text-transform: uppercase;
    font-size: 14px;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    margin: 35px 0;
}

.sidebar-list a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-list a:hover {
    background: #2a5298;
    color: white;
    transform: translateX(25px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-list a::before {
    font-family: "Font Awesome 5 Free";
    margin-right: 8px;
    color: #2a5298;
    font-size: 16px;
}

.sidebar-list li:nth-child(1) a::before { content: "\f0eb"; }
.sidebar-list li:nth-child(2) a::before { content: "\f007"; }
.sidebar-list li:nth-child(3) a::before { content: "\f05a"; }

.main-content {
    grid-area: main;
    padding: 25px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.content-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease;
    width: 100%;
    max-width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section.hidden {
    display: none;
}

h2 {
    color: #2a5298;
    margin-bottom: 15px;
    font-size: 22px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    text-align: left;
    position: relative;
    padding-left: 35px;
}

h2::before {
    font-family: "Font Awesome 5 Free";
    position: absolute;
    left: 0;
    color: #ffd700;
    font-size: 20px;
}

#led-control h2::before { content: "\f0eb"; }
#about-author h2::before { content: "\f007"; }
#user-guide h2::before { content: "\f05a"; }

h3 {
    color: #1e3c72;
    margin: 15px 0 10px;
    font-size: 18px;
    text-align: left;
    padding-left: 25px;
    position: relative;
}

h3::before {
    font-family: "Font Awesome 5 Free";
    position: absolute;
    left: 0;
    color: #28a745;
    font-size: 16px;
}

.device-management h3::before { content: "\f085"; }
.group-control h3::before { content: "\f0c0"; }

.device-management, .control-panel, .group-control {
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

.device-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.device-list {
    margin-top: 15px;
}

.device-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    margin: 8px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.device-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.device-item::before {
    content: "\f108";
    font-family: "Font Awesome 5 Free";
    margin-bottom: 5px;
    color: #2a5298;
    font-size: 16px;
}

.input-field {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    transition: border-color 3s ease, box-shadow 3s ease;
}
.input-field[style*="display: block"] {
    transition: none; /* Tắt transition khi input vừa xuất hiện */
}

.input-field:focus {
    border-color: #2a5298;
    box-shadow: 0 0 8px rgba(42, 82, 152, 0.3);
    outline: none;
}

.btn {
    padding: 10px 10px;
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    margin: 5px 0;
}

.btn::before {
    content: '';
    position: absolute;
    top: 40%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 200%;
    height: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-add { background: #28a745; }
.btn-add:hover { background: #218838; }
.btn-on { background: #28a745; }
.btn-on:hover { background: #218838; }
.btn-off { background: #dc3545; }
.btn-off:hover { background: #c82333; }
.btn-group { background: #17a2b8; }
.btn-group:hover { background: #138496; }
.btn-delete { background: #dc3545; padding: 6px 12px; font-size: 12px; width: auto; }
.btn-delete:hover { background: #c82333; }
.btn-primary { background: #2a5298; }
.btn-primary:hover { background: #1e3c72; }
.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #5a6268; }

.Btn {
    position: fixed;
    right: 10px;
    top: 50px;
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background: #dc3545;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 10;
}

.Btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.Btn .sign {
    margin-right: 8px;
}

.Btn svg {
    width: 18px;
    fill: white;
}

.color-picker {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px 0;
    transition: transform 0.3s ease;
}

.color-picker:hover {
    transform: scale(1.05);
}

.slider {
    width: 100%;
    margin: 10px 0;
    -webkit-appearance: none;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    transition: background 0.3s ease;
}

.slider:hover {
    background: #ccc;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #2a5298;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.author-info {
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.author-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 15px auto;
    display: block;
    transition: transform 0.3s ease;
}

.author-photo:hover {
    transform: scale(1.1);
}

.social-links {
    margin: 20px 0;
}

.social-icon {
    color: #2a5298;
    font-size: 24px;
    margin: 0 10px;
    text-decoration: none;
    position: relative;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.2);
    color: #1e3c72;
}

.social-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #2a5298;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    display: none;
    white-space: nowrap;
}

.social-icon:hover::after {
    display: block;
}

.guide-content h3 {
    margin-top: 20px;
    color: #1e3c72;
    font-size: 18px;
}

.footer {
    grid-area: footer;
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    color: white;
    padding: 15px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
    font-size: 14px;
}

.footer-links a:hover {
    color: #ffd700;
}

.footer-links a::before {
    content: "\f0e0";
    font-family: "Font Awesome 5 Free";
    margin-right: 5px;
    font-size: 14px;
}

.device-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 10px 0;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.status-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-bottom: 5px;
    background: #ccc;
    transition: background 0.3s ease;
}

#status-text {
    font-size: 12px;
    color: #333;
    word-wrap: break-word;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeInModal 0.5s ease;
}

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

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 350px;
    animation: popUp 0.5s ease;
}

@keyframes popUp {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    margin-bottom: 15px;
    text-align: left;
    padding-left: 30px;
    font-size: 20px;
}

.modal-content h2::before {
    content: "\f2f6";
    font-family: "Font Awesome 5 Free";
    position: absolute;
    left: 0;
    color: #2a5298;
    font-size: 18px;
}

.modal-content .input-field {
    display: block;
    margin: 10px auto;
    width: 100%;
    max-width: 100%;
    font-size: 14px;
}

.modal-content .btn {
    width: 100%;
    margin: 8px 0;
    font-size: 13px;
}

#register-form {
    margin-top: 15px;
}

.history-list {
    max-height: 700px;
    overflow-y: auto;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.history-item {
    padding: 8px;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 12px;
}

.history-item:last-child {
    border-bottom: none;
}

.theme-toggle {
    cursor: pointer;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.2);
}

.dark-theme {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #e0e0e0;
}

.dark-theme .grid-container.logged-out {
    filter: blur(5px);
}

.dark-theme .header, .dark-theme .footer {
    background: linear-gradient(90deg, #16213e, #0f3460);
}

.dark-theme .content-section, .dark-theme .sidebar, .dark-theme .modal-content {
    background: #2a2a3e;
    color: #e0e0e0;
}

.dark-theme .device-management, .dark-theme .control-panel, .dark-theme .group-control {
    background: #3a3a4e;
}

.dark-theme .device-item, .dark-theme .history-item {
    background: #3a3a4e;
    color: #e0e0e0;
}

.dark-theme .input-field {
    border-color: #555;
    background: #3a3a4e;
    color: #e0e0e0;
}

.dark-theme .slider {
    background: #555;
}

.toast {
    position: fixed;
    bottom: 15px;
    right: 15px;
    padding: 8px 15px;
    border-radius: 5px;
    color: white;
    animation: slideIn 0.5s ease, fadeOut 0.5s ease 10s forwards; /* Tăng thời gian hiển thị lên 3s */
    font-size: 12px;
    max-width: 90%;
}

.toast-success { background: #28a745; }
.toast-error { background: #dc3545; }

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 10px;
    }

    .header-title {
        font-size: 18px;
    }

    .material-icons-outlined {
        font-size: 22px;
    }

    .sidebar {
        width: 70%;
    }

    .sidebar-header {
        font-size: 13px;
    }

    .sidebar-list a {
        font-size: 13px;
        padding: 6px;
    }

    .main-content {
        padding: 10px;
    }

    .content-section {
        padding: 10px;
    }

    h2 {
        font-size: 20px;
        padding-left: 30px;
    }

    h3 {
        font-size: 16px;
        padding-left: 25px;
    }

    .device-management, .control-panel, .group-control {
        padding: 10px;
    }

    .device-item {
        padding: 8px;
    }

    .btn-delete {
        width: 100%;
        margin-top: 5px;
    }

    .modal-content {
        width: 85%;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 16px;
    }

    .material-icons-outlined {
        font-size: 20px;
    }

    .sidebar {
        width: 60%;
    }

    .sidebar-list a {
        font-size: 12px;
        padding: 5px;
    }

    h2 {
        font-size: 18px;
        padding-left: 25px;
    }

    h3 {
        font-size: 14px;
        padding-left: 20px;
    }

    .input-field {
        padding: 8px;
        font-size: 12px;
    }

    .btn {
        padding: 8px 12px; /* Giảm padding để nút ngắn hơn */
        border-radius: 8px;
        font-size: 12px;
        width: auto; /* Không chiếm toàn chiều rộng */
        display: inline-block; /* Đặt inline-block để không full width */
        margin: 5px 5px 5px 0; /* Điều chỉnh margin */
    }

    .Btn {
        padding: 6px 12px;
        top: 45px;
        right: 8px;
    }

    .Btn svg {
        width: 16px;
    }

    .color-picker {
        height: 35px;
    }

    .slider::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
    }

    .author-photo {
        width: 100px;
        height: 100px;
    }

    .social-icon {
        font-size: 20px;
        margin: 0 8px;
    }

    .footer {
        padding: 10px;
    }

    .footer-links a {
        font-size: 12px;
        margin: 0 8px;
    }

    .device-status {
        padding: 8px;
    }

    #status-text {
        font-size: 11px;
    }

    .history-item {
        font-size: 11px;
        padding: 6px;
    }

    .modal-content {
        width: 90%;
        padding: 12px;
    }

    .modal-content h2 {
        font-size: 18px;
        padding-left: 25px;
    }
}
/* Thêm vào cuối file styles.css */
.device-power-status {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.power-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    background: #ccc;
    transition: background 0.3s ease;
}

#power-text {
    font-size: 14px;
    color: #333;
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    .device-power-status {
        padding: 8px;
    }
    .power-icon {
        width: 16px;
        height: 16px;
    }
    #power-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .device-power-status {
        flex-direction: column;
        align-items: flex-start;
    }
    .power-icon {
        margin-bottom: 5px;
    }
}
#status-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

#status-table th, #status-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#status-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

#status-table td {
    background-color: #fff;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    color: white;
    border-radius: 5px;
    z-index: 1000;
}

.toast-success { background-color: #28a745; }
.toast-error { background-color: #dc3545; }
.toast-warning { background-color: #ffc107; }
.power-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

.status-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

.device-item {
    display: flex;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #ddd;
}

.device-item span:nth-child(2) {
    flex-grow: 1;
    cursor: pointer;
}

.btn-delete {
    margin-left: 10px;
}
.btn-mode {
    background: #17a2b8;
    margin-right: 10px;
}
.btn-mode:hover {
    background: #138496;
}
/* Định vị và thu nhỏ nút btn-mode */
.btn-mode {
    background: #17a2b8;
    padding: 6px 10px; /* Thu nhỏ kích thước */
    font-size: 12px; /* Giảm kích thước chữ */
    width: auto; /* Không chiếm toàn chiều rộng */
    margin-left: 10px; /* Khoảng cách với các phần tử bên trái */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-mode:hover {
    background: #138496;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive cho nút btn-mode trên mobile */
@media (max-width: 768px) {
    .btn-mode {
        padding: 5px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .btn-mode {
        padding: 4px 6px;
        font-size: 10px;
    }
    .header {
        padding: 10px;
        flex-wrap: wrap; /* Cho phép xuống dòng nếu không đủ chỗ */
    }
    .btn-mode {
        margin-left: 5px;
    }
}
/* Định dạng hình ảnh sản phẩm */
.product-image {
    display: block;
    width: 100%; /* Đảm bảo hình ảnh responsive */
    max-width: 700px; /* Kích thước tối đa nhỏ hơn (ví dụ: 150px) */
    height: auto; /* Giữ tỷ lệ hình ảnh */
    margin: 20px auto; /* Căn giữa và thêm khoảng cách */
    border-radius: 10px; /* Bo góc */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* Hiệu ứng bóng */
    transition: transform 0.3s ease; /* Hiệu ứng phóng to khi hover */
}

/* Hiệu ứng hover */
.product-image:hover {
    transform: scale(1.05); /* Phóng to nhẹ khi hover */
}

.dark-theme h2, .dark-theme h3, .dark-theme p, .dark-theme span, .dark-theme a, .dark-theme label {
    color: #e0e0e0; /* Chữ sáng hơn trong dark mode */
}
.dark-theme .input-field {
    background: #3a3a4e;
    color: #e0e0e0;
    border-color: #555;
}
.dark-theme .btn {
    color: #fff; /* Đảm bảo chữ trên nút sáng */
}
/* Định dạng hình ảnh sản phẩm */
.guy-image {
    display: block;
    width: 100%; /* Đảm bảo hình ảnh responsive */
    max-width: 300px; /* Kích thước tối đa nhỏ hơn (ví dụ: 150px) */
    height: auto; /* Giữ tỷ lệ hình ảnh */
    margin: 20px auto; /* Căn giữa và thêm khoảng cách */
    border-radius: 10px; /* Bo góc */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* Hiệu ứng bóng */
    transition: transform 0.3s ease; /* Hiệu ứng phóng to khi hover */
}

/* Hiệu ứng hover */
.guy-image:hover {
    transform: scale(1.05); /* Phóng to nhẹ khi hover */
}

/* Điều chỉnh cho dark theme */
.dark-theme .guy-image {
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1); /* Bóng sáng hơn trong dark theme */
}
/* Responsive cho mobile */
@media (max-width: 768px) {
    .product-image {
        max-width: 220px; /* Nhỏ hơn trên tablet */
        margin: 15px auto;
    }
}

@media (max-width: 480px) {
    .product-image {
        max-width: 200px; /* Nhỏ hơn nữa trên mobile */
        margin: 10px auto;
    }
}
/* Responsive cho mobile */
@media (max-width: 768px) {
    .guy-image {
        max-width: 220px; /* Nhỏ hơn trên tablet */
        margin: 15px auto;
    }
}

@media (max-width: 480px) {
    .guy-image {
        max-width: 200px; /* Nhỏ hơn nữa trên mobile */
        margin: 10px auto;
    }
}
@media (max-width: 480px) {
    .control-panel {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    .color-picker-container {
        flex-direction: column;
        gap: 20px;
        margin: 20px 0;
    }
    .timer-select-container {
        flex-direction: column;
        align-items: flex-start;
    }
}
.modal-content .btn {
    margin: 8px 0;
    width: 100%;
}

.modal-content .btn-secondary {
    background: #6c757d;
}

.modal-content .btn-secondary:hover {
    background: #5a6268;
}
.product-video {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.product-video:hover {
    transform: scale(1.05);
}

.dark-theme .product-video {
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}
.color-picker-container {
    position: relative;
    display: flex;
    align-items: center;
    margin: 100px 0;
    gap: 100px; /* Khoảng cách giữa color-display và color-wheel */
}

.color-display {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #939292;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    display: inline-block;
    background-color: #f6d70d; /* Màu mặc định */
    transition: transform 0.2s;
}

.color-display:hover {
    transform: scale(1.1);
}

.color-wheel {
    position: relative; /* Không cần absolute nữa vì hiển thị cố định */
    background: #939292;
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.color-canvas {
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,1) 20%, rgba(255,255,255,0) 70%);
}

.color-indicator {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: background-color 0.2s;
}
.timer-select-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 10px 0;
}

.timer-select {
    display: flex;
    align-items: center;
    gap: 5px;
}

.timer-select label {
    font-size: 14px;
    color: #333;
}

.timer-select select {
    padding: 5px;
    width: 70px;
}

.dark-theme .timer-select label {
    color: #e0e0e0;
}
.chatbot-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #2a5298;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.chatbot-icon:hover {
    transform: scale(1.1);
}

.chatbot-icon i {
    color: white;
    font-size: 24px;
}

.chatbot {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 300px;
    max-height: 70vh; /* Giới hạn chiều cao trên điện thoại */
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
    overflow: hidden; /* Ngăn tràn nội dung */
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
#color-canvas, #group-color-canvas {
    width: 200px;
    height: 200px;
    touch-action: none; /* Ngăn hành vi mặc định khi chạm */
}
#chatbot-header {
    background: #2a5298;
    color: white;
    padding: 10px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

#chatbot-messages {
    max-height: 40vh; /* Giới hạn chiều cao tin nhắn */
    overflow-y: auto;
    padding: 10px;
}

.chatbot-message {
    margin: 5px 0;
    padding: 8px;
    border-radius: 5px;
    max-width: 80%;
    word-wrap: break-word;
}

.chatbot-message.user {
    background: #2a5298;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.chatbot-message.bot {
    background: #f1f1f1;
    color: #333;
    align-self: flex-start;
}

.chatbot-input-container {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #ddd;
}

#chatbot-input {
    flex-grow: 1;
    margin-right: 5px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#chatbot-voice {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e3c72;
    margin-right: 5px;
    border: none;
    border-radius: 5px;
}

#chatbot-voice i {
    font-size: 18px;
    color: white;
}

#chatbot-send {
    width: 60px;
    padding: 8px;
    background: #2a5298;
    color: white;
    border: none;
    border-radius: 5px;
}

/* Responsive cho điện thoại */
@media (max-width: 480px) {
    .chatbot {
        width: 90vw; /* Chiếm 90% chiều rộng màn hình */
        bottom: 70px;
        right: 10px;
        max-height: 80vh;
    }

    .chatbot-icon {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }

    .chatbot-icon i {
        font-size: 20px;
    }

    #chatbot-messages {
        max-height: 50vh; /* Tăng không gian tin nhắn trên điện thoại */
    }

    #chatbot-input {
        font-size: 14px;
    }

    #chatbot-voice, #chatbot-send {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

.dark-theme .chatbot {
    background: #2a2a3e;
}

.dark-theme #chatbot-header {
    background: #16213e;
}

.dark-theme .chatbot-message.user {
    background: #1e3c72;
}

.dark-theme .chatbot-message.bot {
    background: #3a3a4e;
    color: #e0e0e0;
}

.dark-theme #chatbot-input {
    background: #3a3a4e;
    color: #e0e0e0;
    border-color: #555;
}

.dark-theme #chatbot-voice {
    background: #16213e;
}

.dark-theme .chatbot-input-container {
    background: #2a2a3e;
    border-top-color: #555;
}
#power-usage {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}
#power-usage h3 {
    font-size: 16px;
    color: #1e3c72;
}
#power-estimate {
    font-size: 14px;
    color: #333;
}
.dark-theme #power-usage {
    background: #3a3a4e;
}
.dark-theme #power-usage h3, .dark-theme #power-estimate {
    color: #e0e0e0;
}
