:root {
    --primary-color: #2196F3;
    --secondary-color: #F44336;
    --background-color: #1b0202;
    --text-color: #333;
    --card-background: #eff6f7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    font-style: normal;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overscroll-behavior-y: contain;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.connection-badge {
    background-color: rgba(11, 27, 255, 0.432);
    padding: 8px 15px;
    border-radius: 8px;
    /* display: inline-block; */
}

main {
    flex-grow: 1;
    padding: 20px;
}

.device-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.device-card {
    background-color: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.device-header h2 {
    font-size: 20px;
}

.status-indicator {
    font-size: 16px;
    padding: 8px 15px;
    border-radius: 8px;
    text-align: center;
}

.status-indicator.on {
    background-color: rgba(1, 2, 61, 0.993);
    color: #4CAF50;
}

.status-indicator.off {
    background-color: rgba(247, 21, 5, 0.178);
    color: #eed707;
}

.device-control {
    display: flex;
    justify-content: center;
    align-items: center;
}

.toggle-switch {
    display: none;
}

.toggle-label {
    display: block;
    width: 200px;
    height: 60px;
    background-color: var(--secondary-color);
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-label::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 6px;
    /* margin-top: 2px; */
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch:checked + .toggle-label {
    background-color: var(--primary-color);
}

.toggle-switch:checked + .toggle-label::before {
    transform: translateX(140px);
}

.toggle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
}

footer {
    background-color: black;
    padding: 15px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.footer-actions {
    display: flex;
    justify-content: space-around;
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.action-btn:hover {
    background-color: #1976D2;
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        max-width: 100%;
    }

    header h1 {
        font-size: 20px;
    }

    .device-card {
        padding: 15px;
    }

    .toggle-label {
        width: 180px;
        height: 50px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #121212;
        --card-background: #1E1E1E;
        --text-color: #E0E0E0;
    }
}
