/* style.css - familo AI - FINAL VERSION (Desktop untouched, Mobile perfect) */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0f0f0f;
  color: #fff;
  height: 100vh;
  overflow: hidden;
}

.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: 120px 1fr 70px;
  grid-template-areas:
    "header header"
    "sidebar chat"
    "footer footer";
  background: #0a0a0a;
}

/* ===================== HEADER ===================== */
.header {
  grid-area: header;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  background: linear-gradient(to bottom, #1a1a1d, #0f0f12);
  border-bottom: 1px solid #333;
}

/* Visible ONLY on desktop – hidden on phone/tablet */
.logo {
  font-size: 32px;
  font-weight: bold;
  position: absolute;
  left: 10%;
  top: 60%;
  color: #f7f4f4;
  text-shadow: 0 0 20px rgba(238, 243, 243, 0.6);
  z-index: 11;
}

/* Hide it completely on phones and tablets */
@media only screen and (max-width: 1024px) {
  .logo {
    display: none !important;
  }
}

@media only screen and (max-width: 768px) {
  .logo2 {
     font-size: 32px;
  font-weight: bold;
  position: absolute;
    left: 1.5% !important;
    top: 130% !important;
    color: #f7f4f4 !important;
    text-shadow: 0 0 20px rgba(238, 243, 243, 0.6) !important;
    z-index: 11 !important;
    transform: translateY(-50%) !important;   /* often helps centering on mobile */
  }
}



.header-logo {
  position: absolute;
  left: 5%;
  top: 10px;
  transform: translateX(-50%);
  width: 150px;

  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(0, 255, 255, 0.4);
  box-shadow: 0 10px 40px rgba(0, 255, 255, 0.3);
  z-index: 10;
  transition: all 0.4s ease;
}
/* Mobile-only styles (max-width: 767px) – common for phones */
@media only screen and (max-width: 767px) {
  .header-logo {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(0, 255, 255, 0.4);
    box-shadow: 0 10px 40px rgba(0, 255, 255, 0.3);
    z-index: 10;
    transition: all 0.4s ease;
  }
}



.header-banner {
  position: absolute;
  left: 50%;
  top: 15px;
  transform: translateX(-50%);
  width: 604px;

  height: 92px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(0, 255, 255, 0.4);
  box-shadow: 0 10px 40px rgba(0, 255, 255, 0.3);
  z-index: 10;
  transition: all 0.4s ease;
}

.header-banner:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 20px 60px rgba(0, 255, 255, 0.6);
  border-color: #00ffff;
}

.header-icons {
  position: absolute;
  right: 40px;
  top: 30px;
  display: flex;
  gap: 20px;
  z-index: 11;
}

.header-icons button {
  background: rgba(0, 255, 255, 0.15);
  border: 1.5px solid rgba(0, 255, 255, 0.3);
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.header-icons button:hover {
  background: rgba(0, 255, 255, 0.4);
  transform: scale(1.15);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
}

/* ===================== AVATAR TOGGLE BUTTONS – DESKTOP (PC) ===================== */
@media only screen and (min-width: 769px) {
  /* Left Avatar Button – aligned to the LEFT side of the banner */
  #toggleAvatarsBtn {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-620%, -50%) !important;  /* moves it ~300px left of banner center */
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: rgba(0, 255, 255, 0.35) !important;
    border: 3px solid #00ffff !important;
    box-shadow: 0 0 35px rgba(0, 255, 255, 0.8) !important;
    font-size: 24px !important;
    z-index: 12 !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
  }

  /* Right Avatar Button – aligned to the RIGHT side of the banner */
  #toggleRightAvatars {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(520%, -50%) !important;  /* moves it ~300px right of banner center */
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: rgba(0, 255, 255, 0.35) !important;
    border: 3px solid #00ffff !important;
    box-shadow: 0 0 35px rgba(0, 255, 255, 0.8) !important;
    font-size: 24px !important;
    z-index: 12 !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
  }

  #toggleAvatarsBtn:hover,
  #toggleRightAvatars:hover {
    background: #00ffff !important;
    color: #000 !important;
    transform: scale(1.15);
    box-shadow: 0 0 50px rgba(0, 255, 255, 1) !important;
  }
}

