/* Base & Reset */
:root {
  --bg-color: #FFFFFF;
  --text-primary: #1D1D1F;
  --text-secondary: #86868B;
  --accent-color: #0066CC;
  --border-color: rgba(0, 0, 0, 0.08);
  --surface-color: #F5F5F7;
  --wa-bg: #EFEAE2;
  --wa-message-out: #E7FFDB;
  --wa-message-in: #FFFFFF;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
  --shadow-glass: 0 8px 32px rgba(0,0,0,0.1);
  --transition-fast: 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-smooth: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-outline {
  color: var(--text-primary);
  background: var(--surface-color);
}
.btn-outline:hover {
  background: #e8e8ed;
}

/* Hero Section */
.hero {
  padding: 160px 24px 80px;
  text-align: center;
}
.hero-content {
  max-width: 800px;
  margin: 0 auto;
}
.hero-title {
  font-size: clamp(48px, 8vw, 72px);
  line-height: 1.05;
  margin-bottom: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.hero-subtitle {
  font-size: clamp(18px, 3vw, 24px);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Showcase Section */
.showcase {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 120px;
}

/* Segmented Control */
.toggle-container {
  display: flex;
  justify-content: center;
  margin-bottom: 60px;
}

.segmented-control {
  position: relative;
  display: flex;
  background: var(--surface-color);
  border-radius: 999px;
  padding: 4px;
  width: 320px; /* Fixed width for equal segments */
}

.segmented-control input[type="radio"] {
  display: none;
}

.segment-label {
  position: relative;
  z-index: 2;
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.segmented-control input[type="radio"]:checked + .segment-label {
  color: var(--text-primary);
}

.segment-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: #FFF;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform var(--transition-smooth);
  z-index: 1;
}

#tab-business:checked ~ .segment-indicator {
  transform: translateX(100%);
}

/* Showcase Grid */
.showcase-grid {
  display: grid;
  grid-template-columns: 4fr 5fr;
  gap: 60px;
  align-items: center;
}

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

/* Flows Sidebar */
.flows-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.flow-item {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: left;
}

.flow-item:hover {
  background: var(--surface-color);
}

.flow-item.active {
  background: #FFF;
  border-color: var(--border-color);
  box-shadow: var(--shadow-md);
}

.flow-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.flow-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
}
.flow-item.active .flow-icon {
  background: var(--accent-color);
  color: #FFF;
}

.flow-title {
  font-size: 18px;
  font-weight: 600;
}

.flow-desc {
  color: var(--text-secondary);
  font-size: 15px;
  margin-left: 52px;
}

/* iPhone Mockup */
.phone-container {
  display: flex;
  justify-content: center;
}

.iphone-mockup {
  width: 380px;
  height: 750px;
  background: var(--wa-bg);
  border-radius: 44px;
  box-shadow: 0 0 0 12px #1D1D1F, 0 20px 40px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 30px;
  background: #1D1D1F;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 10;
}

/* WhatsApp Header */
.whatsapp-header {
  background: rgba(246, 246, 246, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 40px 16px 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 5;
}

.wa-back {
  color: #007AFF;
  margin-right: 8px;
}

.wa-profile-pic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-weight: bold;
  font-size: 12px;
  margin-right: 12px;
}

.wa-contact-info {
  flex: 1;
}

.wa-name {
  font-size: 15px;
  font-weight: 600;
}

.wa-status {
  font-size: 12px;
  color: var(--text-secondary);
}

.wa-actions {
  display: flex;
  gap: 16px;
  color: #007AFF;
}

/* WhatsApp Chat Area */
.whatsapp-chat {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* pattern background */
  background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="%23EFEAE2"/><circle cx="50" cy="50" r="2" fill="rgba(0,0,0,0.02)"/></svg>');
}
.whatsapp-chat::-webkit-scrollbar {
  display: none;
}

/* Message Bubbles */
.msg-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 15px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  animation: fadeIn 0.3s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

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

.msg-in {
  align-self: flex-start;
  background: var(--wa-message-in);
  border-top-left-radius: 4px;
}

.msg-out {
  align-self: flex-end;
  background: var(--wa-message-out);
  border-top-right-radius: 4px;
}

.msg-time {
  font-size: 10px;
  color: rgba(0,0,0,0.4);
  float: right;
  margin: 8px 0 0 8px;
}

.msg-interactive-list {
  margin-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 8px;
}

.msg-list-item {
  color: #007AFF;
  font-weight: 500;
  padding: 8px 0;
  text-align: center;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.msg-list-item:last-child {
  border-bottom: none;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

.typing-in {
  background: var(--wa-message-in);
  border-top-left-radius: 4px;
  align-self: flex-start;
}

.typing-out {
  background: var(--wa-message-out);
  border-top-right-radius: 4px;
  align-self: flex-end;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* WhatsApp Input */
.whatsapp-input {
  background: #F6F6F6;
  padding: 12px 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-icon {
  color: #007AFF;
}
.wa-icon-mic {
  color: #007AFF;
  margin-left: 4px;
}

.wa-input-box {
  flex: 1;
  background: #FFF;
  border-radius: 20px;
  padding: 8px 16px;
  border: 1px solid rgba(0,0,0,0.1);
  color: rgba(0,0,0,0.3);
  font-size: 15px;
}

/* Dashboard Preview */
.dashboard-preview {
  padding: 80px 24px;
  background: #FAFAFC;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 60px;
}
.dashboard-header h2 {
  font-size: 40px;
  margin-bottom: 16px;
}
.dashboard-header p {
  font-size: 20px;
  color: var(--text-secondary);
}

.dashboard-window {
  max-width: 1000px;
  margin: 0 auto;
  background: #FFF;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.mac-header {
  background: #F5F5F7;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.mac-dots {
  display: flex;
  gap: 8px;
}
.mac-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.mac-dots span:nth-child(1) { background: #FF5F56; }
.mac-dots span:nth-child(2) { background: #FFBD2E; }
.mac-dots span:nth-child(3) { background: #27C93F; }

.dashboard-layout {
  display: flex;
  height: 500px;
}

.dash-sidebar {
  width: 220px;
  background: #FAFAFC;
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
}

.dash-logo {
  font-weight: 700;
  margin-bottom: 32px;
  padding-left: 12px;
}

.dash-nav {
  list-style: none;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 4px;
  transition: var(--transition-fast);
}

.dash-nav-item.active {
  background: var(--surface-color);
  color: var(--text-primary);
  font-weight: 500;
}

.dash-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

.dash-search {
  background: var(--surface-color);
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  width: 200px;
}
.dash-profile {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-color);
}

.dash-main-area {
  padding: 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dash-title-skeleton {
  font-size: 24px;
  font-weight: 600;
  transition: opacity 0.3s;
}

.dash-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.skeleton-card {
  height: 100px;
  background: var(--surface-color);
  border-radius: 12px;
  animation: pulse 2s infinite ease-in-out;
}

.skeleton-chart {
  flex: 1;
  background: var(--surface-color);
  border-radius: 12px;
  animation: pulse 2s infinite ease-in-out;
  animation-delay: 0.5s;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-left: 24px;
}
.footer-links a:hover {
  color: var(--text-primary);
}
