:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --text-color: #333;
    --background-color: #f5f5f5;
    --error-color: #f44336;
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

main {
    flex: 1;
    padding-top: 80px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    padding: 2rem 5%;
}

h1, h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

#hero {
    text-align: center;
    padding: 4rem 5%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    margin: -2rem -5% 2rem;
}

#hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

#hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: #fff;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.cta-button:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 2rem;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature img {
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

/* ... (mantén los estilos existentes para body, header, nav, etc.) ... */

.demo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.lightbulbs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .lightbulbs-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    .lightbulbs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.lightbulb-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.room-label {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.lightbulb-container {
    position: relative;
    width: 100px;
    height: 150px;
    margin-bottom: 1rem;
}

/* ... (mantén los estilos existentes) ... */

.lightbulb {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #e0e0e0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.lightbulb::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background-color: #f5f5f5;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.lightbulb.on {
    background-color: #ffd700;
    box-shadow: 0 0 50px #ffd700;
    animation: glow 1s ease-in-out infinite alternate;
}

.lightbulb.on::before {
    background-color: #fffacd;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #ffd700, 0 0 20px #ffd700;
    }
    to {
        box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #ffd700, 0 0 40px #ffd700;
    }
}

.filament {
    position: absolute;
    width: 4px;
    height: 30px;
    background-color: #999;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.lightbulb.on .filament {
    background-color: #ff6b00;
    box-shadow: 0 0 15px #ff6b00;
}

/* ... (mantén los demás estilos sin cambios) ... */
.base {
    width: 40px;
    height: 30px;
    background-color: #666;
    margin: 0 auto;
    border-radius: 0 0 10px 10px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.btn-on {
    background-color: var(--primary-color);
    color: white;
}

.btn-off {
    background-color: var(--error-color);
    color: white;
}

.btn:hover {
    opacity: 0.8;
}

.temperature-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#thermometer {
    width: 20px;
    height: 100px;
    background-color: #ddd;
    border-radius: 10px;
    margin-right: 20px;
    position: relative;
    overflow: hidden;
}

#temperature-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: var(--secondary-color);
    transition: height 0.3s ease;
}

.temperature-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
}

.update-time {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

/* ... (mantén los estilos existentes para footer, etc.) ... */

.update-time {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

#contact form {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
}

#contact input,
#contact textarea {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

#contact textarea {
    height: 150px;
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

.lights-table-container {
    overflow-x: auto;
    margin-top: 2rem;
}

.lights-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.lights-table th,
.lights-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.lights-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.lights-table tr:nth-child(even) {
    background-color: #f8f8f8;
}

.lights-table tr:hover {
    background-color: #f0f0f0;
}

.btn-edit,
.btn-delete {
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-edit {
    background-color: var(--secondary-color);
    color: white;
}

.btn-delete {
    background-color: var(--error-color);
    color: white;
}

.btn-edit:hover,
.btn-delete:hover {
    opacity: 0.8;
}

.loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-color);
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader p {
    margin-top: 10px;
    font-weight: bold;
    color: var(--primary-color);
}

.content-blur {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--background-color);
    padding: 30px;
    border: 1px solid var(--primary-color);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.close {
    color: var(--text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover,
.close:focus {
    color: var(--error-color);
    text-decoration: none;
}

/* Form styles */
#lightForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#lightForm label {
    font-weight: bold;
    color: var(--text-color);
}

#lightForm input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#lightForm input[type="text"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

.cta-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.cta-button:hover {
    background-color: var(--secondary-color);
}

.cta-button:active {
    transform: scale(0.98);
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

.toast {
    visibility: hidden;
    min-width: 250px;
    max-width: 80%;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 17px;
    opacity: 0;
    transition: opacity 0.5s, visibility 0.5s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast.show {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 480px) {
    .toast {
        width: 90%;
        font-size: 16px;
        padding: 12px;
    }
}

.container {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.login-button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-button:hover {
    background-color: #45a049;
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align:  center;
        position: absolute;
        top: 70px;
        left: 0;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 1rem 0;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .lightbulbs-grid {
        grid-template-columns: 1fr;
    }

    .lights-table th,
    .lights-table td {
        padding: 0.5rem;
    }

    #hero h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
}

.logout-button {
    background-color: var(--error-color);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.logout-button:hover {
    background-color: var(--secondary-color);
}

@media (max-width: 768px) {
    .logout-button {
        width: 100%;
        margin-top: 10px;
    }
}

.garage-door {
    width: 200px;
    height: 150px;
    background-color: #ddd;
    margin: 20px auto;
    position: relative;
    overflow: hidden;
    border: 2px solid #999;
}

.door-panel {
    width: 100%;
    height: 100%;
    background-color: #bbb;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 2s ease-in-out;
}

.door-open .door-panel {
    transform: translateY(-100%);
}

.toggle-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.toggle-button:hover {
    background-color: #1976D2;
}

.toggle-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.status {
    margin-top: 20px;
    font-weight: bold;
}
