* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #667eea;
  --primary-dark: #5568d3;
  --secondary-color: #764ba2;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-light: #718096;
  --bg-light: #f7fafc;
  --bg-white: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  /* background: var(--bg-light); */
  background: #f5f7fa;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== NAVBAR ===== */
.navbar {
  width: 100%;
  padding: 1.25rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.logo {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.logo-img {
  height: 60px;
  width: 60px;
  border-radius: 50%;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

i {
  color: var(--text-secondary);
}
.nav-links li a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 0;
}

.nav-links li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}

.nav-links li a:hover {
  color: var(--primary-color);
}

.nav-links li a:hover::after {
  width: 100%;
}

.nav-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-buttons .btn {
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-xl);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-signin {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-signin:hover {
  background: var(--primary-gradient);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-started {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-started:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hamburger {
  display: none;
  font-size: 1.75rem;
  cursor: pointer;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 468px) {
  .nav-buttons {
    display: none !important;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .nav-links.nav-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    position: absolute;
    top: 80px;
    right: 1rem;
    left: 1rem;
    border-radius: var(--radius-lg);
    padding: 1rem;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
  }

  .nav-links li {
    margin: 0;
    width: 100%;
  }

  .nav-links li a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    background: var(--bg-light);
  }

  .nav-links li a:hover {
    background: var(--primary-gradient);
    color: white;
  }

  .nav-links li a::after {
    display: none;
  }
}

/* ===== HERO SECTION ===== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 160px 2rem 100px;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  letter-spacing: -1.5px;
  color: var(--text-primary);
}

.hero h1 span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  max-width: 650px;
  margin: 0 auto 2.5rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero .btn {
  background: var(--primary-gradient);
  color: white;
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--shadow-md);
}

.hero .btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.hero-img {
  max-width: 550px;
  margin-top: 4rem;
  width: 100%;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

.hero-img:hover {
  transform: rotate(0deg) translateY(-8px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* ===== HERO CONTAINER ===== */
.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5rem;
  padding: 3rem 2rem;
  margin-top: 5rem;
  flex-wrap: wrap;
}

.info-content {
  flex: 1;
  min-width: 300px;
  text-align: left;
}

.info-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: left;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.info-content ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.info-content ul li {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  color: var(--text-secondary);
  padding-left: 2rem;
  position: relative;
}

.info-content ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.25rem;
}

/* ===== HEADINGS ===== */
h2 {
  margin-top: 3rem;
  font-size: 2.25rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.heading3 {
  margin-top: 3rem;
  line-height: 2.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.audience_heading {
  text-align: left;
  margin-top: 6rem;
}

/* ===== HEADER ===== */
.header {
  background: white;
  color: var(--text-primary);
  padding: 1.25rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border-color);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-primary);
  cursor: pointer;
}

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

.header-text {
  font-weight: 600;
  color: var(--text-primary);
}

.taskbar-icon {
  border-radius: 50% !important;
  box-shadow: var(--shadow-sm);
}

/* ===== CONTAINER ===== */
.container {
  max-width: 100%;
  margin: 10rem 2rem;
  padding: 2rem;
}

/* ===== UPLOAD SECTION ===== */
.upload-section {
  margin-bottom: 3rem;
}

.upload-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.upload-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.upload-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4rem;
}

.info_download {
  flex: 1;
  max-width: 50%;
  text-align: left;
  margin-top: 4rem;
}

.upload-description {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.download-area {
  flex-shrink: 0;
}

.sample-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  margin-top: 2rem;
  box-shadow: var(--shadow-md);
}

.sample-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.batchactionbuttons {
  display: flex;
  gap: 1.5rem;
  margin-left: 0;
  flex-wrap: wrap;
}

.upload-box {
  background: white;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  width: 100%;
  max-width: 450px;
  margin: 2rem auto 0;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.upload-box:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.upload-box.dragover {
  border-color: var(--primary-color);
  background: #f0f4ff;
  box-shadow: var(--shadow-md);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1.25rem;
  color: var(--primary-color);
}

.upload-main-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.upload-sub-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.choose-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: var(--primary-gradient);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.choose-file-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.file-size-info {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 1.25rem;
}

.hidden-input {
  display: none;
}

/* ===== TEMPLATES ===== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  align-items: stretch;
}

.template {
  position: relative;
  width: 100%;
  /* min-height: 630px; */
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  padding: 2rem;
  transition: var(--transition);
}

.template:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.template-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-y: auto;
  background: white;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  height: 460px;
  display: flex;
  flex-direction: column;
}

.template-card:hover {
  border-color: #10b981;
  box-shadow: var(--shadow-md);
}

.template-card:hover .template-hover-name {
  opacity: 1;
}

.template-card.selected {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: var(--shadow-md);
}

.template-content {
  flex: 1;
  overflow-y: auto;
}

.template-content.collapsed {
  max-height: 300px;
  overflow: hidden;
}

