﻿/* ==========================================================
   360CRECIMIENTO – UI SKIN FINAL (OPTIMIZADO)
   Branding Verde Premium | Myrtille Client
   ========================================================== */

/* ==========================================================
   1. VARIABLES DE MARCA
   ========================================================== */
:root {
  --c360-green: #1A8215;
  --c360-green-dark: #0E6B0E;
  --ui-text: rgba(255, 255, 255, 0.92);
  --ui-muted: rgba(255, 255, 255, 0.78);
}

/* ==========================================================
   2. FONDO GLOBAL Y RESET
   ========================================================== */
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ui-text);

  /* Fondo con degradados sutiles */
  background:
    radial-gradient(circle at 35% 40%, rgba(26, 130, 21, 0.10), transparent 55%),
    radial-gradient(circle at 70% 65%, rgba(0, 0, 0, 0.20), transparent 60%),
    linear-gradient(180deg, #0F1F1A 0%, #0C1A17 45%, #081412 100%);
}



/* ==========================================================
   3. LOGIN - LOGOTIPO (Imagen Personalizada)
   ========================================================== */

/* Contenedor del Logo */
#logo {
  /* --- 1. CONFIGURACIÓN DE LA IMAGEN --- */
  /* Cambia "/img/logo_360.png" por el nombre real de tu archivo */
  background-image: url("/img/360Crecimiento.png");
  
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain; /* Ajusta el logo para que quepa sin deformarse */

  /* --- 2. TAMAÑO Y CENTRADO --- */
  width: 100%;
  max-width: 360px; 
  
  /* <--- MUY IMPORTANTE: El div debe tener una altura, o se colapsa a 0px y no se ve nada --- */
  height: 120px; /* Ajusta este valor (ej: 100px, 150px) según la proporción de tu logo */
  
  margin: 0 auto 32px auto;
  display: block;
  text-align: center;
  
  /* Efectos visuales */
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.4));
}


/* ==========================================================
   3. LOGIN - ALINEACIÓN PERFECTA (NUEVA ESTRATEGIA)
   ========================================================== */

/* --- Labels --- */
#login .inputDiv label {
  color: var(--ui-muted);
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 8px;
  display: block;
  /* Truco 1: Le devolvemos el padding aquí para alinear texto */
  padding-left: 18px;
  padding-right: 18px;
}

/* --- Inputs (Usuario / Contraseña) --- */
#login input[type="text"],
#login input[type="password"] {
  background: rgba(255, 255, 255, 0.97);
  border: none;
  border-radius: 12px; 
  
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.10),
    0 2px 6px rgba(0, 0, 0, 0.25);

  font-size: 15px;
  color: #1a1a1a;
  
  /* Truco 2: Padding lateral dentro del input (en vez del contenedor) */
  padding: 0 18px; 
  
  /* Altura y Ancho estándar */
  height: 48px;
  width: 100%;
  
  box-sizing: border-box;
  display: block;
  line-height: 1;
}

#login input:focus {
  outline: none;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.10),
    0 0 0 2px rgba(26, 130, 21, 0.35),
    0 4px 10px rgba(0, 0, 0, 0.35);
}

/* Botón Conectar - AJUSTE FINAL DE PRECISIÓN */
#connect {
  background: linear-gradient(180deg, #2FAE2A 0%, #1A8215 100%);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  cursor: pointer;
  font-size: 15px;
  letter-spacing: 0.3px;

  /* --- TRUCO DE ALINEACIÓN --- */
  display: flex !important;
  justify-content: center;
  align-items: center;
  
  width: 100%;
  
  /* ✅ CÁLCULO EXACTO: Restamos los 36px de padding del padre (18px * 2) */
  max-width: calc(min(720px, 96vw) - 36px); 
  
  margin: 16px auto 0 auto;
  height: 48px;
  padding: 0; 
  box-sizing: border-box;
  line-height: 1;
  user-select: none;
}

#connect:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* ==========================================================
   4. OVERLAY DE CONEXIÓN (Spinner)
   ========================================================== */
