/* ========================================================
   MASTER JIBRIL AI — LUXURY CYBER CHAT THEME
   ======================================================== */

:root {
  --bg-main: #07090e;
  --bg-sidebar: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(26, 34, 54, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 242, 254, 0.5);
  
  --primary-cyan: #00f2fe;
  --primary-blue: #4facfe;
  --accent-emerald: #10b981;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --user-bubble: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  --ai-bubble: rgba(18, 24, 38, 0.95);
  --sidebar-w: 280px;
  --header-h: 68px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* APP LAYOUT */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  height: var(--header-h);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #07090e;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.35);
}

.brand-meta {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(90deg, #fff 0%, #bae6fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--primary-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.close-sidebar-btn {
  display: none;
}

.sidebar-action {
  padding: 1rem 1.25rem;
}

.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--primary-cyan);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.new-chat-btn:hover {
  background: rgba(0, 242, 254, 0.16);
  border-color: var(--primary-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.25);
  transform: translateY(-1px);
}

.sidebar-section-title {
  padding: 0.5rem 1.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item:hover, .history-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  transition: color 0.15s;
}

.footer-link:hover {
  color: #fff;
}

.footer-link.highlight {
  color: #38bdf8;
  font-weight: 500;
}

.user-status-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.status-meta {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

.status-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  background: radial-gradient(circle at 50% 10%, rgba(15, 23, 42, 0.5) 0%, rgba(7, 9, 14, 1) 100%);
}

/* TOP NAVBAR */
.top-nav {
  height: var(--header-h);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-toggle-btn {
  display: none;
}

.nav-brand h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-brand h1 span {
  background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--primary-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* MODEL SELECTOR */
.model-picker-container {
  display: flex;
  align-items: center;
}

.model-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 0.35rem 0.85rem;
  transition: all 0.2s ease;
}

.model-select-wrapper:hover, .model-select-wrapper:focus-within {
  border-color: rgba(0, 242, 254, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.model-icon {
  margin-right: 0.4rem;
  font-size: 0.9rem;
}

.model-select {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  padding-right: 1.25rem;
  outline: none;
}

.model-select option {
  background-color: #0f172a;
  color: #fff;
}

.chevron-icon {
  position: absolute;
  right: 0.75rem;
  pointer-events: none;
  color: var(--text-dim);
}

/* DIRECT WA BUTTON */
.btn-direct-wa {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-direct-wa:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.wa-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
}

/* CHAT VIEWPORT */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* WELCOME HERO */
.welcome-hero {
  max-width: 760px;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem 0;
}

.hero-badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: var(--primary-cyan);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-title span {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  width: 100%;
  margin-top: 1rem;
}

.prompt-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.prompt-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 242, 254, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.prompt-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.prompt-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.15rem;
}

.prompt-sub {
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* MESSAGES CONTAINER */
.messages-container {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-bubble {
  display: flex;
  gap: 0.85rem;
  width: 100%;
  animation: fade-in 0.25s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.user {
  flex-direction: row-reverse;
}

.bubble-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-bubble.user .bubble-avatar {
  background: #3b82f6;
  color: #fff;
}

.chat-bubble.ai .bubble-avatar {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #07090e;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.bubble-content {
  max-width: calc(100% - 60px);
  display: flex;
  flex-direction: column;
}

.chat-bubble.user .bubble-content {
  align-items: flex-end;
}

.bubble-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bubble-body {
  padding: 0.9rem 1.2rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.65;
  word-break: break-word;
}

.chat-bubble.user .bubble-body {
  background: var(--user-bubble);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
}

.chat-bubble.ai .bubble-body {
  background: var(--ai-bubble);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* MARKDOWN STYLES */
.bubble-body p {
  margin-bottom: 0.75rem;
}

.bubble-body p:last-child {
  margin-bottom: 0;
}

.bubble-body ul, .bubble-body ol {
  margin: 0.5rem 0 0.75rem 1.25rem;
}

.bubble-body li {
  margin-bottom: 0.3rem;
}

.bubble-body h1, .bubble-body h2, .bubble-body h3 {
  font-family: 'Outfit', sans-serif;
  color: #fff;
  margin: 1rem 0 0.5rem 0;
}

.bubble-body blockquote {
  border-left: 3px solid var(--primary-cyan);
  padding-left: 0.85rem;
  color: var(--text-muted);
  margin: 0.75rem 0;
}

.bubble-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: #38bdf8;
}

.bubble-body pre {
  margin: 0.75rem 0;
  border-radius: 10px;
  overflow: hidden;
  background: #181d28;
  border: 1px solid var(--border-subtle);
}

.bubble-body pre code {
  display: block;
  padding: 0.85rem 1rem;
  background: transparent;
  color: #e2e8f0;
  overflow-x: auto;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f141e;
  padding: 0.35rem 0.85rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
}

.btn-copy-code {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  transition: color 0.15s;
}

.btn-copy-code:hover {
  color: #fff;
}

/* TYPING INDICATOR */
.typing-bubble {
  max-width: 820px;
  width: 100%;
  margin: 0.5rem auto 0 auto;
  display: none;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.typing-bubble.active {
  display: flex;
}

.typing-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #07090e;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary-cyan);
  animation: bounce-dots 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce-dots {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.typing-label {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* INPUT BAR */
.input-panel {
  padding: 1rem 1.5rem 1.25rem 1.5rem;
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
}

.chat-form {
  position: relative;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  background: rgba(18, 24, 38, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 0.6rem 0.75rem 0.6rem 1.1rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.input-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  max-height: 160px;
  line-height: 1.5;
  padding: 0.25rem 0;
}

.chat-textarea::placeholder {
  color: var(--text-dim);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.5rem;
}

.icon-btn, .btn-action-icon {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.icon-btn:hover, .btn-action-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  border: none;
  color: #07090e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.35);
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.6);
}

.send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.input-footer {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.input-footer b {
  color: var(--text-muted);
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 45;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .menu-toggle-btn {
    display: flex;
  }

  .close-sidebar-btn {
    display: flex;
  }

  .prompt-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .top-nav {
    padding: 0 1rem;
  }

  .input-panel {
    padding: 0.75rem 1rem 1rem 1rem;
  }

  .wa-text {
    display: none;
  }

  .btn-direct-wa {
    padding: 0.45rem 0.6rem;
  }
}