.template-hover-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  color: var(--text-primary);
  text-align: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
  border-top: 1px solid var(--border-color);
}

.letter-container {
  flex: 1;
  /* padding: 1.5rem; */
  margin-bottom: 4rem;
  /* margin-top: 2rem; */
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: white;
  border-radius: var(--radius-sm);
}

.signature {
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  font-size: 28pt;
  font-family: "Vladimir Script", cursive;
}

.contact-info {
  font-size: 12pt;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.contact-info a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.contact-info a:hover {
  text-decoration: underline;
}

.footer-note {
  margin-top: 1.5rem;
  font-size: 12pt;
  font-style: italic;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.5;
}

.template-options {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 5rem;
}

.template-link {
  color: #9168d3;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}

.template-link:hover {
  color: #9168d3;
  background: #f0f4ff;
  transform: translateY(-2px);
}

/* ===== BUTTONS ===== */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  margin: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  display: inline-block;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.create-campaign-btn {
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--primary-gradient);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  box-shadow: var(--shadow-sm);
}

.create-campaign-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.button-actions {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.order-design-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.order-design-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.edit-btn {
  background: #10b981;
  color: white;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.edit-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.campaign-btn {
  background: var(--primary-gradient);
  color: white;
  padding: 0.875rem 1.75rem;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.campaign-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.send-btn {
  display: block;
  width: 100%;
  background: var(--text-primary);
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  padding: 1.125rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: 2rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.send-btn:hover {
  background: #2d3748;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.full-preview-btn,
.show-all-btn {
  margin-top: 1.25rem;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: var(--radius-xl);
  cursor: pointer;
  padding: 0.875rem 1.5rem;
  transition: var(--transition);
  font-weight: 500;
  color: var(--text-secondary);
}

.full-preview-btn:hover,
.show-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  transition: var(--transition);
}

.delete-btn:hover svg {
  stroke: #ef4444;
  transform: scale(1.15);
}

/* ===== MODALS ===== */
.modal,
.modal2 {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.modal-content,
.modal-content2 {
  background: white;
  margin: 3% auto;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  width: 85%;
  max-width: 900px;
  height: 85vh;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  background: white;
  color: var(--text-primary);
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-body {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.modal-letter-container {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  min-height: 400px;
  background: white;
  outline: none;
}

.modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  background: var(--bg-light);
}

.close {
  color: var(--text-secondary);
  font-size: 28px;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border-radius: 50%;
}

.close:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 999;
}

.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 450px;
  width: 90%;
  z-index: 1000;
  box-shadow: var(--shadow-xl);
}

.modal-box h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-box p {
  margin-bottom: 1.75rem;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-buttons button {
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
}

.custom-modal,
.custom-modal-sch,
.custom-modal-letter {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.custom-modal-content,
.custom-modal-sch-content {
  background: white;
  color: var(--text-primary);
  width: 450px;
  max-width: 90%;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-xl);
}

.custom-modal-text {
  margin-bottom: 1.75rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.custom-modal-ok-btn {
  background: #10b981;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.custom-modal-ok-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.custom-modal-input {
  width: 100%;
  padding: 0.875rem 1rem;
  margin: 1rem 0;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.custom-modal-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.custom-modal-cancel-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.custom-modal-cancel-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.schedule-modal {
  width: 400px;
  max-width: 90%;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-xl);
}

.modal-title {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.form-group3 {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group3 label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.schedule-input {
  padding: 0.875rem;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  transition: var(--transition);
  outline: none;
}

.schedule-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-cancel {
  background: #6c757d;
  color: white;
}

.btn-cancel:hover {
  background: #5a6268;
}

.btn-confirm {
  background: var(--primary-gradient);
  color: white;
}

/* ===== FORMS ===== */
.form-input,
.campaign-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
  background: white;
}

.form-input:focus,
.campaign-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: white;
}

.form-input:hover,
.campaign-input:hover {
  border-color: #cbd5e0;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.filter-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.filter-box .form-group {
  width: 100%;
}

.filter-box input,
.filter-box select {
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
}

.filter-box input:focus,
.filter-box select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dynamic-form-wrapper {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 4rem;
}

.dynamic-form {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: center;
}

.dynamic-form input {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-color);
  width: 500px;
  max-width: 100%;
  outline: none;
  font-size: 1rem;
  transition: var(--transition);
}

.dynamic-form input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.small-input {
  width: 120px;
  display: inline-block;
  margin-right: 0.75rem;
}

/* ===== DASHBOARD ===== */
.dashboard {
  padding: 4rem 5rem;
  margin-top: 5rem;
  position: relative;
}

.dashboard h1 {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 4rem;
}

.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

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

.card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.card p {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.dashboard h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

/* ===== TABLES ===== */
table,
.campaign-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

table thead,
.campaign-table thead {
  background: var(--primary-gradient);
  color: white;
}

table th,
table td,
.campaign-table th,
.campaign-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.95rem;
}

table th,
.campaign-table th {
  font-weight: 600;
  letter-spacing: 0.3px;
}

table tbody tr,
.campaign-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

table tbody tr:nth-child(even),
.campaign-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

table tbody tr:hover,
.campaign-table tbody tr:hover {
  background: #f0f4ff;
}

.status-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.status-sent {
  background: #10b981;
}

.status-scheduled {
  background: #f59e0b;
}

.status-default {
  background: #6b7280;
}

.view-template-btn,
.view-details-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--text-primary);
  color: white;
  font-weight: 500;
  transition: var(--transition);
}

.view-template-btn:hover,
.view-details-btn:hover {
  background: var(--primary-gradient);
  transform: translateY(-1px);
}

/* ===== CAMPAIGN SECTIONS ===== */
.create-campaign-section {
  margin-top: 5rem;
  padding: 2.5rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.create-campaign-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.create-campaign-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.create-campaign-form {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.campaign-top {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.campaign-top select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  border: 2px solid var(--border-color);
  appearance: none;
  background: url('data:image/svg+xml;utf8,<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19 9l-7 7-7-7"/></svg>')
    no-repeat right 0.75rem center;
  background-size: 1.25rem;
  background-color: white;
  transition: var(--transition);
}

.campaign-top select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== BATCH SEARCH ===== */
.batch-search {
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-sm);
}

.filter-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.form-input {
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.small-input {
  width: 48%;
  display: inline-block;
}

.form-group:has(.small-input) {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.form-group:has(.small-input) label {
  width: 100%;
  margin-bottom: 0.5rem;
}

.batchactionbuttons {
  grid-column: 1 / -1;
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.suggestions-box {
  border: 1px solid var(--border-color);
  background: white;
  max-height: 150px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid #f3f4f6;
}

.suggestion-item:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.search-note {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-left: 4px solid var(--primary-color);
  color: #1e40af;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

/* ===== RESULTS SECTION ===== */

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 1rem;
}

.results-info {
  flex: 1;
  min-width: 250px;
}

.result-counts {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.count-item {
  font-size: 0.95rem;
  color: #4b5563;
}

.count-item strong {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.select-all-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  color: #374151;
  user-select: none;
}

.select-all-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.results-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #374151;
}

.pagination-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  background: white;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-icon {
  font-size: 1.1rem;
}

.export-btn {
  background: #10b981;
  color: white;
}

.export-btn:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.save-btn {
  background: var(--primary-gradient);
  color: white;
}

.save-btn:hover {
  background: var(--primary-gradient);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pagination-info {
  text-align: center;
  padding: 0.32rem;
  background: #f9fafb;
  font-weight: 600;
  color: #6b7280;
}

.result-card {
  padding: 1.25rem;
  border: 1px solid #e5e7eb;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
  background: white;
  transition: all 0.2s ease;
}

.result-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f3f4f6;
}

.record-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
  flex-shrink: 0;
}

.property-address {
  font-size: 1.1rem;
  color: #111827;
}

.property-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: var(--radius-sm);
}

.detail-label {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.875rem;
}

.detail-value {
  color: #111827;
  font-weight: 500;
  font-size: 0.875rem;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--primary-color);
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 0.625rem 1rem;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: 0.25rem;
}

.page-number {
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  color: #374151;
  min-width: 40px;
}

.page-number:hover {
  background: #eff6ff;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.page-number.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ===== LOADING & MESSAGES ===== */
.loading-spinner {
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
  color: var(--primary-color);
  font-weight: 600;
}

.loading-spinner::before {
  content: "⏳ ";
  font-size: 1.5rem;
}

.no-results {
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
  color: #6b7280;
  background: #f9fafb;
  border-radius: var(--radius-lg);
}

.error-message {
  text-align: center;
  padding: 2rem;
  color: #dc2626;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-lg);
  font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .filter-box {
    grid-template-columns: 1fr;
  }

  .results-header {
    flex-direction: column;
    align-items: stretch;
  }

  .results-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }

  .property-details {
    grid-template-columns: 1fr;
  }

  .batchactionbuttons {
    flex-direction: column;
  }

  .result-counts {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* ===== ADDRESS LIST ===== */
.address-list {
  margin-top: 1.25rem;
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-md);
  background: white;
}

.address-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.address-list li {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.address-list li:hover {
  background: var(--bg-light);
}

.address-list li:last-child {
  border-bottom: none;
}

/* ===== PREVIEW OVERLAY ===== */
.preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.preview-content {
  background: white;
  height: 90%;
  overflow: auto;
  border-radius: var(--radius-lg);
  position: relative;
  box-shadow: var(--shadow-xl);
}

.preview-content .close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  border: none;
  background: var(--text-primary);
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: var(--transition);
}

.preview-content .close-btn:hover {
  background: var(--primary-gradient);
}

/* ===== SELECTION CARDS ===== */
.selection-cards {
  display: flex;
  gap: 2rem;
  margin: 4rem 0;
  justify-content: center;
  flex-wrap: wrap;
}

.selection-cards .card {
  border: 2px solid var(--border-color);
  padding: 2rem 3rem;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  background: white;
}

.selection-cards .card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.selection-cards .card.selected {
  border-color: var(--primary-color);
  background: #f0f4ff;
  box-shadow: var(--shadow-md);
}

/* ===== TEMPLATE ACTIONS ===== */
.template-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.template-actions .btn-primary {
  background: var(--primary-gradient);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.template-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===== CAMPAIGN MODAL 2 ===== */
#campaignModal2 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
}

#campaignModal2 .modal-content {
  background: white;
  width: 90%;
  max-width: 1200px;
  height: 85%;
  max-height: 90vh;
  margin: 40px auto;
  padding: 2rem;
  border-radius: var(--radius-lg);
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

/* ===== USER GUIDE ===== */
#userGuideIcon {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
}

#userGuideIcon img {
  width: 67px;
  height: 67px;
  border-radius: 50%;
}

#userGuideIcon:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: var(--shadow-xl);
}

#userGuideOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: background 0.4s ease;
}

#userGuideOverlay.show {
  display: flex;
  animation: fadeInOverlay 0.4s ease forwards;
}

@keyframes fadeInOverlay {
  to {
    background: rgba(0, 0, 0, 0.7);
  }
}

#userGuideContent {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 750px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-xl);
  transform: scale(0.8) translateY(-30px);
  opacity: 0;
  animation: slideInContent 0.5s ease 0.2s forwards;
  display: flex;
  flex-direction: column;
}

