/* 1. TOP NAVIGATION BAR (#iotLoginContainer) */
#iotLoginContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 6px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.login-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    text-decoration: none !important;
    line-height: 1;
    height: 32px;
    white-space: nowrap;
}

.login-action-btn:hover {
    background-color: #1cb495;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(28, 180, 149, 0.4);
}

.login-action-btn:hover i,
.login-action-btn:hover span {
    color: #fff !important;
}

/* Private Items & Logout */
.private-nav-item {
    display: none;
    border: 1px solid rgba(245, 200, 66, 0.3);
}

.private-nav-item:hover {
    background-color: #f5c842;
    box-shadow: 0 4px 10px rgba(245, 200, 66, 0.4);
}

.login-action-btn.logout:hover {
    background-color: #ff3e4d;
    box-shadow: 0 4px 10px rgba(255, 62, 77, 0.4);
}

/* Login Inputs (Top Bar) */
.login-inputs-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

#iotLoginContainer input[type="email"],
#iotLoginContainer input[type="password"] {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 0 !important;
    color: #fff;
    font-size: 13px;
    padding: 4px 2px;
    height: auto;
    width: 110px;
    outline: none;
    transition: all 0.3s ease;
}

#iotLoginContainer input:focus {
    border-bottom-color: #f5c842 !important;
    width: 130px;
}

/* Login Message Feedback */
#iotLoginMsg {
    position: absolute;
    top: 120%;
    right: 10px;
    background: rgba(255, 62, 77, 0.9);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

#iotLoginMsg.show {
    opacity: 1;
    transform: translateY(0);
}

#iotLoginMsg.success {
    background: rgba(28, 180, 149, 0.9);
}

/* Auth Help Links (Register/Forgot icons) */
.auth-help-links {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    margin-left: 5px;
}

.auth-help-links button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px;
    line-height: 1;
    transition: color 0.3s;
    width: auto;
    height: auto;
}

.auth-help-links button:hover {
    color: #f5c842;
}

/* 2. MODALS (Auth & Generic) */
.culi-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.culi-modal-content {
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    position: relative;
    text-align: center;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    line-height: 0.8;
}

.close-modal:hover {
    color: #fff;
}

.culi-modal-content h2 {
    color: #f5c842;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.culi-modal-content input,
.culi-modal-content select {
    width: 100%;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    outline: none;
}

.culi-modal-content input:focus,
.culi-modal-content select:focus {
    border-color: #1cb495;
    background: rgba(255, 255, 255, 0.1);
}

.culi-modal-content select option {
    background-color: #000;
    color: #fff;
}

.modal-action-btn {
    width: 100%;
    background-color: #1cb495;
    color: white;
    padding: 0;
    height: 44px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-action-btn:hover {
    background-color: #17a187;
}

.modal-msg {
    margin-top: 15px;
    font-size: 0.85rem;
    min-height: 1.2em;
}

.modal-msg.error {
    color: #ff3e4d;
}

.modal-msg.success {
    color: #1cb495;
}

/* Password Toggle Eye */
.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.password-wrapper input {
    margin-bottom: 0 !important;
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    z-index: 10;
    font-size: 1rem;
}

.toggle-password:hover {
    color: #f5c842;
}

/* ICON UTILS (Necesario para el footer) */
.icon {
    text-decoration: none;
    border-bottom: none;
    position: relative;
}

.icon:before {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    text-transform: none !important;
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
}

.icon>.label {
    display: none;
}

/* Oculta el texto "Instagram" */
.icon:before {
    line-height: inherit;
}

.icon.solid:before {
    font-weight: 900;
}

.icon.brands:before {
    font-family: 'Font Awesome 5 Brands';
}

/* Estilo específico para la lista de iconos del footer */
ul.icons {
    cursor: default;
    list-style: none;
    padding-left: 0;
}

ul.icons li {
    display: inline-block;
    padding: 0 1em 0 0;
}

ul.icons li:last-child {
    padding-right: 0;
}

ul.icons li .icon:before {
    font-size: 1.25em;
}

ul.icons li a {
    color: inherit;
}

/* 3. FOOTER */
/* --- FOOTER (Actualizado) --- */
#footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 4rem;
    padding-bottom: 2rem;
    width: 100%;
    opacity: 0.8;
    /* Un poco más visible por defecto */
    transition: opacity 0.5s ease-in-out;
}

#footer:hover {
    opacity: 1;
}

