/* 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;
}

/* ===== DYNAMIC SIDEBAR GRID ===== */

.app{
  transition:grid-template-columns .3s ease;
}

/* when sidebar is collapsed */
.app:has(.sidebar.collapsed){
  grid-template-columns:80px 1fr;
}

/* ===== FIXED FOOTER – ALWAYS VISIBLE ===== */

.app{
  grid-template-rows: 120px 1fr auto; /* footer gets its own space */
}

/* ===================== 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 (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;
}

/* =============================================================================
   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);
}

/* =============================================================================
   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;
}

/* ===== CHATGPT STYLE SIDEBAR TOGGLE ===== */

.sidebar{
  position:relative;
  transition:width .3s ease;
}

/* collapsed state */
.sidebar.collapsed{
  width:80px;
  padding:20px 10px;
}

/* hide text when collapsed */
/* ===== COLLAPSED SIDEBAR (CHATGPT STYLE) ===== */

.sidebar.collapsed{
  width:80px;
  padding:20px 10px;
}

/* hide ONLY text, not buttons */
.sidebar.collapsed .side-btn span{
  display:none;
}

/* show icons */
.sidebar.collapsed .side-btn i{
  opacity:1;
  transform:scale(1);
}

/* center icons */
.sidebar.collapsed .side-btn{
  justify-content:center;
  padding:14px 0;
}

/* hide non-button elements */
.sidebar.collapsed .history-lines,
.sidebar.collapsed .version,
.sidebar.collapsed .upgrade{
  display:none;
}

/* toggle button */
.sidebar-toggle{
  position:absolute;
  top:20px;
  right:-16px;

  width:32px;
  height:32px;
  border-radius:50%;
  border:none;

  background:rgba(255,255,255,0.12);
  color:#fff;
  cursor:pointer;

  display:flex;
  align-items:center;
  justify-content:center;

  box-shadow:0 4px 14px rgba(0,0,0,.5);
  backdrop-filter:blur(10px);
  transition:.3s;
  z-index:100;
}

.sidebar-toggle:hover{
  background:#00ffff;
  color:#000;
}

/* rotate icon when collapsed */
.sidebar.collapsed .sidebar-toggle i{
  transform:rotate(180deg);
}

/* ===== SIDEBAR BUTTON ICONS ===== */

.side-btn{
  display:flex;
  align-items:center;
  gap:14px;
}

/* icon default hidden */
.side-btn i{
  font-size:18px;
  min-width:22px;
  opacity:0;
  transform:scale(.6);
  transition:.25s ease;
}

/* when sidebar is collapsed */
.sidebar.collapsed .side-btn i{
  opacity:1;
  transform:scale(1);
}

/* hide text when collapsed */
.sidebar.collapsed .side-btn span{
  display:none;
}

/* center icons */
.sidebar.collapsed .side-btn{
  justify-content:center;
  padding:14px 0;
}

/* =============================================================================
   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;
}

/* ensure chat never goes under footer */
.chat{
  padding-bottom: 90px;
}

/* =============================================================================
   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);
}

/* input bar stays above footer */
.input-area{
  bottom: 40px;
}

/* =============================================================================
   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;
}

.footer{
  position: relative;
  height: 30px;
  flex-shrink: 0;
}

/* ===== PREMIUM SUGGESTION BAR (REFINED & COMPACT) ===== */

.suggestions{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  display:flex;
  flex-direction:column;
  gap:12px;
  z-index:50;
}

/* ===== SUGGESTION ITEM (THINNER + CLEAN) ===== */
.suggestion{
  width:240px;
  height:44px;

  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  border-radius:999px; /* pill */

  font-family:'Poppins','Inter','Segoe UI',sans-serif;
  font-size:14px;
  font-weight:500;
  letter-spacing:.2px;

  color:#ffffff;
  cursor:pointer;

  position:relative;
  overflow:hidden;

  box-shadow:
    0 6px 18px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.22);

  transition:transform .25s ease, box-shadow .25s ease;
}