#userGuideContent .guide-inner {
  padding: 3rem;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(90vh - 80px);
  box-sizing: border-box;
}

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

#closeGuide {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 42px;
  height: 42px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  border: none;
}

#closeGuide:hover {
  background: #dc2626;
  transform: rotate(90deg) scale(1.1);
}

#userGuideContent h2 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#userGuideContent > p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

#userGuideContent ol {
  list-style: none;
  counter-reset: step-counter;
  margin-bottom: 2rem;
}

#userGuideContent ol li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 4rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.7;
  opacity: 0;
  animation: fadeInStep 0.4s ease forwards;
}

#userGuideContent ol li:nth-child(1) {
  animation-delay: 0.4s;
}
#userGuideContent ol li:nth-child(2) {
  animation-delay: 0.5s;
}
#userGuideContent ol li:nth-child(3) {
  animation-delay: 0.6s;
}
#userGuideContent ol li:nth-child(4) {
  animation-delay: 0.7s;
}
#userGuideContent ol li:nth-child(5) {
  animation-delay: 0.8s;
}

@keyframes fadeInStep {
  to {
    opacity: 1;
  }
}

#userGuideContent ol li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  background: var(--primary-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: var(--shadow-md);
}

#userGuideContent strong {
  color: var(--text-primary);
  font-weight: 700;
}

