/* ==================================================
   Clean, Light-Mode & High-Conversion Stylesheet
   ================================================== */

:root {
  /* Brand colors */
  --color-primary: #2563eb;       /* Royal Blue (Trust & Tech) */
  --color-primary-dark: #1d4ed8;  /* Deep Royal Blue */
  --color-success: #10b981;      /* Emerald Green (Conversion/Success) */
  --color-success-dark: #059669; /* Deep Emerald */
  --color-warning: #f59e0b;      /* Amber Yellow */
  --color-danger: #ef4444;       /* Coral Red */
  
  /* Neutral scale */
  --bg-main: #f8fafc;            /* Soft light grey-blue */
  --bg-card: #ffffff;            /* Pure white */
  --bg-input: #ffffff;
  --bg-chat-header: #eaeef3;
  --bg-chat-body: #efeae2;       /* Classic WhatsApp chat backdrop */
  --color-text-title: #0f172a;   /* Slate 900 */
  --color-text-body: #334155;    /* Slate 700 */
  --color-text-muted: #64748b;   /* Slate 500 */
  --border-color: #e2e8f0;       /* Slate 200 */
  --border-focus: #93c5fd;       /* Soft Blue */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
  --shadow-premium: 0 20px 40px -15px rgba(37, 99, 235, 0.07);
}

/* Global Resets & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--color-text-body);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--color-text-title);
  font-weight: 600;
  line-height: 1.25;
}

/* Helper Class: Hide elements */
.hidden {
  display: none !important;
}

/* Button UI Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  text-decoration: none;
  gap: 8px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.btn-success {
  background-color: var(--color-success);
  color: #ffffff;
}

.btn-success:hover {
  background-color: var(--color-success-dark);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--color-text-body);
}

.btn-secondary:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: var(--color-danger);
}

.btn-block {
  width: 100%;
}

/* Form inputs */
.control-group {
  margin-bottom: 16px;
}

.control-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.control-group input,
.control-group select,
.control-group textarea {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--color-text-title);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.control-group input:focus,
.control-group select:focus,
.control-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==================================================
   VIEW 1: LANDING PAGE VIEW
   ================================================== */

.landing-nav {
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  padding: 16px 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo-icon {
  background: linear-gradient(135deg, var(--color-primary) 0%, #a855f7 100%);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.brand-logo h1 {
  font-size: 20px;
  letter-spacing: -0.5px;
}

.brand-logo h1 span {
  color: var(--color-primary);
}

/* Hero Section */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.03), transparent 40%);
}

.hero h2 {
  font-size: 44px;
  max-width: 800px;
  margin: 0 auto 20px;
  letter-spacing: -1px;
}

.hero p {
  font-size: 18px;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 40px 0 80px;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.15);
}

.feature-icon {
  background-color: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  font-size: 18px;
}

.feature-card p {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Pricing Grid */
.pricing-section {
  padding: 40px 0 80px;
  background-color: #f1f5f9;
}

.pricing-title {
  text-align: center;
  margin-bottom: 50px;
}

.pricing-title h2 {
  font-size: 32px;
  margin-bottom: 10px;
}

.pricing-title p {
  color: var(--color-text-muted);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.pricing-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px 30px;
  box-shadow: var(--shadow-md);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.pricing-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.pricing-card.popular {
  border: 2px solid var(--color-primary);
  box-shadow: var(--shadow-premium);
}

.popular-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pricing-header h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.price-container {
  display: flex;
  align-items: baseline;
  margin: 20px 0;
}

.price-currency {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-title);
}

.price-amount {
  font-size: 42px;
  font-weight: 700;
  color: var(--color-text-title);
  font-family: 'Outfit', sans-serif;
  margin: 0 4px;
}

.price-period {
  font-size: 14px;
  color: var(--color-text-muted);
}

.pricing-features {
  list-style: none;
  margin: 30px 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-features li {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li svg {
  color: var(--color-success);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pricing-card .btn {
  margin-top: 30px;
}

/* ==================================================
   VIEW 2: CHECKOUT VIEW
   ================================================== */

.checkout-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 30px;
  margin: 40px auto;
  max-width: 1000px;
}

.checkout-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow-md);
}

.checkout-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.checkout-header h2 {
  font-size: 22px;
}

.checkout-header p {
  font-size: 14px;
  color: var(--color-text-muted);
}

.order-summary-card {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  align-self: start;
}

.order-item {
  display: flex;
  justify-content: space-between;
  margin: 16px 0;
  font-size: 14px;
}

.order-total {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-title);
}

