/* ============================================================
   Copilot Pin Preview – Stylesheet
   Authentic Microsoft Copilot design: warm beige, white cards,
   minimal & airy – exactly like copilot.microsoft.com
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Exact Copilot background: warm beige/linen */
  --bg-main:    #ECEAE3;
  --bg-card:    #FFFFFF;
  --bg-sidebar: #E4E2DB;

  /* Text */
  --text-primary:   #1A1A1A;
  --text-secondary: #555555;
  --text-muted:     #8A8A8A;

  /* Border */
  --border:       rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.16);

  /* Copilot gradient accent (logo colors only) */
  --grad-copilot: linear-gradient(135deg, #7C3AED, #2563EB, #06B6D4, #10B981);

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 100px;

  /* Shadows – very subtle, like real Copilot */
  --shadow-card: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.08);

  --transition: 0.2s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Page Layout ---- */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR (like the real Copilot left rail)
   ============================================================ */
.sidebar {
  width: 52px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 20px;
  gap: 6px;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  margin-bottom: 14px;
}

.sidebar-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.sidebar-icon:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
}
.sidebar-icon svg { width: 18px; height: 18px; }
.sidebar-icon.active {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 80px;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
}

.logo-wrap {
  margin-bottom: 24px;
}

.copilot-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.copilot-logo:hover {
  transform: scale(1.08);
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.06);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
}

.pin-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: pulse 2.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 10px;
}

.gradient-text {
  background: var(--grad-copilot);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.6;
}

/* ============================================================
   FEATURE BUTTONS – white cards like Copilot suggestion chips
   ============================================================ */
.features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-bottom: 40px;
}

.feature-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  color: var(--text-primary);
  text-align: left;
  transition:
    box-shadow var(--transition),
    border-color var(--transition),
    transform var(--transition);
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.4s ease both;
}

.feature-btn:nth-child(1) { animation-delay: 0.05s; }
.feature-btn:nth-child(2) { animation-delay: 0.12s; }
.feature-btn:nth-child(3) { animation-delay: 0.19s; }

.feature-btn:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.feature-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-card);
}

/* Icon container */
.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.feature-btn:hover .btn-icon { background: #E4E2DB; }
.btn-icon svg { width: 22px; height: 22px; }

/* Button text */
.btn-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.btn-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Arrow */
.btn-arrow {
  color: var(--text-muted);
  transition: transform var(--transition), color var(--transition);
}
.btn-arrow svg { width: 18px; height: 18px; }
.feature-btn:hover .btn-arrow {
  transform: translateX(3px);
  color: var(--text-secondary);
}

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.5s 0.3s ease both;
}

.cta-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: opacity var(--transition), transform var(--transition);
  letter-spacing: -0.01em;
}

.cta-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.cta-link:active { transform: translateY(0); opacity: 1; }

.cta-arrow { width: 16px; height: 16px; transition: transform var(--transition); }
.cta-link:hover .cta-arrow { transform: translateX(3px); }

/* ============================================================
   CHAT MODAL – clean white, Copilot-like
   ============================================================ */
.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  transition: background 0.25s ease;
}

.chat-overlay.visible {
  background: rgba(0, 0, 0, 0.25);
}

.chat-modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -4px 40px rgba(0,0,0,0.12);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@media (min-width: 600px) {
  .chat-overlay { align-items: center; padding: 24px; }
  .chat-modal {
    border-radius: var(--radius-xl);
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.25s ease;
    box-shadow: 0 8px 48px rgba(0,0,0,0.14);
  }
}

.chat-overlay.visible .chat-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.chat-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.status-dot {
  width: 6px; height: 6px;
  background: #22C55E;
  border-radius: 50%;
  animation: pulse 2.5s ease infinite;
}

.chat-close {
  width: 32px; height: 32px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.chat-close svg { width: 14px; height: 14px; }
.chat-close:hover { background: #E4E2DB; color: var(--text-primary); transform: rotate(90deg); }

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.1) transparent;
  background: var(--bg-main);
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

.message {
  display: flex;
  gap: 10px;
  animation: msgSlide 0.25s ease both;
}

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

.message-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.message-avatar img { width: 22px; height: 22px; object-fit: contain; }

.message-bubble {
  max-width: calc(100% - 46px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-card);
}

.message-bubble p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-primary);
}

.message-time {
  font-size: 0.66rem;
  color: var(--text-muted);
  align-self: flex-end;
}

/* User message */
.message-user { flex-direction: row-reverse; }

.message-user .message-bubble {
  background: var(--text-primary);
  border-color: transparent;
  border-radius: var(--radius-md) 4px var(--radius-md) var(--radius-md);
}

.message-user .message-bubble p { color: #fff; }
.message-user .message-time { color: rgba(255,255,255,0.55); }

.message-user .message-avatar {
  background: var(--text-primary);
  border-color: transparent;
}

.user-initial {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 0 16px 10px;
  flex-shrink: 0;
  background: var(--bg-main);
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-card);
}

.typing-dots span {
  width: 6px; height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.2s ease infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input Area */
.chat-input-area {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 10px 10px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-input-wrap:focus-within {
  border-color: rgba(0,0,0,0.2);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  scrollbar-width: none;
}
.chat-input::-webkit-scrollbar { display: none; }
.chat-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 34px; height: 34px;
  background: var(--text-primary);
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: opacity var(--transition), transform var(--transition);
  opacity: 0.3;
}
.send-btn svg { width: 16px; height: 16px; }
.send-btn:not(:disabled) { opacity: 1; }
.send-btn:not(:disabled):hover { transform: scale(1.06); opacity: 0.85; }
.send-btn:not(:disabled):active { transform: scale(0.94); }
.send-btn:disabled { cursor: default; }

.chat-disclaimer {
  font-size: 0.67rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hidden utility */
[hidden] { display: none !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 48px 16px 64px; }

  .copilot-logo { width: 50px; height: 50px; }
  .hero-title { font-size: 1.75rem; }
  .hero-subtitle { font-size: 0.9rem; }

  .feature-btn { padding: 15px 16px; gap: 12px; }
  .btn-icon { width: 38px; height: 38px; }
  .btn-title { font-size: 0.9rem; }
  .btn-desc { font-size: 0.76rem; }

  .cta-link { padding: 11px 20px; font-size: 0.88rem; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-input-area {
    padding-bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px));
  }
}