#userGuideContent em {
  color: var(--primary-color);
  font-style: normal;
  font-weight: 600;
}

.get-started-btn {
  width: 100%;
  padding: 1rem 2rem;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 2rem;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.get-started-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

#userGuideContent .guide-inner::-webkit-scrollbar {
  width: 8px;
}

#userGuideContent .guide-inner::-webkit-scrollbar-track {
  background: var(--bg-light);
  border-radius: 10px;
}

#userGuideContent .guide-inner::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

#userGuideContent .guide-inner::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 1rem 1.5rem;
  }

  .hero {
    padding: 140px 1.5rem 80px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-img {
    margin-top: 2.5rem;
    transform: rotate(0);
  }

  .logo {
    margin-left: 0;
    gap: 8px;
  }

  .templates-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .template {
    min-height: 380px;
    padding: 1.5rem;
  }

  .upload-flex {
    flex-direction: column;
    gap: 2rem;
  }

  .info_download {
    max-width: 100%;
    margin-top: 0;
    text-align: center;
  }

  .heading3 {
    font-size: 1.5rem;
    text-align: center;
    line-height: 2rem;
  }

  .create-campaign-section {
    margin-top: 3rem;
    padding: 1.5rem;
  }

  .audience_heading {
    text-align: center;
    margin-top: 4rem;
  }

  .dashboard {
    padding: 2rem 1.5rem;
    margin-top: 4rem;
  }

  .dashboard h1 {
    font-size: 2rem;
  }

  #campaignDataTable thead th:nth-child(2),
  #campaignDataTable thead th:nth-child(3),
  #campaignDataTable thead th:nth-child(4),
  #campaignDataTable tbody td:nth-child(2),
  #campaignDataTable tbody td:nth-child(3),
  #campaignDataTable tbody td:nth-child(4) {
    display: none;
  }

  #userGuideContent .guide-inner {
    padding: 2rem 1.5rem;
  }

  #userGuideContent h2 {
    font-size: 1.75rem;
  }

  #userGuideContent ol li {
    padding-left: 3.5rem;
    font-size: 0.95rem;
  }

  #userGuideContent ol li::before {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .dynamic-form input {
    width: 100%;
  }
}