/* ===================== PHONE / MOBILE ===================== */
@media only screen and (max-width: 768px) {
  /* Both buttons: Top-Left corner, circular, glowing */
  #toggleAvatarsBtn,
  #toggleRightAvatars {
    position: fixed !important;
    top: 18px !important;           /* just below header */
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: rgba(0, 255, 255, 0.3) !important;
    border: 2px solid #00ffff !important;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.7) !important;
    font-size: 20px !important;
    z-index: 9999 !important;
    backdrop-filter: blur(10px);
  }

  /* Left button */
  #toggleAvatarsBtn {
    left: 16px !important;
  }

  /* Right button – slightly to the right of left one */
  #toggleRightAvatars {
    left: 76px !important;   /* 16 + 52 + 8 gap */
  }

  /* Hide the old header-icons buttons on mobile */
  .header-icons button:not(#toggleSidebarBtn) {
    display: none !important;
  }
}


/* ===================== AVATAR BAR, SIDEBAR, CHAT, INPUT, RIGHT AVATARS, FOOTER ===================== */
/* (All your original beautiful desktop styles stay exactly here - unchanged) */

/* =============================================================================
   AVATAR BAR (Top sliding panel)
   ========================================================================== */

.avatar-bar-container {
  position: fixed;
  top: 120px;
  left: 0;
  right: 0;
  height: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1e2e, #2a1a3d);
  z-index: 998;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 1px solid #00ffff33;
}

.avatar-bar-container.open {
  height: 120px;
}

.avatar-bar {
  padding: 20px 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatars {
  display: flex;
  gap: 36px;
  overflow-x: auto;
  padding: 10px 20px;
  scrollbar-width: thin;
}

.avatars img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid #555;
  object-fit: cover;
  transition: all 0.4s ease;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(0,0,0,0.6);
}

.avatars img:hover {
  transform: scale(1.2);
  border-color: #00ffff;
  box-shadow: 0 0 40px rgba(0,255,255,0.7);
}

