/* PAGE BACKGROUND */
body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top, #1b1b2f, #000);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #f5f5f5;
}

/* SIDEBAR (outside the app box) */
#sidebar {
    width: 260px;
    background: #111;
    position: fixed;
    top: 0;
    bottom: 0;
    left: -490px;
    padding: 15px;
    transition: left 0.3s ease;
    overflow-y: auto;
    border-right: 1px solid #333;
    z-index: 20;
}

#sidebar.open {
    left: 0;
}

#newChatBtn {
    width: 100%;
    padding: 12px;
    background: #4a4aff;
    border: none;
    color: white;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
}

.chat-item {
    padding: 10px;
    background: #222;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
}

.chat-item:hover {
    background: #333;
}

/* SIDEBAR TOGGLE BUTTON */
#toggleSidebar {
    position: fixed;
    top: 15px;
    left: 15px;
    font-size: 26px;
    background: #4a4aff;
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    z-index: 30;
}

/* MAIN APP BOX */
.app {
    width: 90%;
    max-width: 900px;
    height: 85vh;
    background: rgba(10, 10, 25, 0.95);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* HEADER */
.app-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
background: linear-gradient(90deg, #45108a, #2e4bad, #1b1aaa);
}

.app-title {
    font-size: 20px;
    font-weight: 700;
}

.app-subtitle {
    font-size: 12px;
    opacity: 0.85;
}

.badge {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* CHAT AREA */
#chatArea {
    flex: 1;
    padding: 16px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: radial-gradient(circle at top left, rgba(69,16,138,0.28), transparent 55%),
                radial-gradient(circle at bottom right, rgba(27,154,170,0.25), transparent 55%);
}

/* MESSAGE BUBBLES */
.message {
    max-width: 75%;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4b6fff, #9c6bff);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai {
    align-self: flex-start;
    background: rgba(12, 17, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

/* FOOTER */
.footer {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 7, 20, 0.98);
}

.input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

#inputBox {
    flex: 1;
    padding: 9px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(10, 10, 25, 0.95);
    color: #f3f3f3;
    font-size: 14px;
    outline: none;
}

#sendButton {
    padding: 9px 18px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #26c281, #1b9aaa);
    color: #021018;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.status-bar {
    margin-top: 6px;
    font-size: 11px;
    opacity: 0.7;
    display: flex;
    justify-content: space-between;
}

/* ============================================================
   ⭐ SMARTGPT VOICE MODE OVERLAY
   ============================================================ */

#voiceModeOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  backdrop-filter: blur(14px);
  z-index: 50;
}

/* ⭐ Glowing SmartGPT Circle */
#voiceCircle {
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
      #45108a,
      #2e4bad,
      #1b1aaa
  );
  box-shadow:
      0 0 40px rgba(69, 16, 138, 0.6),
      0 0 80px rgba(46, 75, 173, 0.5),
      0 0 120px rgba(27, 26, 170, 0.4);
  animation: idlePulse 3s infinite ease-in-out;
}

/* ⭐ Idle Pulse Animation */
@keyframes idlePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ⭐ Listening Pulse (green glow) */
.listeningPulse {
  animation: listeningPulse 1.2s infinite ease-in-out !important;
}

@keyframes listeningPulse {
  0%   { transform: scale(1); box-shadow: 0 0 40px rgba(0,255,120,0.5); }
  50%  { transform: scale(1.12); box-shadow: 0 0 90px rgba(0,255,120,0.8); }
  100% { transform: scale(1); box-shadow: 0 0 40px rgba(0,255,120,0.5); }
}

/* ⭐ Speaking Pulse (blue glow) */
.speakingPulse {
  animation: speakingPulse 1.2s infinite ease-in-out !important;
}

@keyframes speakingPulse {
  0%   { transform: scale(1); box-shadow: 0 0 40px rgba(56,189,248,0.6); }
  50%  { transform: scale(1.12); box-shadow: 0 0 90px rgba(56,189,248,0.9); }
  100% { transform: scale(1); box-shadow: 0 0 40px rgba(56,189,248,0.6); }
}

/* ⭐ Voice Mode Buttons */
.voice-controls {
  margin-top: 22px;
  display: flex;
  gap: 12px;
}

.voice-controls button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(90deg, #45108a, #2e4bad);
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s ease;
}

.voice-controls button:hover {
  opacity: 0.85;
}

/* ============================================================
   ⭐ DEVICE LAYOUT (ONLY THIS ADDED)
   ============================================================ */

@media (max-width: 900px) {
  .app {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: 1px solid black; /* KEEP BLACK BORDER */
  }
}

@media (max-width: 600px) {
  #sidebar {
    width: 220px;
    left: -220px;
  }

  #chatArea {
    padding: 12px;
  }

  .message {
    max-width: 90%;
    font-size: 13px;
  }

  #inputBox {
    padding: 8px 10px;
  }

  #sendButton {
    padding: 8px 12px;
  }

  #voiceCircle {
    width: 260px;
    height: 260px;
  }
}
