/* ==========================================================================
   YZG STUDIO v4.0 - MOBILE HEADER CENTRADO & CLEAN
   ========================================================================== */

/* 🚫 En PC esto permanece 100% oculto */
.yzg-mobile-header,
.yzg-mobile-dock {
  display: none !important;
}

/* 📱 SOLO MÓVIL (≤ 768px) */
@media (max-width: 768px) {

  /* Ocultar elementos de PC que chocan */
  #main-sidebar,
  .sidebar,
  .sidebar-collapsed,
  header .app-title,
  .top-bar-title {
    display: none !important;
  }

  /* Reset layout general */
  html, body,
  .main-content,
  #workspace,
  #builder-workspace,
  #view-chat,
  #view-builder,
  #view-gallery,
  #view-agent {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    left: 0 !important;
    box-sizing: border-box !important;
  }

  #workspace,
  #builder-workspace,
  .chat-viewport {
    padding-top: 65px !important;
    padding-bottom: 140px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* ========== HEADER MÓVIL ========== */
  .yzg-mobile-header {
    display: flex !important;
    position: fixed;
    top: 10px;
    left: 0;
    width: 100%;
    padding: 0 14px;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    pointer-events: none;
    box-sizing: border-box;
  }

  /* 1. Logo del Cubo a la izquierda */
  .logo-cube-btn {
    pointer-events: auto;
  }

  /* 2. Título Centrado en el Medio de la Pantalla */
  .m-center-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(18, 24, 39, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 5px 16px;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  }

  /* 3. Botones Derecha (Login + GitHub) */
  .m-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
  }

  .m-circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(18, 24, 39, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
  }

  .m-circle-btn:active {
    transform: scale(0.92);
    border-color: var(--accent, #818cf8);
  }

  .m-circle-btn .material-symbols-outlined {
    font-size: 18px;
  }

  .m-capsule {
    background: rgba(18, 24, 39, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 6px 12px;
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  }

  /* ========== DOCK INFERIOR ========== */
  .yzg-mobile-dock {
    display: flex !important;
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 340px;
    height: 52px;
    background: rgba(18, 24, 39, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50px;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  }

  .m-dock-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .m-dock-btn .material-symbols-outlined {
    font-size: 22px;
  }

  .m-dock-btn.active {
    color: var(--accent, #818cf8);
    background: rgba(129, 140, 248, 0.18);
  }

  /* ========== INPUT BOX ========== */
  .input-box,
  .chat-input-container {
    position: fixed !important;
    bottom: 74px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90% !important;
    max-width: 400px !important;
    margin: 0 !important;
    z-index: 9998 !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6) !important;
  }
}