.load-more {
  background: linear-gradient(135deg, #444, #666);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.load-more:hover {
  background: #00ffff;
  color: #000;
}

/* =============================================================================
   SIDEBAR
   ========================================================================== */

.sidebar {
  grid-area: sidebar;
  background: linear-gradient(to bottom, #1a1a1d, #0f0f12);
  padding: 25px 30px;
  border-right: 1px solid #333;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar button {
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  padding: 16px 22px;
  text-align: left;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  transition: 0.3s;
}

.sidebar button:hover {
  background: rgba(0,255,255,0.2);
  transform: translateX(8px);
}

.version,
.upgrade {
  margin-top: auto;
  text-align: center;
  padding: 12px;
  background: rgba(0,255,255,0.1);
  border-radius: 10px;
  font-size: 13px;
  color: #00ffff;
}

/* =============================================================================
   CHAT AREA
   ========================================================================== */

.chat {
  grid-area: chat;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  padding: 15px;
  overflow: hidden;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  max-width: 75%;
  padding: 16px 22px;
  border-radius: 20px;
  line-height: 1.7;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #4a4a4a, #333);
  border-bottom-right-radius: 6px;
}

.message.bot {
  align-self: flex-start;
  background: linear-gradient(135deg, #2a2a3a, #1a1a2a);
  border-bottom-left-radius: 6px;
  border-left: 4px solid #00ffff;
}

/* =============================================================================
   INPUT AREA (Bottom fixed bar)
   ========================================================================== */

.input-area {
  position: fixed;
  bottom: 25px;
  left: 55%;
  transform: translateX(-50%);
  width: 62%;
  max-width: 900px;
  padding: 10px 16px;
  background: rgba(30,30,40,0.95);
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 2px solid rgba(0,255,255,0.3);
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  z-index: 100;
}

.input-area input {
  flex: 1;
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  outline: none;
}

.plus,
.voice,
.send {
  background: rgba(0,255,255,0.2);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.plus:hover,
.voice:hover,
.send:hover {
  background: #00ffff;
  color: #000;
  transform: scale(1.1);
}

/* =============================================================================
   RIGHT AVATARS PANEL (Slide-in from right)
   ========================================================================== */

.right-avatars {
  position: fixed;
  right: -120px;
  top: 120px;
  bottom: 70px;
  width: 100px;
  background: linear-gradient(to bottom, #1a1a1d, #0f0f12);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
  gap: 30px;
  transition: right 0.5s ease;
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
  z-index: 997;
}

.right-avatars.open {
  right: 0;
}

.right-avatars img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 4px solid #444;
  transition: 0.3s;
}

.right-avatars img:hover {
  border-color: #00ffff;
  transform: scale(1.2);
}

/* =============================================================================
   FOOTER
   ========================================================================== */

.footer {
  grid-area: footer;
  background: rgba(10,10,10,0.8);
  color: #666;
  text-align: center;
  font-size: 12.5px;
  line-height: 28px;
  backdrop-filter: blur(10px);
  border-top: 1px solid #333;
}



/* ===================== MOBILE ONLY - PHONE VIEW ===================== */
@media (max-width: 768px) {
  .app { 
    grid-template-columns: 1fr !important; 
    grid-template-areas: "header" "chat" "footer" !important; 
    height: 100dvh; 
  }

  /* Hide everything except hamburger & avatar toggle */
  .header-icons button:not(#toggleSidebarBtn, #toggleAvatarsBtn) { display: none !important; }
  .sidebar, .right-avatars { display: none !important; }

  /* NEW: Slimmer header - no banner, smaller height */
  .header { 
    flex-direction: row; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 16px; 
    min-height: 76px !important; 
    height: 76px;
  }
  .logo { 
    position: static !important; 
    font-size: 26px !important; 
    order: 2;
  }
  .header-banner { 
    display: none !important; 
  }

  /* Left button (hamburger) */
  #toggleSidebarBtn { 
    display: flex !important; 

    width: 0px !important; 
    height: 0px !important; 
    border-radius: 0 !important; 
    font-size: 19px !important; 
    order: 1;
  }

  /* Right button (avatars) */
  #toggleAvatarsBtn {
    background: rgba(0,255,255,0.25) !important; 
    border: 2px solid rgba(0,255,255,0.6) !important; 
    width: 44px !important; 
    height: 44px !important; 
    border-radius: 50% !important; 
    font-size: 19px !important; 
    order: 3;
  }

  /* Sliding Sidebar */
  .sidebar {
    position: fixed !important; top: 0; bottom: 0; left: -320px; width: 320px; height: 100dvh;
    z-index: 9999; transition: left 0.35s ease; display: block !important;
  }
  .sidebar.open { left: 0; box-shadow: 10px 0 30px rgba(0,0,0,0.7); }

  /* Dark overlay */
  body.sidebar-open::before {
    content: ''; position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 9998;
  }

  /* REMOVE FOOTER ON PHONE */
  .footer { display: none !important; }

  .chat { padding: 12px !important; height: calc(100dvh - 140px) !important; }

  /* NEW: Smaller, narrower text bar with circular buttons */
  .input-area { 
    position: fixed !important; 
    bottom: 16px !important; 
    left: 12px !important; 
    right: 12px !important; 
    width: auto !important; 
    max-width: none !important; 
    transform: none !important; 
    padding: 10px 14px !important; 
    gap: 10px !important; 
    border-radius: 50px !important;
  }
  input { 
    font-size: 16px !important; 
    padding: 8px 0 !important;
  }
  .plus, .voice, .send { 
    width: 42px !important; 
    height: 42px !important; 
    font-size: 18px !important; 
    border-radius: 50% !important;
  }
}