#connectingOverlay {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;

  /* Fondo oscuro con desenfoque */
  background:
    radial-gradient(circle at center, rgba(26, 130, 21, 0.18), transparent 55%),
    rgba(10, 20, 20, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.connecting-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.connecting-box .text {
  margin-top: 14px;
  font-size: 15px;
  opacity: 0.9;
}

/* Animación del Spinner */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--c360-green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================
   5. TOOLBAR (Estilo Premium - Sin Zonas Muertas)
   ========================================================== */

/* --- A. CONTENEDOR PRINCIPAL --- */
#toolbar {
  /* Flexbox es vital para alinear el Slider y los Botones a la misma altura */
  display: flex;
  align-items: center;      /* Centrado vertical perfecto */
  gap: 10px;                /* Espacio consistente entre elementos (evita zonas muertas) */
  padding: 6px 12px;        /* Padding interno del contenedor */
  
  /* El resto del estilo del contenedor (posición, fondo) iría aquí si no lo tienes ya */
  background: rgba(15, 27, 46, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 50px;      /* Forma de cápsula moderna */
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- B. OCULTAR ELEMENTOS NO USADOS --- */
#toolbar input {
  display: none !important;
}

#toolbar #stat,
#toolbar #statDiv {
  display: none !important;
}

/* --- C. MOSTRAR SOLO LOS DESEADOS --- */
#toolbar #imageQuality,
#toolbar #reconnect,      /* <--- AGREGADO */
#toolbar #share,
#toolbar #disconnect {
    display: inline-block !important;
}

/* --- D. ESTILO PREMIUM PARA BOTONES (Share / Disconnect) --- */
/* Aplicamos estilos a todos los inputs EXCEPTO al Slider de Calidad */
#toolbar input:not(#imageQuality) {
  height: 32px;             /* ALTURA FIJA ESTRICTA (igual al slider) */
  
  background: rgba(255, 255, 255, 0.08); /* Fondo cristal */
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;       /* Bordes ligeramente redondeados */
  
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  
  padding: 0 18px;         /* Padding horizontal para toque cómodo */
  margin: 0;               /* Sin margen externo (Flexbox controla el espacio con 'gap') */
  
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  
  /* Reset completo para asegurar consistencia cross-browser */
  outline: none;
  -webkit-appearance: none;
  box-shadow: none;
}

/* --- E. INTERACCIÓN (Hover) --- */
#toolbar input:not(#imageQuality):hover {
  background: rgba(26, 130, 21, 0.9); /* Color Marca al pasar mouse */
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px); /* Micro-elevación */
}

/* --- F. INTERACCIÓN (Click/Active) --- */
#toolbar input:not(#imageQuality):active {
  transform: translateY(1px); /* Efecto de presionado hacia abajo */
  background: rgba(26, 130, 21, 1);
}

/* --- G. VARIACIONES ESPECÍFICAS (UX) --- */

/* Botón Desconectar (Rojo sutil en hover para indicar salida) */
#toolbar #disconnect:hover {
  background: rgba(220, 53, 69, 0.9); /* Rojo Premium */
  border-color: rgba(255, 200, 200, 0.4);
}

/* Botón Compartir (Mantiene el verde, quizás un poco más brillante) */
#toolbar #share:hover {
  background: rgba(46, 174, 42, 0.95); /* Verde más vivo */
  border-color: rgba(200, 255, 200, 0.4);
}

/* --- H. SLIDER DE CALIDAD (Mantenemos su diseño pero aseguramos alineación) --- */
#toolbar #imageQuality {
  -webkit-appearance: none;
  appearance: none;
  
  height: 32px;            /* Igual que los botones */
  width: 160px;            /* Ancho definido */
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px;     /* Más redondo que los botones */
  padding: 0 10px;
  cursor: pointer;
  border: 1px solid transparent;
}

#toolbar #imageQuality:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Track (La barra del slider) */
#toolbar #imageQuality::-webkit-slider-runnable-track,
#toolbar #imageQuality::-moz-range-track {
  height: 4px;             /* Un poco más fino para elegancia */
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
}

/* Thumb (El círculo que se arrastra) */
#toolbar #imageQuality::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  margin-top: -6px;        /* Ajuste fino para centrar en el track de 4px */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid #1A8215; /* Borde verde marca */
}

#toolbar #imageQuality::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #1A8215;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}