/* WAGateway - Modern WhatsApp Green Theme */
:root {
  --wa-green: #25D366;
  --wa-green-dark: #128C7E;
  --wa-green-light: #DCF8C6;
  --wa-teal: #075E54;
  --wa-bg: #F0F2F5;
  --wa-chat-bg: #E5DDD5;
  --wa-text: #111B21;
  --wa-text-secondary: #667781;
  --wa-border: #E9EDEF;
  --wa-hover: #F5F6F6;
  --wa-unread: #25D366;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-full: 9999px;
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }

body {
  background: var(--wa-bg);
  color: var(--wa-text);
  overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

.animate-fadeIn { animation: fadeIn 0.5s ease-out; }
.animate-slideLeft { animation: slideInLeft 0.5s ease-out; }
.animate-slideRight { animation: slideInRight 0.5s ease-out; }
.animate-scaleIn { animation: scaleIn 0.3s ease-out; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Glassmorphism */
.glass {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
}

/* Modern Card */
.card-modern {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--wa-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-modern:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* WhatsApp Green Gradient */
.bg-wa-gradient {
  background: linear-gradient(135deg, var(--wa-green) 0%, var(--wa-green-dark) 100%);
}
.bg-wa-gradient-light {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

/* Buttons */
.btn-wa {
  background: var(--wa-green);
  color: white;
  border-radius: var(--radius-full);
  padding: 10px 24px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-wa:hover {
  background: var(--wa-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}
.btn-wa:active { transform: translateY(0); }

.btn-wa-outline {
  border: 2px solid var(--wa-green);
  color: var(--wa-green);
  background: transparent;
  border-radius: var(--radius-full);
  padding: 8px 22px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-wa-outline:hover {
  background: var(--wa-green);
  color: white;
}

/* Input Modern */
.input-modern {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--wa-border);
  border-radius: var(--radius);
  background: white;
  transition: all 0.2s;
  font-size: 14px;
}
.input-modern:focus {
  outline: none;
  border-color: var(--wa-green);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

/* Chat Bubbles */
.bubble-in {
  background: white;
  border-radius: 12px 12px 12px 0;
  box-shadow: var(--shadow-sm);
  max-width: 65%;
  position: relative;
}
.bubble-out {
  background: var(--wa-green-light);
  border-radius: 12px 12px 0 12px;
  box-shadow: var(--shadow-sm);
  max-width: 65%;
  position: relative;
}

/* Sidebar */
.sidebar {
  background: white;
  border-right: 1px solid var(--wa-border);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D7DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #B0BEC5; }

/* Loading Shimmer */
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--wa-text);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  animation: slideInRight 0.3s ease-out;
  max-width: 400px;
}
.toast.success { background: var(--wa-green-dark); }
.toast.error { background: #F44336; }

/* Pricing Card */
.pricing-card {
  background: white;
  border-radius: 20px;
  padding: 32px;
  border: 2px solid var(--wa-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--wa-green);
}
.pricing-card.popular {
  border-color: var(--wa-green);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.15);
  transform: scale(1.02);
}
.pricing-card.popular::before {
  content: 'POPULAR';
  position: absolute;
  top: 16px;
  right: -32px;
  background: var(--wa-green);
  color: white;
  padding: 4px 40px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  transform: rotate(45deg);
}

/* Device Status */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.status-connected { background: var(--wa-green); box-shadow: 0 0 0 3px rgba(37,211,102,0.2); }
.status-qr { background: #FFC107; box-shadow: 0 0 0 3px rgba(255,193,7,0.2); }
.status-disconnected { background: #F44336; box-shadow: 0 0 0 3px rgba(244,67,54,0.2); }

/* QR Container */
.qr-container {
  background: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  display: inline-block;
}

/* Inbox Layout */
.inbox-container {
  height: calc(100vh - 64px);
  display: flex;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.inbox-sidebar {
  width: 380px;
  border-right: 1px solid var(--wa-border);
  display: flex;
  flex-direction: column;
  background: white;
}
.inbox-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--wa-chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Responsive */
@media (max-width: 768px) {
  .inbox-sidebar { width: 100%; position: absolute; z-index: 10; height: 100%; transform: translateX(-100%); }
  .inbox-sidebar.active { transform: translateX(0); }
  .pricing-card.popular { transform: none; }
}

/* Skeleton */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }

/* Custom Checkbox */
.check-wa { accent-color: var(--wa-green); }

/* Badge */
.badge-wa { background: var(--wa-green); color: white; border-radius: var(--radius-full); padding: 2px 8px; font-size: 11px; font-weight: 600; }

/* Copy Button */
.copy-btn { transition: all 0.2s; }
.copy-btn:active { transform: scale(0.95); }
.copy-btn.copied { background: var(--wa-green) !important; color: white !important; }
