* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

:root {
    --primary-color: #142d4c;
    --secondary-color: #385170;
    --background-color: #ffffff/*linear-gradient(160deg, #0093E9, #80D0C7)*/;
    --text-color: #385170;
    --card-background: #ffffff;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --form-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

[data-theme="dark"] {
    --primary-color: #233142;
    --secondary-color: #455d7a;
    --background-color: #393e46;
    --text-color: #e3e3e3;
    --card-background: #3a3f44;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    --form-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

body {
    background: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
    background: var(--primary-color);
    color: #ffffff;
    padding: 20px 0;
    text-align: center;
    width: 90%;
    box-shadow: var(--shadow);
    border-radius: 10px;
    margin-bottom: 20px;
}

h1 {
    margin: 0;
    font-size: 2.5em;
    animation: fadeIn 1s ease-in;
}

/* Main Content */
main {
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
}

section {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    margin-top: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, background 0.3s;
    width: 100%;
}

/* Buttons */
h2 {
    margin-bottom: 10px;
}

button {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    font-weight: bold;
    width: 100%;
    border-radius: var(--border-radius);
    font-size: 1.1em;
    box-shadow: var(--shadow);
}

button:hover {
    background: var(--secondary-color);
    box-shadow: 0 6px 12px rgba(56, 81, 112, 0.4);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled,
button[disabled] {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

#deviceList {
    list-style-type: none;
    padding: 0;
    margin: 10px 0;
}

#deviceList li {
    background: var(--card-background);
    margin: 5px 0;
    padding: 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    box-shadow: var(--shadow);
}

#deviceList li:hover {
    background: var(--secondary-color);
    color: #ffffff;
    transform: scale(1.02);
}

form {
    background: var(--card-background);
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    box-shadow: var(--form-shadow);
    animation: fadeIn 0.5s ease-in;
    align-items: center;
}

label {
    display: block;
    margin: 10px 0 5px;
    color: var(--text-color);
}

input, option{
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: border 0.3s;
    background: var(--card-background);
    color: var(--text-color);
    transition: all 0.3s ease;
}

input:focus, option:focus {
    border: 1px solid var(--primary-color);
    outline: none;
    background: rgba(255, 255, 255, 0.5);
}

.additional-settings {
    margin-top: 20px;
}

/* Responsive styles */
@media (max-width: 768px) {
    main {
        padding: 10px;
        width: 95%;
    }

    form {
        padding: 15px;
        max-width: 90%;
    }
}
@media (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }
    
    button {
        font-size: 1em;
    }
}

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Night mode toggle */
/*.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    margin-bottom: 20px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background 0.3s;
}*/

/*.theme-toggle:hover {
    background: var(--secondary-color);
}*/
/* Night mode toggle switch */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-background);
    padding: 10px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background 0.3s;
}

.theme-toggle:hover {
    background: var(--secondary-color);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Modern Dropdown Styles */
select {
    appearance: none; /* Remove default arrow */
    -webkit-appearance: none; /* For Safari */
    -moz-appearance: none; /* For Firefox */
    background-color: var(--card-background);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 40px 10px 15px; /* Add padding for custom arrow */
    font-size: 1em;
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow);
    width: 100%;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c5ce7'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

select:hover {
    border-color: var(--primary-color);
}

/* Disabled dropdown style */
select:disabled {
    background-color: #f0f0f0;
    color: #999;
    cursor: not-allowed;
    border-color: #ddd;
}

/* Dropdown container for better alignment */
.dropdown-container {
    position: relative;
    margin-bottom: 15px;
}

/* Custom arrow (optional, already handled by background-image) */
.dropdown-container::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--primary-color);
    pointer-events: none;
}
