/* ==========================================================================
   afCode Educational Clone - Components & Interactive Modals
   ========================================================================== */

/* ==========================================================================
   Modal Overlay & Backdrop
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Product Detail Drawer / Modal
   ========================================================================== */
.product-modal-dialog {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--trans-normal);
}

.modal-overlay.active .product-modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.modal-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header-title h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.modal-content-scrollable {
  padding: 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-banner {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0d0f18;
}

.modal-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-quick-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-pricing {
  display: flex;
  flex-direction: column;
}

.modal-price-val {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-pix-val {
  font-size: 13px;
  color: var(--emerald);
  font-weight: 600;
}

.modal-features-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-feature-item svg {
  color: var(--cyan);
  flex-shrink: 0;
  margin-top: 3px;
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ==========================================================================
   Checkout Pix Simulation Modal
   ========================================================================== */
.checkout-modal-dialog {
  width: 100%;
  max-width: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--trans-normal);
}

.modal-overlay.active .checkout-modal-dialog {
  transform: scale(1);
}

.checkout-header {
  padding: 24px 28px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 242, 254, 0.03);
}

.checkout-header h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.checkout-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.checkout-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.checkout-qr-box {
  width: 200px;
  height: 200px;
  background: #ffffff;
  padding: 12px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  position: relative;
}

.checkout-qr-svg {
  width: 100%;
  height: 100%;
}

.countdown-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.pix-copia-cola-wrapper {
  width: 100%;
}

.pix-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pix-input-group {
  display: flex;
  gap: 8px;
}

.pix-key-input {
  flex: 1;
  height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-copy-pix {
  padding: 0 16px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--cyan);
  color: #090a0f;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-copy-pix:hover {
  background: #38bdf8;
}

.checkout-steps-note {
  width: 100%;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.checkout-steps-note ol {
  padding-left: 18px;
  margin-top: 6px;
}

.btn-simulate-pay {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--grad-emerald);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
  transition: all var(--trans-fast);
}

.btn-simulate-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.55);
}

/* Success State after Payment */
.checkout-success-view {
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.success-check-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald);
  display: grid;
  place-items: center;
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.4);
  animation: bounceSuccess 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceSuccess {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.checkout-success-view h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.checkout-success-view p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 360px;
}

/* ==========================================================================
   General Standard Modals (Login, Guia, Termos, Privacidade)
   ========================================================================== */
.standard-modal-dialog {
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--trans-normal);
}

.modal-overlay.active .standard-modal-dialog {
  transform: scale(1);
}

.standard-modal-body {
  padding: 28px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.standard-modal-body h4 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 20px;
  margin-bottom: 8px;
}

.standard-modal-body h4:first-child {
  margin-top: 0;
}

.standard-modal-body p {
  margin-bottom: 14px;
}

.standard-modal-body ul, .standard-modal-body ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color var(--trans-fast);
}

.form-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

/* ==========================================================================
   Central de Automações & Webhooks Interactive Section
   ========================================================================== */
.automations-section {
  padding: 90px 0;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(0, 242, 254, 0.03) 0%, transparent 100%);
}

.automations-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: start;
  margin-top: 36px;
}

.automation-console-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.console-actions-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn-trigger-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--trans-fast);
}

.btn-trigger-action:hover {
  background: var(--cyan);
  color: #090a0f;
  transform: translateY(-2px);
}

.btn-trigger-action.btn-approval {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--emerald);
}

.btn-trigger-action.btn-approval:hover {
  background: var(--emerald);
  color: #ffffff;
}

.terminal-window {
  background: #06070a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.terminal-logs {
  height: 220px;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
}

