/* ============================================================
   HEADER-WITH-BG.CSS — HEADER UNIFICADO CON FONDO DE PIZARRA
   Estándar de diseño: Dark Glassmorphism (Referencia: Minivoley)
   ============================================================ */

.app-header {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 16px;
  min-height: 130px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.07);
  background: rgba(13, 10, 40, 0.6);
}

.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.header-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  filter: brightness(0.6) saturate(1.3);
}

.header-content {
  position: relative;
  z-index: 2;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  min-height: 130px;
  gap: 12px;
}

/* Encabezado y títulos */
.header-left {
  flex: 1;
  min-width: 240px;
}

.header-left h1 {
  font-family: var(--font-body, 'Outfit', sans-serif);
  font-size: clamp(1.25rem, 3vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.header-left .subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.88) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  margin: 0 0 8px 0;
}

/* En modo claro la pizarra conserva autenticidad de tiza blanca con contraste absoluto */
body.light-mode .app-header {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
  background: rgba(13, 10, 40, 0.85);
}

body.light-mode .app-header .header-left h1 {
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9) !important;
}

body.light-mode .app-header .header-left .subtitle {
  color: rgba(255, 255, 255, 0.88) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8) !important;
}

body.light-mode .clock-container,
body.light-mode [class*="clock-container-"] {
  background: rgba(0, 0, 0, 0.65) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

body.light-mode .clock-container #clock,
body.light-mode [class*="clock-container-"] #clock {
  color: #ffffff !important;
}

body.light-mode .clock-container #date,
body.light-mode [class*="clock-container-"] #date {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Input de ubicación en el header */
.header-left .input-group {
  display: flex;
  gap: 8px;
  max-width: 380px;
  margin-top: 6px;
}

.header-left .input-group input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #ffffff;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-family: var(--font-body, 'Outfit', sans-serif);
  flex: 1;
  min-width: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-left .input-group input:focus {
  outline: none;
  border-color: rgba(155, 89, 182, 0.6);
  box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.25);
}

.header-left .input-group .btn {
  background: rgba(155, 89, 182, 0.55);
  border: 1px solid rgba(155, 89, 182, 0.45);
  color: #ffffff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.header-left .input-group .btn:hover {
  background: rgba(155, 89, 182, 0.8);
}

/* Botón compartir dentro del header */
.btn-share-header {
  background: rgba(155, 89, 182, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: transform 0.15s, background 0.2s;
  cursor: pointer;
}

.btn-share-header:hover {
  background: rgba(155, 89, 182, 0.8);
  transform: scale(1.04);
}

/* Reloj digital común (Estilo Minivoley Glass) */
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.clock-container,
[class*="clock-container-"] {
  background: rgba(0, 0, 0, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  text-align: center;
  min-width: 130px;
}

.clock-container #clock,
[class*="clock-container-"] #clock {
  color: #ffffff;
  font-family: var(--font-display, 'Bebas Neue', sans-serif) !important;
  font-size: clamp(1.2rem, 2.5vw, 1.65rem) !important;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.clock-container #date,
[class*="clock-container-"] #date {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* ===== RESPONSIVE PARA DISPOSITIVOS MÓVILES ===== */
@media (max-width: 768px) {
  .app-header {
    min-height: 110px;
    margin-bottom: 14px;
    border-radius: 14px;
  }

  .header-content {
    padding: 12px 14px;
    min-height: 110px;
  }

  .header-left h1 {
    font-size: 1.35rem;
  }

  .clock-container,
  [class*="clock-container-"] {
    padding: 6px 12px;
    min-width: 110px;
  }

  .clock-container #clock,
  [class*="clock-container-"] #clock {
    font-size: 1.25rem !important;
  }
}

@media (max-width: 480px) {
  .app-header {
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 8px;
    padding: 10px 12px;
  }

  .header-left {
    min-width: 0;
  }

  .header-left h1 {
    justify-content: center;
    font-size: 1.25rem;
  }

  .header-title-row {
    justify-content: center;
  }

  .header-left .input-group {
    max-width: 100%;
  }

  .header-right {
    justify-content: center;
  }

  .clock-container,
  [class*="clock-container-"] {
    width: 100%;
    max-width: 200px;
  }
}

/* Modo paisaje móvil (Landscape) - Ocultar o compactar header para modo marcador pantalla completa */
@media (orientation: landscape) and (max-height: 500px) {
  .app-header {
    display: none !important;
  }
}
