/*
 * style.css — Estilos comunes del módulo pulsadores (domo_camper)
 *
 * Lo enlazan los paneles que comparten el mismo aspecto: _interruptores.php
 * (Interior/Exterior) y menu.php. Así el estilo vive en un solo sitio.
 * Compatible con el Samsung KitKat (sin grid/clamp/inset; px, -webkit-).
 *
 * Las clases del menú van bajo ".menu"/".topbar" y las del panel de
 * interruptores bajo ".grid" para que no se pisen entre ellas.
 */

/* ---------- Base / tema ---------- */
* { margin: 0; padding: 0; -webkit-box-sizing: border-box; box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
body {
    font-family: 'Segoe UI', 'Courier New', sans-serif;
    min-height: 100vh;
    background: #0a0f1a;
    background: radial-gradient(ellipse at 50% 50%, #1a2a4a 0%, #0a0f1a 60%, #050810 100%);
    color: #fff;
    padding: 14px 10px;
    text-align: center;
    overflow-y: auto;
}

.titulo {
    margin: 6px auto 18px;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
}
.vacio { color: rgba(255,255,255,0.5); margin-top: 40px; width: 100%; }

/* ---------- Panel de interruptores (botones redondos "power") ---------- */
.grid {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    text-align: center;
}
.grid .cell {
    width: 50%;
    padding: 10px 6px;
}

.power-btn {
    position: relative;
    display: inline-block;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    background: radial-gradient(circle at 40% 35%, #3a4a6a, #1a2035 40%, #0d1225 70%);
    box-shadow:
        0 0 12px rgba(0, 180, 255, 0.2),
        0 0 30px rgba(0, 180, 255, 0.08),
        inset 0 2px 5px rgba(255,255,255,0.12),
        inset 0 -3px 6px rgba(0,0,0,0.6);
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}
.power-btn:active {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

.ring-outer {
    position: absolute; top: -3px; right: -3px; bottom: -3px; left: -3px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 180, 255, 0.35);
    box-shadow: 0 0 8px rgba(0, 180, 255, 0.2), inset 0 0 8px rgba(0, 180, 255, 0.06);
}
.ring-metal {
    position: absolute; top: 3px; right: 3px; bottom: 3px; left: 3px;
    border-radius: 50%;
    border: 1.5px solid rgba(160, 180, 210, 0.25);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}
.ring-inner {
    position: absolute; top: 8px; right: 8px; bottom: 8px; left: 8px;
    border-radius: 50%;
    border: 1px solid rgba(0, 180, 255, 0.1);
}
.power-symbol {
    position: absolute;
    top: 50%; left: 50%;
    width: 34px; height: 34px;
    margin-top: -17px; margin-left: -17px;
}
.power-symbol svg { width: 100%; height: 100%; display: block;
    -webkit-filter: drop-shadow(0 0 5px rgba(0, 200, 255, 0.7));
    filter: drop-shadow(0 0 5px rgba(0, 200, 255, 0.7));
    -webkit-transition: -webkit-filter 0.3s ease;
    transition: filter 0.3s ease;
}
.power-symbol svg line,
.power-symbol svg path {
    stroke: #00d4ff;
    -webkit-transition: stroke 0.3s ease;
    transition: stroke 0.3s ease;
}

.label {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    -webkit-transition: color 0.3s ease, text-shadow 0.3s ease;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* Estado encendido (verde neón) */
.grid .cell.active .power-symbol svg line,
.grid .cell.active .power-symbol svg path { stroke: #00ffcc; }
.grid .cell.active .power-symbol svg {
    -webkit-filter: drop-shadow(0 0 8px rgba(0, 255, 204, 0.9));
    filter: drop-shadow(0 0 8px rgba(0, 255, 204, 0.9));
}
.grid .cell.active .label {
    color: #00ffcc;
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
}
.grid .cell.active .power-btn {
    box-shadow:
        0 0 18px rgba(0, 255, 204, 0.4),
        0 0 40px rgba(0, 255, 204, 0.15),
        inset 0 2px 5px rgba(255,255,255,0.15),
        inset 0 -3px 6px rgba(0,0,0,0.5);
}
.grid .cell.active .ring-outer {
    border-color: rgba(0, 255, 204, 0.45);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3), inset 0 0 10px rgba(0, 255, 204, 0.08);
}

@media (min-width: 360px) {
    .power-btn { width: 88px; height: 88px; }
    .power-symbol { width: 38px; height: 38px; margin-top: -19px; margin-left: -19px; }
    .label { font-size: 14px; }
}

/* ---------- Página del menú: ocupa toda la pantalla SIN scroll ---------- */
/* El <body class="menu-page"> es una columna: barra arriba + menú que se
   reparte el resto. El tamaño de los botones lo ajusta el JS de menu.php. */
.menu-page {
    height: 100vh;
    overflow: hidden;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
}

/* ---------- Barra superior del menú (marca + reloj) ---------- */
.topbar {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 12px;
    text-align: left;
}
.topbar .marca {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.45);
}
.topbar .reloj { text-align: right; }
.topbar .hora {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #e8edf7;
}
.topbar .fecha {
    margin-top: 2px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

/* ---------- Menú de paneles (botones cuadrados) ---------- */
.menu {
    -webkit-flex: 1;
    flex: 1;
    min-height: 0;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-align-content: flex-start;
    align-content: flex-start;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}
.menu .cell {
    width: 50%;          /* dos columnas */
    padding: 7px;        /* separación entre botones */
    text-align: center;  /* centra el botón cuando el JS le fija tamaño */
}
.menu .btn {
    display: block;
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;   /* cuadrado por defecto (el JS lo ajusta al alto) */
    margin: 0 auto;
    text-decoration: none;
    background: radial-gradient(circle at 40% 30%, #243250, #161d30 60%, #0d1322 100%);
    border: 1px solid rgba(0, 180, 255, 0.35);
    border-radius: 16px;
    box-shadow:
        0 0 12px rgba(0, 180, 255, 0.15),
        inset 0 1px 2px rgba(255,255,255,0.08),
        inset 0 -3px 6px rgba(0,0,0,0.5);
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}
.menu .btn:active {
    border-color: #00d4ff;
    box-shadow:
        0 0 18px rgba(0, 212, 255, 0.45),
        inset 0 1px 2px rgba(255,255,255,0.1),
        inset 0 -3px 6px rgba(0,0,0,0.5);
}
.menu .btn .txt {
    position: absolute;
    top: 50%; left: 0; right: 0;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    padding: 0 10px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #e8edf7;
}
