.header-image {
  background-image: url("../images/header-image.jpg");
  background-size: cover;
  background-position: center;
  height: 200px;
  text-align: center;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-image h1 {
  margin-bottom: 0;
  padding-top: 25px;
  color: white;
}

.header-image h3 {
  color: white;
}

article {
  margin-top: 0px;
  margin-bottom: 0px;
}

section {
  margin-bottom: 2rem;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.participant-title {
  background-color: #007bff;
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.container {
  padding-top: 0;
}

/* ========================================
   COMMON STYLES - Shared Components
   ======================================== */

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h2 {
  margin: 0;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stats-grid-bounces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

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

.stat-card {
  background: var(--card-background-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border-color);
  text-align: center;
}

.info-card {
  background: var(--card-background-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border-color);
  text-align: center;
}

.stat-card h3 {
  margin: 0;
  font-size: 2rem;
  color: var(--primary);
}

.stat-card p {
  margin: 0.5rem 0 0 0;
  color: var(--muted-color);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card.active h3 {
  color: var(--ins-color);
}

.stat-card.bounced h3 {
  color: var(--del-color);
}

.stat-card.unsubscribed h3 {
  color: var(--muted-color);
}

/* Action Bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.action-bar .left,
.action-bar .right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.bulk-actions-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.bulk-actions-wrapper details {
  margin: 0;
}

/* details.dropdown[data-disabled="true"] summary {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
} */

.bulk-actions-wrapper details[data-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge.active {
  background-color: #d4edda;
  color: #155724;
}

.badge.bounced {
  background-color: #f8d7da;
  color: #721c24;
}

.badge.unsubscribed {
  background-color: #e2e3e5;
  color: #383d41;
}

.badge.pending {
  background-color: #fff3cd;
  color: #856404;
}

.badge.inactive {
  background-color: #f8d7da;
  color: #721c24;
}

/* Tables */
table {
  width: 100%;
  margin-top: 0;
}

table td,
table th {
  padding: 0.5rem 0.75rem;
}

/* Table Column Width Optimization */
table th:nth-child(1),
table td:nth-child(1) {
  width: 50px;
  text-align: center;
}

table th:nth-child(2),
table td:nth-child(2) {
  width: 18%;
  min-width: 140px;
}

table th:nth-child(3),
table td:nth-child(3) {
  width: 15%;
  min-width: 100px;
}

table th:nth-child(4),
table td:nth-child(4) {
  width: 8%;
  min-width: 80px;
}

table th:nth-child(5),
table td:nth-child(5) {
  width: 28%;
  min-width: 150px;
  word-break: break-word;
}

table th:nth-child(6),
table td:nth-child(6) {
  width: 6%;
  text-align: center;
}

table th:nth-child(7),
table td:nth-child(7) {
  width: 10%;
  text-align: center;
  font-size: 0.85rem;
}

table th:nth-child(8),
table td:nth-child(8) {
  width: 10%;
  text-align: center;
  font-size: 0.85rem;
}

table th:nth-child(9),
table td:nth-child(9) {
  width: 55px;
  text-align: center;
}

table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
}

/* Filter Section */
.filter-section {
  background: var(--card-background-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border-color);
  margin-bottom: 2rem;
}

.filter-section .grid {
  margin-bottom: 0;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

details[open] summary {
  margin-bottom: 1rem;
}

/* Pagination */
nav[aria-label="Pagination"] ul {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav[aria-label="Pagination"] li {
  margin: 0;
}

nav[aria-label="Pagination"] a {
  display: block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--card-border-color);
  border-radius: var(--border-radius);
  text-decoration: none;
}

nav[aria-label="Pagination"] a[aria-current="page"] {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Action Dropdown */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-dropdown-toggle {
  background: transparent;
  border: 1px solid var(--muted-border-color);
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--border-radius);
  color: var(--muted-color);
  transition: all 0.2s;
}

.action-dropdown-toggle:hover {
  background: var(--secondary-hover);
  border-color: var(--secondary);
  color: var(--secondary);
}

.action-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  background: var(--card-background-color);
  border: 1px solid var(--card-border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  z-index: 1000;
  padding: 0.25rem 0;
}

.action-dropdown.active .action-dropdown-menu {
  display: block;
}

.action-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--color);
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}

.action-dropdown-menu a:hover {
  background: var(--secondary-hover);
}

.action-dropdown-menu a.text-danger:hover {
  background: #f8d7da;
}

.action-dropdown-menu .dropdown-divider {
  height: 1px;
  background: var(--card-border-color);
  margin: 0.25rem 0;
}

/* Text Utilities */
.text-danger {
  color: var(--del-color);
}

/* ========================================
   FORM STYLES
   ======================================== */

.form-section {
  background: var(--card-background-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border-color);
  margin-bottom: 2rem;
}

.form-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  font-size: 1.2rem;
  color: var(--primary);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--card-border-color);
  flex-wrap: wrap;
}

.form-actions .left {
  margin-right: auto;
}

.form-actions .right {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.char-count {
  font-size: 0.875rem;
  color: var(--muted-color);
  text-align: right;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

.field-note {
  font-size: 0.85rem;
  color: var(--muted-color);
  margin-top: -0.5rem;
  font-style: italic;
}

/* Checkbox Grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-item label {
  margin: 0;
  cursor: pointer;
}

/* Info/Help/Warning Boxes */
.help-text {
  display: none;
  background: #e7f3ff;
  border-left: 4px solid #2196f3;
  padding: 1rem;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);

}

.help-text h4 {
  margin-top: 0;
  margin: 0 0 0.5rem 0;
  color: #1976d2;
  font-size: 1rem;
}

.help-text p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.help-text ul {
  margin: 0.5rem 0 0 1.5rem;
  padding-left: 1.5rem;
}

.help-text li {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.info-box {
  background: #e8f4f8;
  border-left: 4px solid #17a2b8;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: var(--border-radius);
}

.info-box p {
  margin: 0;
  color: #0c5a9e;
  font-size: 0.9rem;
}

.info-box ul {
  margin: 0.5rem 0 0 1.5rem;
}

.warning-box {
  display: none;
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius);
}

.warning-box p {
  margin: 0;
  color: #856404;
  font-size: 0.9rem;
}

/* Changes Indicator */
.changes-indicator {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius);
  display: none;
}

.changes-indicator p {
  margin: 0;
  color: #856404;
  font-size: 0.9rem;
  font-weight: 600;
}

/* List Selection Styles */
.list-selection {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.list-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--card-background-color);
  border: 2px solid var(--card-border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.list-checkbox-label:hover {
  border-color: var(--primary);
  background: #ffe;
}

.list-checkbox-label input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.list-info strong {
  display: block;
}

.list-info small {
  display: block;
  color: var(--muted-color);
}

.subscriber-count {
  color: var(--primary) !important;
  font-weight: 600;
}

.recipient-summary {
  background: #d4edda;
  border-left: 4px solid #28a745;
  padding: 1rem;
  margin-top: 1rem;
  border-radius: var(--border-radius);
}

.recipient-summary p {
  margin: 0.25rem 0;
}

/* Preview Actions */
.preview-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Code styling */
code {
  background: #f4f4f4;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
}

/* ========================================
   TEMPLATE-SPECIFIC STYLES
   ======================================== */

.template-preview {
  border: 1px solid var(--card-border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  background: #f8f9fa;
  margin-top: 0.5rem;
}

.template-preview h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--primary);
}

.template-preview .preview-content {
  font-size: 0.8rem;
  color: var(--muted-color);
  max-height: 100px;
  overflow: hidden;
}

.template-preview-compact {
  max-height: 60px;
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--muted-color);
  background: #f8f9fa;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border-color);
}

textarea#html_content {
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  height: 20rem;
}