@media screen and (max-width: 468px) {
  .menu-toggle {
    display: block;
  }

  .header-right {
    display: none;
    position: absolute;
    top: 60px;
    right: 0;
    background: white;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    width: 200px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
  }

  .header-right.active {
    display: flex;
  }

  .header {
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
  }

  .container {
    max-width: 100%;
    margin: 1rem auto;
    padding: 1.5rem;
    margin-top: 7rem;
    width: 100%;
  }

  h2 {
    font-size: 1.75rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .upload-section {
    width: 100%;
    max-width: 100%;
    font-size: medium;
    margin-top: 2rem;
    padding: 0;
  }

  .upload-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .upload-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
  }

  .upload-box {
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
    max-width: 95%;
  }

  .upload-icon {
    font-size: 2.5rem;
  }

  .upload-main-text {
    font-size: 1.125rem;
  }

  .upload-sub-text {
    font-size: 0.9rem;
  }

  .sample-download-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    max-width: 100%;
    width: auto;
  }

  .choose-file-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }

  .file-size-info {
    font-size: 0.85rem;
  }

  .letter-container {
    padding: 1.25rem;
    margin-bottom: 3rem;
    margin-top: 1.25rem;
    font-size: 14px;
  }

  .signature {
    font-size: 20pt;
    margin-top: 1.75rem;
  }

  .contact-info {
    font-size: 11pt;
  }

  .footer-note {
    font-size: 11pt;
  }

  .button-actions {
    bottom: 1rem;
    right: 1rem;
    gap: 0.5rem;
  }

  .order-design-btn {
    width: 100px;
    height: 38px;
    font-size: 0.8rem;
    border-radius: var(--radius-md);
  }

  .edit-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .modal-content,
  .modal-content2 {
    width: 95%;
    height: 90vh;
    margin: 5vh auto;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-letter-container {
    font-size: 14px;
    padding: 1.25rem;
    min-height: 300px;
  }

  .modal-footer {
    padding: 1.25rem 1.5rem;
    flex-direction: column;
    gap: 0.75rem;
  }

  .modal-footer .btn {
    width: 100%;
    margin: 0;
  }

  .modal-box {
    max-width: 90%;
    padding: 1.75rem;
  }

  .modal-box h2 {
    font-size: 1.375rem;
  }

  .modal-box p {
    font-size: 0.95rem;
  }

  .modal-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .modal-buttons button {
    width: 100%;
    margin: 0;
  }

  .form-input,
  .campaign-input {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .send-btn {
    font-size: 1rem;
    padding: 1rem;
    margin-top: 1.5rem;
  }

  .Text {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }

  .date {
    margin-bottom: 1rem;
  }

  .hero-container {
    gap: 2.5rem;
    margin-top: 2rem;
  }

  .info-content ul li {
    font-size: 1rem;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .card {
    padding: 1.5rem;
  }

  .campaign-top select {
    width: 100%;
  }

  .create-campaign-form {
    flex-direction: column;
  }

  .batchactionbuttons {
    flex-direction: column;
    gap: 1rem;
    margin-left: 0;
  }

  .selection-cards {
    flex-direction: column;
    gap: 1.25rem;
  }

  #userGuideIcon {
    width: 56px;
    height: 56px;
    bottom: 1.5rem;
    right: 1.5rem;
  }

  #userGuideIcon img {
    width: 48px;
    height: 48px;
  }
}

@media screen and (max-width: 320px) {
  .template {
    padding: 1rem;
  }

  .letter-container {
    padding: 1rem;
    font-size: 13px;
  }

  .modal-content,
  .modal-content2 {
    width: 98%;
  }

  .modal-body {
    padding: 1rem;
  }

  .signature {
    font-size: 18pt;
  }
}