/* Credit Card Input Layout */
.card-input-wrapper {
  position: relative;
}

.card-brand-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
}

/* ==================================================
   VIEW 3: LOGIN VIEW
   ================================================== */

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.login-card h2 {
  font-size: 22px;
  text-align: center;
  margin-bottom: 8px;
}

.login-card p {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* ==================================================
   VIEW 4: SUBSCRIBER DASHBOARD VIEW
   ================================================== */

.dashboard-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  background-color: #f1f5f9;
  overflow: hidden;
}

/* Sidebar Dashboard */
.db-sidebar {
  width: 260px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.db-logo {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.db-profile {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: #fafbfc;
}

.db-profile-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-profile-email {
  font-size: 11.5px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.db-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 8px;
  color: var(--color-text-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s ease;
}

.db-nav-item svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.db-nav-item:hover {
  background-color: #f1f5f9;
  color: var(--color-text-title);
}

.db-nav-item:hover svg {
  color: var(--color-primary);
}

.db-nav-item.active {
  background-color: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
  font-weight: 600;
}

.db-nav-item.active svg {
  color: var(--color-primary);
}

.db-logout {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* Main Content Dashboard */
.db-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
}

.db-header {
  height: 70px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.db-header-title h2 {
  font-size: 20px;
  font-family: 'Outfit', sans-serif;
}

.db-badge-plan {
  background-color: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
}

/* Dashboard Tab Panels */
.db-panel {
  display: none;
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.db-panel.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Dashboard Grid Overview */
.db-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.db-stat-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.db-stat-icon {
  background-color: rgba(37, 99, 235, 0.06);
  color: var(--color-primary);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.db-stat-info h4 {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.db-stat-info p {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-title);
  margin-top: 2px;
}

/* Dashboard Panels Layout Columns */
.db-columns-layout {
  display: grid;
  grid-template-columns: 4fr 3fr;
  gap: 24px;
}

.db-card-panel {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.db-card-panel h3 {
  font-size: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 4px;
}

/* Policy File Uploader Area */
.drag-drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background-color: #fafbfc;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 13.5px;
}

.drag-drop-zone:hover {
  background-color: rgba(37, 99, 235, 0.02);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.drag-drop-zone svg {
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
}

.drag-drop-zone:hover svg {
  color: var(--color-primary);
}

/* Real-Time Database Tree list styling */
.db-clients-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 450px;
  padding-right: 4px;
}

.db-client-item {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.db-client-item:hover {
  border-color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.02);
  transform: translateX(2px);
}

.db-client-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.db-client-item-header strong {
  font-size: 14px;
  color: var(--color-text-title);
}

.db-client-badge {
  font-size: 10px;
  background-color: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--color-text-body);
}

.db-client-item p {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ==================================================
   WHATSAPP WEB CHAT SIMULATOR (LIGHT MODE)
   ================================================== */

.sim-chat-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 520px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-color: #ffffff;
}

/* Chat side list */
.sim-chat-sidebar {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0; /* Prevents container from growing inside CSS Grid */
}

.sim-chat-sidebar-header {
  padding: 14px;
  background-color: #f0f2f5;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-title);
}

.sim-chat-sidebar-search {
  padding: 10px;
  background-color: #fff;
  border-bottom: 1px solid var(--border-color);
}

.sim-chat-sidebar-search input {
  padding: 6px 12px;
  background-color: #f0f2f5;
  border: none;
  font-size: 12.5px;
}

.sim-chat-contacts {
  flex: 1;
  overflow-y: auto;
}

.sim-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f2f5;
  transition: all 0.2s ease;
}

.sim-contact-item:hover {
  background-color: #f5f6f6;
}

.sim-contact-item.active {
  background-color: #eaebeb;
}

.sim-contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.sim-contact-info {
  flex: 1;
  overflow: hidden;
}

.sim-contact-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-contact-phone {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Chat Main window */
.sim-chat-window {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg-chat-body);
  min-height: 0; /* Prevents container from growing inside CSS Grid */
}

.sim-chat-header {
  height: 54px;
  background-color: #f0f2f5;
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sim-chat-header-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-title);
}

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

.sim-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-msg-row {
  display: flex;
  width: 100%;
}

.sim-msg-row.sent {
  justify-content: flex-end;
}

.sim-msg-row.received {
  justify-content: flex-start;
}

.sim-msg-bubble {
  max-width: 65%;
  padding: 8px 12px 6px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
  position: relative;
}

.sim-msg-row.sent .sim-msg-bubble {
  background-color: #d9fdd3; /* Classic WhatsApp User Bubble */
  color: #111b21;
  border-top-right-radius: 0;
}

.sim-msg-row.received .sim-msg-bubble {
  background-color: #ffffff; /* Classic WhatsApp Bot Bubble */
  color: #111b21;
  border-top-left-radius: 0;
}

.sim-msg-time {
  font-size: 9px;
  color: #667781;
  text-align: right;
  margin-top: 4px;
  display: block;
}

.sim-chat-footer {
  padding: 10px;
  background-color: #f0f2f5;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-chat-footer input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  font-size: 13.5px;
  outline: none;
  background-color: #ffffff;
}

.sim-chat-footer button {
  background: none;
  border: none;
  color: #54656f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sim-chat-footer button svg {
  width: 22px;
  height: 22px;
}

/* Custom Voice Message styles */
.sim-voice-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.sim-voice-play-btn {
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sim-voice-play-btn svg {
  width: 12px;
  height: 12px;
}

/* System notice bubble */
.sim-msg-system {
  display: flex;
  justify-content: center;
  width: 100%;
}

.sim-msg-system span {
  background-color: #ffe0b2;
  color: #e65100;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
}

/* General Layout helpers */
.db-badge-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.db-badge-active {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.db-badge-pending {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.db-badge-inactive {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

/* Global conditions cards list */
.db-conditions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.db-condition-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  background-color: #fafbfc;
  transition: all 0.2s ease;
}

.db-condition-card:hover {
  border-color: var(--color-primary);
  background-color: #ffffff;
}

.db-condition-card-header {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--color-text-title);
  margin-bottom: 6px;
}

.db-condition-card-body {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Simple visual mock JSON uploader preview */
.upload-preview-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: #fafbfc;
  padding: 12px;
  font-family: monospace;
  font-size: 11px;
  overflow: auto;
  max-height: 200px;
  color: var(--color-success-dark);
}

/* Premium File Uploader Styles */
.file-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-upload-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background-color: #f8fafc;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 48px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--color-primary);
  transition: all 0.2s ease;
  text-align: center;
  width: 100%;
}

.file-upload-input:hover {
  background-color: rgba(37, 99, 235, 0.04);
  border-color: var(--color-primary);
}

.file-upload-input svg {
  width: 44px;
  height: 44px;
  color: var(--color-primary);
}

.upload-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-title);
}

.upload-subtitle {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.file-name-preview {
  font-size: 12px;
  color: var(--color-success-dark);
  background-color: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 4px;
}

.file-upload-input.drag-over {
  background-color: rgba(37, 99, 235, 0.08) !important;
  border-color: var(--color-primary) !important;
  border-style: dashed !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Spinner animado para carregamento da IA */
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spinner-spin 0.8s linear infinite;
}

@keyframes spinner-spin {
  to { transform: rotate(360deg); }
}

/* ==================================================
   Stitch UI - Glassmorphic Modal & Toggle Styles
   ================================================== */

/* Glassmorphism Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4); /* Slate 900 translucent */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background-color: var(--bg-card);
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

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

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  background-color: #f1f5f9;
  color: var(--color-text-title);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background-color: #f8fafc;
}

/* Card Pointer Indicator and Hover */
.db-client-item {
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.db-client-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  border-color: var(--color-primary);
}

/* iOS-Style Toggle Switch CSS */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background-color: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.switch-label-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-title);
}

.switch-desc {
  font-size: 11px;
  color: var(--color-text-muted);
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-danger); /* Red by default (inactive) */
  transition: .3s;
  border-radius: 34px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

input:checked + .slider-round {
  background-color: var(--color-success); /* Green when active */
}

input:checked + .slider-round:before {
  transform: translateX(24px);
}

/* Quick Toggle Button styling on the card list */
.btn-toggle-quick {
  background: none;
  border: 1px solid transparent;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-toggle-quick.active {
  background-color: rgba(16, 185, 129, 0.08);
  color: var(--color-success-dark);
  border-color: rgba(16, 185, 129, 0.2);
}

.btn-toggle-quick.inactive {
  background-color: rgba(239, 68, 68, 0.08);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-toggle-quick:hover {
  filter: brightness(0.95);
}

/* Tactile scale on click for buttons */
.btn:active, .btn-toggle-quick:active, .modal-close:active {
  transform: scale(0.96);
}