#footer .icons {
    margin: 0 0 0.5em 0;
}

#footer .copyright {
    font-size: 0.8em;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Separadores verticales entre elementos de la lista */
#footer .copyright li {
    border-left: solid 1px rgba(255, 255, 255, 0.25);
    display: inline-block;
    line-height: 1em;
    margin: 0 0 0 0.75em;
    padding: 0 0 0 0.75em;
}

#footer .copyright li:first-child {
    border-left: 0;
    margin-left: 0;
    padding-left: 0;
}

/* Enlaces genéricos del footer (Estilo "NFT 4 EVER") */
#footer .copyright a {
    color: inherit;
    /* Hereda el color grisáceo del texto */
    text-decoration: none;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

#footer .copyright a:hover {
    color: #1cb495;
    /* Verde al pasar el ratón */
    border-bottom-color: transparent;
}

/* Estilo 1: CULIverse (Dorado/Amarillo) */
a.footer-link.culi-brand {
    color: #fff !important;
    /* Blanco brillante */
    font-weight: 700;
    border-bottom: none !important;
    /* Sin subrayado */
}

a.footer-link.culi-brand:hover {
    color: #f5c842 !important;
    /* Dorado */
    text-shadow: 0 0 10px rgba(245, 200, 66, 0.6);
    /* Resplandor */
}

/* Estilo 2: EGJOSE (Verde/Teal) */
a.footer-link.dev-brand {
    color: #fff !important;
    font-weight: 700;
    border-bottom: none !important;
}

a.footer-link.dev-brand:hover {
    color: #1cb495 !important;
    /* Verde CULI */
    text-shadow: 0 0 10px rgba(28, 180, 149, 0.6);
}

/* =================================================================== */
/* RESPONSIVE: BARRA DE NAVEGACIÓN MÓVIL (Navbar)                      */
/* =================================================================== */

@media (max-width: 900px) {
    #iotLoginContainer {
        /* Posicionamiento: Centrado flotante */
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;

        /* Dimensiones y Layout */
        width: 95%;
        max-width: 480px;
        padding: 10px;

        /* Flex */
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;

        /* Estilo */
        border-radius: 25px;
    }

    /* --- Botones Circulares (Links y Acciones) --- */
    .login-action-btn {
        /* IMPORTANTE: Esto asegura el círculo perfecto */
        padding: 0 !important;
        min-width: 0 !important;

        width: 42px !important;
        height: 42px !important;
        border-radius: 50% !important;

        /* Centrado del icono */
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin: 0 !important;

        /* TRUCO DE SEGURIDAD: Ocultar cualquier texto suelto */
        font-size: 0 !important;
    }

    /* Restaurar tamaño para el ICONO con PIXELES FIJOS */
    /* Usamos px para que se vean igual en index.html y rutas.html */
    .login-action-btn i {
        font-size: 20px !important;
        margin: 0 !important;
        display: block !important;
        line-height: 1 !important;
    }

    /* Ocultar el texto (Connect/Disconnect) */
    /* Esto funciona porque tu JS ya pone el texto dentro de un <span> */
    .login-action-btn span {
        display: none !important;
    }

    /* Ocultar separadores */
    #iotLoginContainer>div[style*="width: 5px"] {
        display: none;
    }

    /* --- Zona de Login (Fila inferior) --- */
    .login-inputs-wrapper {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    #iotLoginContainer input[type="email"],
    #iotLoginContainer input[type="password"] {
        width: 100px;
        font-size: 14px !important;
        text-align: center;
    }
}

.culi-banner {
    text-align: center;
    color: #f5c842;
    font-size: 0.9em;
    margin-bottom: 1em;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.85;
}