/* ===== UTILITY CLASSES ===== */
.Text {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.date {
  margin-bottom: 1.5rem;
}

.savetemplate {
  background: var(--primary-gradient);
}

/* ===== MISC ELEMENTS ===== */
.btn-cancel {
  background: #6c757d;
  color: white;
}

.btn-cancel:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.btn-confirm {
  background: var(--primary-gradient);
  color: white;
}

/* Ensure smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection colors */
::selection {
  background: var(--primary-color);
  color: white;
}

::-moz-selection {
  background: var(--primary-color);
  color: white;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Disabled states */
.disabled,
button:disabled,
input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Animation classes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* Print styles */
@media print {
  .navbar,
  .header,
  .button-actions,
  .nav-buttons,
  #userGuideIcon {
    display: none !important;
  }

  .container {
    margin-top: 0;
  }

  body {
    background: white;
  }
}

.main-container {
  display: none;
  flex-direction: column;
  width: 100%;
  max-width: 1900px;
  max-height: 800px;
  margin-bottom: 2rem;
  overflow-y: auto; /* restores scroll */
}

.search-note {
  background: #e3f2fd;
  padding: 14px 20px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: #1976d2;
  border-left: 4px solid #1976d2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.content-sections {
  display: flex;
  gap: 7px;
  flex: 1;
  overflow: hidden;
}

/* LEFT SIDE - SEARCH */
.search-container {
  width: 350px;
  flex-shrink: 0;
  background: #fff;
  padding: 15px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filters-scroll {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 15px;
  padding-right: 8px;
}

.filters-scroll::-webkit-scrollbar {
  width: 6px;
}

.filters-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.filters-scroll::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.filters-scroll::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.filter-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.form-group label {
  font-weight: 600;
  font-size: 13px;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 3px rgba(25, 118, 210, 0.3);
}

.small-input {
  width: calc(50% - 6px);
  display: inline-block;
}

.small-input:first-of-type {
  margin-right: 12px;
}

.search-actions {
  display: flex;
  align-items: center; /* ensures both are perfectly level */
  justify-content: space-between;
  gap: 7px;
  position: sticky;
  background: #fff;
}

.search-btn,
.clear-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-md);
  width: 120px;
  font-weight: 600;
  font-size: 13px;
  height: 40px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-btn {
  background: var(--primary-gradient);
  color: #fff;
}

.clear-btn {
  background: var(--primary-gradient);
  color: #fff;
}

.search-btn:hover {
  background-color: #1565c0;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
  transform: translateY(-1px);
}

.clear-btn:hover {
  background-color: #d32f2f;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
  transform: translateY(-1px);
}

/* RIGHT SIDE - RESULTS */
.results-container {
  flex: 1;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#results {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.results-header {
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  padding: 8px 10px;
  flex-shrink: 0;
}

.results-info {
  margin-bottom: 6px;
}

.result-counts {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.count-item {
  color: #666;
  white-space: nowrap;
}

.count-item strong {
  color: #1565c0;
  font-weight: 700;
}

.select-all-container {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #666;
  user-select: none;
  font-size: 12px;
}

.select-all-container input {
  cursor: pointer;
}

.results-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.pagination-select {
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.export-btn {
  background-color: #2196f3;
  color: white;
}

.export-btn:hover {
  background-color: #1976d2;
}

.save-btn {
  background-color: #ff9800;
  color: white;
}

.save-btn:hover {
  background-color: #f57c00;
}

.btn-icon {
  font-size: 14px;
}

.pagination-info {
  font-size: 11px;
  color: #999;
  padding: 6px 10px;
  background: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

/* SCROLLABLE TABLE CONTENT */
.table-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  border: none;
  background: #fff;
  min-height: 0;
}

.table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.results-table thead {
  background: #f5f5f5;
  position: sticky;
  top: 0;
  z-index: 5;
}

.results-table th {
  padding: 8px;
  text-align: left;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #ddd;
  white-space: nowrap;
  height: 44px;
}

.results-table th.checkbox-col {
  padding: 0;
  width: 50px;
  text-align: center;
  vertical-align: middle;
}

.results-table td {
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.results-table td.checkbox-col {
  padding: 0;
  width: 50px;
  text-align: center;
  vertical-align: middle;
}

.results-table tbody tr:hover {
  background-color: #f9f9f9;
}

.results-table tbody tr.selected-row {
  background-color: #e3f2fd;
}

.select-all-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  gap: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  width: 100%;
}

.select-all-label #selectAllLabel {
  display: none;
}

.results-table td.checkbox-col {
  height: 44px;
  display: table-cell;
  vertical-align: middle;
}

.select-all-label input[type="checkbox"],
.checkbox-col input[type="checkbox"] {
  cursor: pointer;
  transform: scale(1.6);
  accent-color: #1976d2;
  margin: 0;
  flex-shrink: 0;
}

#selectAllLabel {
  font-size: 12px;
  white-space: nowrap;
}

.empty-row {
  text-align: center;
  color: #999;
  padding: 30px 8px !important;
}

.no-results {
  text-align: center;
  padding: 30px;
  color: #999;
}

.loading-spinner {
  text-align: center;
  padding: 30px;
  color: #1976d2;
  font-weight: 600;
}

.error-message {
  text-align: center;
  padding: 15px;
  color: #d32f2f;
  background: #ffebee;
  border-radius: 4px;
}

/* FIXED PAGINATION AT BOTTOM */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: #f5f5f5;
  border-top: 1px solid #ddd;
  flex-shrink: 0;
}

.pagination-btn {
  padding: 5px 8px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background-color: #1976d2;
  color: #fff;
  border-color: #1976d2;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: 2px;
}

.page-number {
  padding: 5px 7px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  transition: all 0.2s;
}

.page-number:hover {
  border-color: #1976d2;
  color: #1976d2;
}

.page-number.active {
  background-color: #4caf50;
  color: #fff;
  border-color: #4caf50;
}