.preview-section {
  background: var(--card-background-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border-color);
  margin-bottom: 2rem;
}

.preview-container {
  border: 1px solid var(--card-border-color);
  border-radius: var(--border-radius);
  min-height: 400px;
  background: white;
  padding: 1rem;
  overflow: auto;
}

.preview-container iframe {
  width: 100%;
  min-height: 400px;
  border: none;
}

/* ========================================
   VIEW/EDIT PAGE SPECIFIC STYLES
   ======================================== */

.activity-log {
  background: var(--card-background-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border-color);
}

.activity-log h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--primary);
}

.activity-item {
  padding: 0.75rem;
  border-bottom: 1px solid var(--card-border-color);
}

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

.used-by-lists {
  background: var(--card-background-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border-color);
  margin-bottom: 2rem;
}

.used-by-lists h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--primary);
}

.used-by-lists ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.used-by-lists li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--card-border-color);
}

.used-by-lists li:last-child {
  border-bottom: none;
}

.delete-btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.subscriber-lists,
.subscriber-tags {
  background: var(--card-background-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border-color);
  margin-bottom: 2rem;
}

.subscriber-lists h3,
.subscriber-tags h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--primary);
}

.campaign-item {
  padding: 1rem;
  border: 1px solid var(--card-border-color);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  background: white;
}

.campaign-item:last-child {
  margin-bottom: 0;
}

.campaign-item h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.campaign-item p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--muted-color);
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-bar .left,
  .action-bar .right {
    width: 100%;
    justify-content: stretch;
  }

  .action-bar button,
  .action-bar a[role="button"] {
    flex: 1;
  }

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

  .form-actions button,
  .form-actions a {
    width: 100%;
  }

  .form-actions .left,
  .form-actions .right {
    width: 100%;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .preview-actions button {
    width: 100%;
  }
}