/* 💖 Talk to GF */
.suggestion:nth-child(1){
  background:linear-gradient(135deg,#3a1c4a,#6b3a7d);
}

/* 🧠 Need Advice */
.suggestion:nth-child(2){
  background:linear-gradient(135deg,#0f3f3f,#3c9c76);
}

/* 😔 Feeling Lonely */
.suggestion:nth-child(3){
  background:linear-gradient(135deg,#252525,#6e2b2b);
}

/* 🔥 Motivate Me */
.suggestion:nth-child(4){
  background:linear-gradient(135deg,#6a3200,#ff8a00);
}

/* ===== SOFT TOP SHEEN ===== */
.suggestion::before{
  content:'';
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:45%;
  background:linear-gradient(
    to bottom,
    rgba(255,255,255,0.16),
    transparent
  );
  pointer-events:none;
}

/* ===== HOVER (SUBTLE PREMIUM) ===== */
.suggestion:hover{
  transform:translateY(-2px) scale(1.02);
  box-shadow:
    0 10px 28px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.28);
}

/* ===== ORBITING LINE EFFECT AROUND ALL SUGGESTIONS ===== */

.suggestions::after{
  content:'';
  position:absolute;
  top:-16px;
  left:-16px;
  right:-16px;
  bottom:-16px;

  border-radius:26px;
  pointer-events:none;

  background:
    conic-gradient(
      from 0deg,
      transparent 0deg,
      rgba(0,255,255,0.85) 40deg,
      transparent 80deg,
      transparent 180deg,
      rgba(255,0,200,0.85) 220deg,
      transparent 260deg,
      transparent 360deg
    );

  filter:blur(1.5px);
  animation:orbitGlow 5s linear infinite;

  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
          mask-composite:exclude;

  padding:2.5px;
}

/* ===== ORBIT ROTATION ===== */
@keyframes orbitGlow{
  from{ transform:rotate(0deg); }
  to{ transform:rotate(360deg); }
}

/* ===================== MOBILE ONLY - PHONE VIEW ===================== */
@media (max-width: 768px) {

  /* ===== HEADER ===== */
  .header {
    display: flex !important;
    align-items: center !important;   /* stop stretch */
    justify-content: space-between !important;
    height: auto !important;
    min-height: 56px !important;
    padding: 8px 12px !important;
  }

  /* ===== KILL THE BANNER ON MOBILE (IMPORTANT) ===== */
  .header-banner {
    display: none !important;
  }

  /* ===== LOGO ===== */
  .header-logo {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: 0 0 auto !important;  /* do NOT stretch */
  }

  /* desktop logo off */
  .logo-desktop {
    display: none !important;
  }

  /* mobile logo on */
  .logo-mobile {
    display: block !important;
    height: 32px !important;    /* THIS controls size */
    width: auto !important;
  }

  /* ===== HEADER ICONS ===== */
  .header-icons {
    display: flex !important;
    align-items: center !important;
    gap
  }
}









/* Voice status text (e.g., "Listening..." or "Speak in Hindi/English") */
.voice-status {
  font-size: 13px;
  color: #00ffff;
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-left: 8px;
  pointer-events: none;
}

.voice-status.active {
  opacity: 1;
}

/* Mic icon color changes */
#micIcon.listening {
  color: #ff3366;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}





.speak-btn {
  background: none;
  border: none;
  color: #00ffff;
  font-size: 18px;
  margin-left: 12px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.speak-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

.message.bot p {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}



.speaker-toggle {
  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;
}

.speaker-toggle.active {
  background: #00ffff;
  color: #000;
}












.version-btn {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  background: #2d2d2d;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.version-btn.pro {
  background: linear-gradient(90deg, #8b5cf6, #d946ef);
}

.version-btn.pro-plus {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}





.bot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.bot-label {
  margin-left: 14px;
  margin-bottom: 4px;
  font-weight: bold;
  color: #00ffff;
  opacity: 0.9;
}










/* ================= USER AVATAR ================= */
#userAvatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00ffff, #7c3aed);
  color: #000;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 15px #00ffff;
}

/* ================= DROPDOWN BASE ================= */
#userDropdown {
  position: absolute;
  top: 60px;
  right: 0;
  width: 230px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(10, 15, 30, 0.95);
  display: none;
  z-index: 9999;
  backdrop-filter: blur(16px);
  overflow: hidden;
}

/* ================= REVOLVING NEON BORDER ================= */
#userDropdown::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: conic-gradient(
    #00ffff,
    #7c3aed,
    #ff00ff,
    #00ff88,
    #00ffff
  );
  animation: spinBorder 3s linear infinite;
  z-index: -1;
}

#userDropdown::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 16px;
  background: rgba(10, 15, 30, 0.96);
  z-index: -1;
}

@keyframes spinBorder {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ================= USERNAME ================= */
#usernameText {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #00ffff;
  margin-bottom: 14px;
  text-shadow: 0 0 10px rgba(0,255,255,0.8);
}

/* ================= PLAN BUTTON ================= */
#planBtn {
  background: linear-gradient(135deg, #7c3aed, #00ffff);
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  box-shadow: 0 0 15px rgba(124,58,237,0.8);
  transition: transform 0.2s, box-shadow 0.2s;
}

#planBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(124,58,237,1);
}

/* ================= LOGOUT BUTTON ================= */
#logoutBtn {
  background: linear-gradient(135deg, #ff004c, #ff8a00);
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255,0,76,0.7);
  transition: transform 0.2s, box-shadow 0.2s;
}

#logoutBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255,0,76,1);
}