@media (max-width: 1200px) {
  .search-container {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .content-sections {
    flex-direction: column;
  }

  .search-container {
    width: 100%;
  }

  .result-counts {
    flex-direction: column;
    gap: 6px;
  }

  .results-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Ensure same size for all checkboxes (header + rows) */
.results-table input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #1976d2; /* optional - blue tint */
  transform: scale(1.2); /* visually consistent across browsers */
}

.results-table .checkbox-col {
  width: 50px;
  text-align: center;
  vertical-align: middle;
}

.workflow-container {
  position: relative;
}

.mode-selector {
  position: absolute;
  display: flex;
  gap: 0;
  border: 2px solid var(--primary-gradient);
  border-radius: var(--radius-md);
  overflow: hidden;
  top: 1.5rem;      /* distance from top of workflow-container */
  right: 1.5rem;    /* flush to the right edge with some breathing room */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
  height: 45px;
  top: -35px; 
}

.mode-btn {
  padding: 0.6rem 1.5rem;
  background: white;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border-right: 1px solid #2b7fff;
  min-width: 100px;
  text-align: center;
}

.mode-btn:last-child {
  border-right: none;
}

.mode-btn:hover:not(.active) {
  background: #f0f1f1;
}

.mode-btn.active:hover {
  background: var(--primary-gradient);
}

.mode-btn.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mode-selector {
    top: 15px;
    right: 15px;
  }

  .mode-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-width: 80px;
  }
}

@media (max-width: 480px) {
  .mode-selector {
    top: 10px;
    right: 10px;
  }

  .mode-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    min-width: 70px;
  }
}

/* Existing Audience Section */
.existing-audience-section {
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
}

.audience-list-container {
  width: 100%;
}

.audience-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #eee;
}

.audience-header h2 {
  font-size: 1.5rem;
  color: #333;
  margin: 0;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.refresh-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.audiences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  min-height: 200px;
}

.audience-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.audience-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.audience-card.selected {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.audience-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.audience-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  flex: 1;
  word-break: break-word;
}

.delete-audience-btn {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.3s ease;
}

.delete-audience-btn:hover {
  background: #c82333;
}

.audience-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #666;
  font-size: 0.9rem;
}

.audience-recipients {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audience-recipients svg {
  flex-shrink: 0;
}

.audience-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #999;
}

.loading-message,
.no-audiences-message {
  text-align: center;
  padding: 3rem;
  color: #666;
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

.no-audiences-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.no-audiences-message svg {
  color: #ccc;
}

/* Audience Name Modal */
#audienceNameModal .custom-modal-content {
  max-width: 500px;
  padding: 2rem;
}
.audience-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.select-audience-btn,
.view-details-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.select-audience-btn {
  background-color: #007bff;
  color: white;
}

.select-audience-btn:hover {
  background-color: #0056b3;
}

.view-details-btn {
  background-color: #f0f0f0;
  color: #333;
}

.view-details-btn:hover {
  background-color: #e0e0e0;
}

.audience-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.audience-modal .modal-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 80%;
  position: relative;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.2s ease-in-out;
}

.audience-modal table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.audience-modal th,
.audience-modal td {
  border: 1px solid #ddd;
  padding: 8px;
}

.audience-modal th {
  background: #f5f5f5;
  font-weight: bold;
}

.close-modal-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}


/* ===== EDDM SECTION STYLES ===== */

.eddm-section {
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.eddm-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.eddm-header h3 {
  font-size: 1.3rem;
  color: #333;
  margin: 0;
}

.eddm-badge {
  display: inline-block;
  background: #ff6b6b;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.eddm-form {
  display: grid;
  gap: 1.5rem;
}

.eddm-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.eddm-form .form-group label {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.eddm-form .form-select {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
  background: white;
  cursor: pointer;
}

.eddm-form .form-select:hover {
  border-color: #999;
}

.eddm-form .form-select:focus {
  outline: none;
  border-color: #2b7fff;
  box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.1);
}

.eddm-form .form-input {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.eddm-form .form-input:focus {
  outline: none;
  border-color: #2b7fff;
  box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.1);
}

.eddm-form .form-input::placeholder {
  color: #999;
}

.multiselect-dropdown {
  position: relative;
}

.multiselect-header {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.3s ease;
}

.multiselect-header:hover {
  border-color: #2b7fff;
}

.multiselect-header.active {
  border-color: #2b7fff;
  box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.1);
}

.multiselect-header-text {
  color: #666;
  font-size: 0.95rem;
}

.multiselect-arrow {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  color: #666;
}

.multiselect-arrow.open {
  transform: rotate(180deg);
}

.multiselect-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 5px 5px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.multiselect-list.open {
  display: block;
}

.multiselect-option {
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.multiselect-option:last-child {
  border-bottom: none;
}

.multiselect-option:hover {
  background: #f5f5f5;
}

.multiselect-option input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #2b7fff;
}

.multiselect-option label {
  cursor: pointer;
  margin: 0;
  flex: 1;
  font-weight: 400;
  color: #333;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  min-height: 28px;
}

