/* ==========================================================================
   MailPulse SaaS Enterprise - Main Design System & Premium UI Styling
   ========================================================================== */

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

:root {
  --primary-rgb: 79, 70, 229;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #06b6d4;
  --accent: #8b5cf6;
  --dark-bg: #0f172a;
  --dark-card: #1e293b;
  --dark-border: #334155;
  --light-bg: #f8fafc;
  --light-card: #ffffff;
  --light-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
  --shadow-md: 0 12px 30px -6px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 50px -12px rgba(15, 23, 42, 0.14);
  --shadow-glow: 0 0 35px rgba(79, 70, 229, 0.25);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* Glassmorphism Accents */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-md);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(51, 65, 85, 0.8);
  color: #ffffff;
}

/* Gradient Texts & Buttons */
.gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-gradient-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  border: none;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.35);
}

.btn-gradient-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
  color: #ffffff;
}

.btn-outline-dark-custom {
  border: 1.5px solid #334155;
  color: #0f172a;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
}

.btn-outline-dark-custom:hover {
  background: #0f172a;
  color: #ffffff;
  transform: translateY(-2px);
}

/* Feature & Growth Cards */
.feature-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  border: 1px solid var(--light-border);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 70, 229, 0.3);
}

.feature-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

/* Workflow Step Connector */
.step-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  border: 1px solid var(--light-border);
  position: relative;
  transition: all 0.3s ease;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.step-number {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: #ffffff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Integration Logos Pills */
.integration-pill {
  background: #ffffff;
  border: 1px solid var(--light-border);
  border-radius: 999px;
  padding: 12px 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: #1e293b;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.integration-pill:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

/* Testimonial Cards */
.testimonial-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--light-border);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.avatar-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

/* Statistics Counter */
.stat-counter-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 30px;
  border: 1px solid var(--light-border);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.stat-counter-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Pricing Popular Badge */
.pricing-popular {
  border: 2px solid var(--primary) !important;
  position: relative;
}

.popular-badge {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 16px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Dashboard Shell Layout */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ==========================================================================
   INDEPENDENT SIDEBAR & CONTENT SCROLLING LAYOUT ENGINE
   ========================================================================== */

/* Disable body window scrollbar for clean dashboard view */
body.dashboard-layout {
  height: 100vh;
  width: 100vw;
  overflow: hidden !important;
  margin: 0;
  padding: 0;
}

.app-wrapper {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* Sidebar Container (Fixed Height 100vh, Independent Scroll) */
.app-sidebar {
  width: 270px;
  min-width: 270px;
  height: 100vh;
  background: var(--dark-bg);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--dark-border);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s ease;
}

.app-sidebar .brand-header {
  flex-shrink: 0;
  height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--dark-border);
  background: var(--dark-bg);
}

.sidebar-search-box {
  flex-shrink: 0;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(15, 23, 42, 0.6);
}

.sidebar-search-box input {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--dark-border);
  color: #ffffff;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 32px;
}

.sidebar-search-box input::placeholder {
  color: #64748b;
}

.sidebar-search-box input:focus {
  background: rgba(30, 41, 59, 1);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  color: #ffffff;
}

/* Independent Sidebar Scroll Container */
.sidebar-scrollable-content {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-scrollable-content::-webkit-scrollbar {
  width: 5px;
}

.sidebar-scrollable-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu .menu-item {
  margin-bottom: 4px;
}

.sidebar-menu .menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.sidebar-menu .menu-item.active .menu-link,
.sidebar-menu .menu-link:hover {
  background: rgba(79, 70, 229, 0.18);
  color: #ffffff;
}

.sidebar-menu .menu-item.active .menu-link i {
  color: #818cf8;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--dark-border);
  background: rgba(15, 23, 42, 0.95);
}

/* Main Content Area (Fixed Height 100vh, Independent Scroll) */
.app-main {
  flex-grow: 1;
  margin-left: 270px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--light-bg);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fixed Header */
.app-header {
  flex-shrink: 0;
  height: 70px;
  background: #ffffff;
  border-bottom: 1px solid var(--light-border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 900;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

/* Independent Content Scroll Container */
.app-body-container {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.app-body-container::-webkit-scrollbar {
  width: 6px;
}

.app-body-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.app-footer {
  margin-top: auto;
  padding-top: 28px;
}

/* Responsive Mobile Drawer Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
}

@media (max-width: 991.98px) {
  body.dashboard-layout {
    overflow: auto !important;
  }
  .app-sidebar {
    transform: translateX(-270px);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
  .sidebar-overlay.show {
    display: block;
  }
}
