/* ------------------------------------------------------
   ✅ Homepage custom.css — Versión Claridad Máxima
------------------------------------------------------ */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500;700&family=Meow+Script:wght@500;700&display=swap");

:root {
  --font-primary: "Poppins", sans-serif;
  --font-secondary: "Meow Script", cursive;
  --glass-bg: rgba(10, 10, 10, 0.40); /* Mucho más transparente */
  --glass-border: rgba(255, 255, 255, 0.12);
}

/* --- BASE & FONDO --- */
body {
  position: relative;  
  isolation: isolate;
  background-attachment: fixed;
  background-size: cover;
}

/* Tinte global mínimo para no apagar el wallpaper */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.15); /* Solo 15% de oscurecimiento */
    z-index: -1;
}

/* --- TIPOGRAFÍA (Shion Greeting) --- */
.information-widget-logo + .information-widget-greeting span {
  font-family: var(--font-secondary) !important;
  font-weight: 700 !important;
  font-size: 2.2rem !important;
  color: white !important;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9); /* Sombra extra para compensar el fondo claro */
}

/* --- WIDGETS Y TARJETAS (Glassmorphism Suave) --- */
.dashboard-section, .widget, .card, .group-wrapper {
  background-color: var(--glass-bg) !important;
  backdrop-filter: blur(5px) saturate(130%) !important; /* Blur reducido para ver el dibujo */
  border: 1px solid var(--glass-border) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

/* --- TEXTO (Contraste Asegurado) --- */
.title, h1, h2, h3, p, .text-main, .service-title, .status-text {
  color: #ffffff !important;
  text-shadow: 0px 2px 5px rgba(0, 0, 0, 1), 0px 0px 10px rgba(0, 0, 0, 0.5) !important;
  /* Sombra doble para que el texto "flote" sobre cualquier parte del dibujo */
}

/* --- AJUSTE DE ERRORES --- */
.error-api, .bg-red-500 {
  background-color: rgba(180, 0, 0, 0.45) !important;
  backdrop-filter: blur(2px);
}

/* ==========================================================================
   📌 CABECERA & FOOTER — CSS Grid Layout Corregido (12 Columnas)
   ========================================================================== */

/* 1. Limitamos el Grid principal SOLO al wrapper exterior (evita romper sub-cajas) */
#widgets-wrap {
    display: grid !important;
    grid-template-columns: repeat(12, 1fr) !important;
    grid-auto-rows: min-content !important;
    gap: 15px !important;
    width: 100% !important;
    align-items: stretch !important;
}

/* --- Fila 1: Logo y Título --- */
.information-widget-logo {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    align-self: center !important;
}

.nrl-main-title {
    grid-column: 2 / 13 !important;
    grid-row: 1 !important;
    justify-self: center !important;
    align-self: center !important;
}

/* --- Fila 2: SERVER 1 --- */
.nrl-server1 {
    grid-column: 1 / 4 !important;
    grid-row: 2 !important;
    align-self: stretch !important; 
    background: rgba(220, 220, 220, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-right: none !important; 
    border-radius: 12px 0 0 12px !important;
    padding: 14px 20px !important;
    margin: 0 !important;
    backdrop-filter: blur(6px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; 
    white-space: nowrap !important;
    z-index: 2 !important;
}
/* Explicación: align-self: stretch fuerza a la caja a ocupar el 100% del alto de la fila, anulando el self-center nativo. */

.nrl-server1 + * {
    grid-column: 4 / 13 !important;
    grid-row: 2 !important;
    align-self: stretch !important;
    background: rgba(220, 220, 220, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-left: none !important;
    border-radius: 0 12px 12px 0 !important;
    padding: 14px 20px !important;
    margin: 0 0 0 -15px !important; 
    backdrop-filter: blur(6px) !important;
    display: flex !important;
    align-items: center !important;
}
/* Explicación: Lo replicamos en las métricas para asegurar que ambas mitades se comporten como espejos. */

/* --- Fila 3: SERVER 2 --- */
.nrl-server2 {
    grid-column: 1 / 4 !important;
    grid-row: 3 !important;
    align-self: stretch !important;
    background: rgba(220, 220, 220, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-right: none !important;
    border-radius: 12px 0 0 12px !important;
    padding: 14px 20px !important;
    margin: 0 !important;
    backdrop-filter: blur(6px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    z-index: 2 !important;
}

.nrl-server2 + * {
    grid-column: 4 / 13 !important;
    grid-row: 3 !important;
    align-self: stretch !important;
    background: rgba(220, 220, 220, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-left: none !important;
    border-radius: 0 12px 12px 0 !important;
    padding: 14px 20px !important;
    margin: 0 0 0 -15px !important;
    backdrop-filter: blur(6px) !important;
    display: flex !important;
    align-items: center !important;
}

/* --- Fila 4: FOOTER (Contenedor Nativo de Clima y Búsqueda) --- */
#information-widgets-right {
    grid-column: 1 / 13 !important; 
    grid-row: 4 !important;
    display: grid !important;
    grid-template-columns: repeat(12, 1fr) !important; 
    gap: 15px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Cajón de Clima + Hora */
.nrl-weather-time-box {
    grid-column: 1 / 6 !important; 
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    background: rgba(255, 255, 255, 0.10) !important;
    border: 1px solid rgba(255, 255, 255, 0.20) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(8px) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}
/* Explicación: Ampliado de 1/4 a 1/6 (ocupa 5 columnas de 12). */

/* Resets internos de Clima y Hora */
.nrl-weather-time-box > div {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    margin: 0 !important;
    padding: 10px 15px !important;
    flex: 1 1 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

.nrl-weather-time-box .information-widget-openmeteo {
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* Buscador */
form.information-widget-search,
.information-widget-search {
    grid-column: 6 / 13 !important; 
    background: rgba(255, 255, 255, 0.10) !important;
    border: 1px solid rgba(255, 255, 255, 0.20) !important;
    border-radius: 12px !important;
    padding: 0 18px !important;
    backdrop-filter: blur(8px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
}
/* Explicación: El buscador ahora comienza en la columna 6, cediéndole el espacio necesario al clima. */

/* Limpieza del input de búsqueda */
.information-widget-search input,
.information-widget-search > div {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    color: white !important;
}
/* ==========================================================================
   📱 RESPONSIVE — Mobile (apila todo en 1 columna)
   ========================================================================== */
@media (max-width: 768px) {

  #widgets-wrap {
    grid-template-columns: 1fr !important;
  }

  .information-widget-logo,
  .nrl-main-title,
  .nrl-server1,
  .nrl-server1 + *,
  .nrl-server2,
  .nrl-server2 + * {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    border-radius: 12px !important;
    margin: 0 0 10px 0 !important;
    white-space: normal !important;
  }

  /* Reset a los bordes que se cortaban en pares (server + métricas) */
  .nrl-server1, .nrl-server2 {
    border-right: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 12px !important;
  }
  .nrl-server1 + *, .nrl-server2 + * {
    border-left: 1px solid rgba(255, 255, 255, 0.25) !important;
    margin-left: 0 !important;
    border-radius: 12px !important;
  }

  #information-widgets-right {
    grid-template-columns: 1fr !important;
  }

  .nrl-weather-time-box,
  form.information-widget-search,
  .information-widget-search {
    grid-column: 1 / -1 !important;
  }

  .nrl-weather-time-box {
    flex-direction: column !important;
  }

  .nrl-weather-time-box .information-widget-openmeteo {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  }
}