.log-line { margin-bottom: 6px; }
.log-time { color: var(--text-muted); }
.log-info { color: #38bdf8; }
.log-warn { color: var(--gold); }
.log-success { color: var(--emerald); }

/* Simulated Smartphone Screen */
.phone-mockup-wrapper {
  display: flex;
  justify-content: center;
}

.phone-mockup {
  width: 300px;
  height: 520px;
  background: #0b141a;
  border: 8px solid #2a2f32;
  border-radius: 36px;
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.phone-top-notch {
  width: 120px;
  height: 16px;
  background: #2a2f32;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  margin: 0 auto;
}

.phone-wa-header {
  padding: 12px 16px;
  background: #202c33;
  color: #e9edef;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.phone-wa-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #090a0f;
}

.phone-wa-title h5 {
  font-size: 13px;
  font-weight: 600;
}

.phone-wa-title span {
  font-size: 10px;
  color: var(--emerald);
}

.phone-wa-body {
  flex: 1;
  padding: 16px;
  background: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 16px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sim-wa-message {
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #e9edef;
  position: relative;
}

.sim-wa-message.incoming {
  background: #202c33;
  align-self: flex-start;
  border-top-left-radius: 0;
}

.sim-wa-message .sender-name {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 4px;
}

.wa-pix-box {
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 8px;
  border-radius: 4px;
  margin: 6px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  word-break: break-all;
  color: var(--gold);
}

.wa-time {
  display: block;
  font-size: 9px;
  color: #8696a0;
  text-align: right;
  margin-top: 4px;
}

/* ==========================================================================
   Interactive AI Agent Chat Section & Widget
   ========================================================================== */
.agents-section {
  padding: 80px 0;
  border-top: 1px solid var(--border-subtle);
}

.agent-interactive-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 36px;
  min-height: 500px;
}

.agent-sidebar {
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid var(--border-subtle);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-sidebar h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.agent-persona-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  transition: all var(--trans-fast);
}

.agent-persona-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.agent-persona-btn.active {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.3);
}

.agent-persona-avatar {
  font-size: 22px;
}

.agent-persona-info h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.agent-persona-info p {
  font-size: 11px;
  color: var(--text-muted);
}

.agent-chat-main {
  display: flex;
  flex-direction: column;
  height: 520px;
}

.agent-chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.01);
}

.agent-chat-header .agent-avatar {
  font-size: 24px;
}

.agent-chat-header h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.agent-chat-header p {
  font-size: 11px;
  color: var(--text-muted);
}

.agent-chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-bubble {
  display: flex;
  gap: 10px;
  max-width: 80%;
}

.chat-bubble.agent-bubble {
  align-self: flex-start;
}

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

.bubble-avatar {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.bubble-content {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.6;
}

.agent-bubble .bubble-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.user-bubble .bubble-content {
  background: var(--grad-primary);
  color: #090a0f;
  font-weight: 500;
}

.quick-prompts-bar {
  padding: 10px 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.01);
}

.quick-prompt-pill {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.quick-prompt-pill:hover {
  color: var(--cyan);
  border-color: rgba(0, 242, 254, 0.4);
}

.agent-chat-input-row {
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
}

.agent-chat-input {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
}

.agent-chat-input:focus {
  border-color: var(--cyan);
}

.agent-send-btn {
  padding: 0 20px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--cyan);
  color: #090a0f;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-send-btn:hover {
  background: #38bdf8;
}

/* ==========================================================================
   Load More Button
   ========================================================================== */
.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.btn-load-more {
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--trans-fast);
}

.btn-load-more:hover {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--trans-normal);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}

.toast.toast-success svg {
  color: var(--emerald);
}

.toast.toast-info svg {
  color: var(--cyan);
}

/* ==========================================================================
   Floating WhatsApp Button
   ========================================================================== */
.floating-whatsapp {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  background: #25d366;
  color: #090a0f;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

.floating-whatsapp:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
}

/* ==========================================================================
   Mobile Nav Drawer
   ========================================================================== */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  z-index: 1050;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: right var(--trans-normal);
  box-shadow: var(--shadow-lg);
}

.mobile-nav-drawer.open {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav-links a {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}

.mobile-nav-links a:hover {
  color: var(--cyan);
}

@media (max-width: 1024px) {
  .automations-grid {
    grid-template-columns: 1fr;
  }
  .agent-interactive-container {
    grid-template-columns: 1fr;
  }
  .agent-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
}
