:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 25, 41, 0.75);
  --bg-card-hover: rgba(28, 38, 61, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(0, 172, 71, 0.4);
  
  --primary-gc: #00ac47;
  --primary-gc-glow: rgba(0, 172, 71, 0.35);
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px var(--primary-gc-glow);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 172, 71, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.12) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* App Header */
.app-header {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(9, 13, 22, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #00ac47 0%, #008736 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff, #a7f3d0);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.active {
  background: var(--primary-gc);
  box-shadow: 0 0 10px var(--primary-gc);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 172, 71, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(0, 172, 71, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 172, 71, 0); }
}

/* Main Container */
.main-wrapper {
  max-width: 1280px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Navigation Tabs */
.tabs-nav {
  display: flex;
  gap: 0.75rem;
  background: rgba(18, 25, 41, 0.6);
  border: 1px solid var(--border-color);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 172, 71, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  color: #ffffff;
  border: 1px solid var(--border-highlight);
  box-shadow: var(--shadow-sm);
}

/* Tab Panels */
.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Chat Layout Grid */
.chat-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
}

/* Chat Feed Container */
.chat-feed-box {
  display: flex;
  flex-direction: column;
  height: 540px;
  border-radius: var(--radius-md);
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.chat-messages-container {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Scrollbar Styling */
.chat-messages-container::-webkit-scrollbar {
  width: 6px;
}
.chat-messages-container::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Chat Message Items */
.msg-item {
  display: flex;
  gap: 0.85rem;
  max-width: 85%;
  animation: slideIn 0.25s ease;
}

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

.msg-item.from-web {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.msg-item.from-web .msg-meta {
  justify-content: flex-end;
}

.msg-sender {
  font-weight: 600;
  color: var(--text-muted);
}

.msg-badge {
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 700;
}

.badge-google-chat {
  background: rgba(0, 172, 71, 0.2);
  color: #34d399;
  border: 1px solid rgba(0, 172, 71, 0.3);
}

.badge-web {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-system {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.msg-bubble {
  padding: 0.85rem 1.15rem;
  border-radius: 14px;
  font-size: 0.95rem;
  word-break: break-word;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.msg-item.from-web .msg-bubble {
  background: linear-gradient(135deg, #008736 0%, #00ac47 100%);
  color: #ffffff;
  border: none;
  border-bottom-right-radius: 2px;
}

.msg-item.from-gc .msg-bubble {
  border-bottom-left-radius: 2px;
  border-left: 3px solid var(--primary-gc);
}

/* Chat Composer */
.chat-composer {
  padding: 1rem;
  background: rgba(18, 25, 41, 0.9);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
}

.input-field {
  flex: 1;
  background: rgba(10, 15, 26, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--primary-gc);
  box-shadow: 0 0 0 2px var(--primary-gc-glow);
}

.btn-primary {
  background: linear-gradient(135deg, #00ac47 0%, #008736 100%);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 172, 71, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 172, 71, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Endpoint Banner Box */
.endpoint-banner {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.endpoint-url-box {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  gap: 0.5rem;
}

.endpoint-text {
  font-family: monospace;
  font-size: 0.88rem;
  color: #a7f3d0;
  flex: 1;
  word-break: break-all;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-copy:hover {
  background: var(--primary-gc);
}

/* Step-by-Step Guide Accordion / Grid */
.guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.step-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: #ffffff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.step-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.step-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.step-code {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.8rem;
  color: #38bdf8;
  word-break: break-all;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 999;
}

.toast {
  background: rgba(18, 25, 41, 0.95);
  border: 1px solid var(--primary-gc);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideToast 0.3s ease;
}

@keyframes slideToast {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