.tag {
  background: #2b7fff;
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.tag-remove {
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.tag-remove:hover {
  opacity: 0.8;
}

.eddm-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.eddm-actions .btn-primary,
.eddm-actions .btn-secondary {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.eddm-actions .btn-primary {
  background: #2b7fff;
  color: white;
}

.eddm-actions .btn-primary:hover:not(:disabled) {
  background: #1e5fcf;
}

.eddm-actions .btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.eddm-actions .btn-secondary {
  background: #6c757d;
  color: white;
}

.eddm-actions .btn-secondary:hover {
  background: #5a6268;
}

.loading {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #2b7fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.empty-state {
  padding: 1rem;
  color: #999;
  text-align: center;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .eddm-section {
    padding: 1.5rem;
  }

  .eddm-header h3 {
    font-size: 1.1rem;
  }

  .eddm-form {
    gap: 1rem;
  }

  .eddm-actions {
    flex-direction: column;
  }

  .eddm-actions .btn-primary,
  .eddm-actions .btn-secondary {
    width: 100%;
  }

  .multiselect-list {
    max-height: 200px;
  }

  .selected-tags {
    gap: 0.35rem;
  }

  .tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
}
/* ===== DEMOGRAPHICS SECTION STYLES ===== */

.demographics-container {
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
}

.demographic-filter {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  overflow: hidden;
  transition: all 0.2s ease;
}

.demographic-filter:hover {
  border-color: #2b7fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.demographic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #e0e0e0;
  transition: background 0.2s ease;
}

.demographic-header:hover {
  background: #f0f1f3;
}

.demographic-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

.demographic-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: all 0.2s ease;
}

.demographic-toggle:hover {
  background: rgba(43, 127, 255, 0.1);
  border-radius: 4px;
}

.toggle-icon {
  display: inline-block;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  color: #666;
}

.demographic-toggle.expanded .toggle-icon {
  transform: rotate(180deg);
}

.demographic-options {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.demographic-options.collapsed {
  display: none;
}

.demographic-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s ease;
  cursor: pointer;
}

.demographic-option:hover {
  background: #f5f5f5;
}

.demographic-option input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #2b7fff;
}

.demographic-option label {
  cursor: pointer;
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  color: #555;
  user-select: none;
}

/* Scrollbar styling for demographic options */
.demographic-options::-webkit-scrollbar {
  width: 6px;
}

.demographic-options::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.demographic-options::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.demographic-options::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Selected Demographics Display */
.selected-demographics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f9f9f9;
  border-radius: 5px;
  min-height: 32px;
}

.demographic-tag {
  background: #e3f2fd;
  border: 1px solid #2b7fff;
  color: #2b7fff;
  padding: 0.35rem 0.75rem;
  border-radius: 16px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.demographic-tag-remove {
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.demographic-tag-remove:hover {
  opacity: 0.6;
}

.demographics-empty-state {
  padding: 1rem;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .demographic-options {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .demographic-header {
    padding: 0.65rem 0.75rem;
  }

  .demographic-title {
    font-size: 0.9rem;
  }

  .demographic-option {
    padding: 0.4rem;
  }

  .demographic-option label {
    font-size: 0.85rem;
  }

  .selected-demographics {
    gap: 0.35rem;
  }

  .demographic-tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
}

.letter-options-modal {
  min-width: 400px;
}

.letter-options-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.letter-options-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-buttons {
  display: flex;
  gap: 0.75rem;
}

.option-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 5px;
  background: white;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  color: #555;
}

.option-btn:hover {
  border-color: #2b7fff;
  color: #2b7fff;
}

.option-btn.active {
  background: #2b7fff;
  color: white;
  border-color: #2b7fff;
}

@media (max-width: 500px) {
  .letter-options-modal {
    min-width: 90vw;
  }
}

.btn-eddm {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.btn-eddm:hover {
  background: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
}

.btn-eddm:disabled {
  background: #cccccc;
  cursor: not-allowed;
}


.mode-selector1 {
  position: absolute;
  display: flex;
  gap: 0;
  border: 2px solid var(--primary-gradient);
  border-radius: var(--radius-md);
  overflow: hidden;
  top: 1.5rem;     
  right: 1.5rem;   
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
  height: 45px;
  top: 60px; 
  margin-right: 4rem;
}

.mode-btn1 {
  padding: 0.6rem 1.5rem;
  background: white;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border-right: 1px solid #2b7fff;
  min-width: 100px;
  text-align: center;
}

.mode-btn1:last-child {
  border-right: none;
}

.mode-btn1:hover:not(.active) {
  background: #f0f1f1;
}

.mode-btn1.active:hover {
  background: var(--primary-gradient);
}

.mode-btn1.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mode-selector1 {
    top: 15px;
    right: 15px;
  }

  .mode-btn1 {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-width: 80px;
  }
}

@media (max-width: 480px) {
  .mode-selector1 {
    top: 10px;
    right: 10px;
  }

  .mode-btn1 {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    min-width: 70px;
  }
}