/* ═════════════════════════════════════════════════════════════
   HEADER CSS
   
   Estilos para:
   - Header con gradiente principal
   - Datos del doctor (avatar, nombre, especialidad)
   - Botón atrás
   - Botón Mopi en header (desktop)
═════════════════════════════════════════════════════════════ */

/* ── HEADER ── */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 20px 20px 32px;
  color: #fff;
  position: relative;
  flex-shrink: 0
}

.header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 20px;
  background: #fff;
  border-radius: 20px 20px 0 0
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px
}

.header-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, .85);
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  border-radius: 8px;
  transition: background .2s
}

.header-back:active,
.header-back:hover {
  background: rgba(255, 255, 255, .1)
}

.header-back svg {
  width: 20px;
  height: 20px
}

.header-logo {
  height: 28px;
  opacity: .9
}

.header-content {
  display: flex;
  align-items: center;
  gap: 14px
}

.header-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  border: 2px solid rgba(255, 255, 255, .3);
  overflow: hidden;
  flex-shrink: 0
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%
}

.header-info {
  flex: 1
}

.header-label {
  font-size: 12px;
  opacity: .8;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: .5px
}

.header-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 2px
}

.header-specialty {
  font-size: 13px;
  opacity: .85
}

/* ── Mopi en header (botón circular) ── */
.header-top-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px
}

.mopi-header-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.15);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: all .2s ease;
  animation: mopiBounce 3s ease-in-out infinite
}

.mopi-header-btn:hover {
  background: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.8);
  transform: scale(1.08)
}

.mopi-header-btn:active {
  transform: scale(.95) !important;
  animation: none
}

.mopi-header-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%
}

/* Tooltip del header */
.mopi-header-btn .mopi-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: all .3s ease;
  pointer-events: none
}

.mopi-header-btn .mopi-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 12px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #fff
}

.mopi-header-btn.show-tooltip .mopi-tooltip {
  opacity: 1;
  transform: translateY(0)
}

/* Burbuja bajo Mopi */
.mopi-header-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end
}

.mopi-bubble {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
  z-index: 300;
  line-height: 1.5
}

.mopi-bubble.show-bubble {
  opacity: 1;
  transform: translateY(0)
}

/* ── Responsive ── */
@media(min-width:768px) {
  .header-avatar {
    width: 68px;
    height: 68px
  }

  .header-name {
    font-size: 22px
  }

  .header {
    padding: 24px 28px 36px
  }
}

@media (min-width: 1024px) {
  .header {
    padding: 28px 36px 40px;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-shrink: 0
  }
  
  .header-name { font-size: 24px }
  .header-avatar { width: 68px; height: 68px }
}

@media (min-width: 1440px) {
  .header { padding: 32px 44px 44px }
  .header-name { font-size: 26px }
  .header-avatar { width: 76px; height: 76px }
}
