/*
 * Trix styles loaded via CDN in layout. Below are Action Text overrides.
 */

trix-editor {
  background: #ffffff;
}

/*
 * We need to override trix.css’s image gallery styles to accommodate the
 * <action-text-attachment> element we wrap around attachments. Otherwise,
 * images in galleries will be squished by the max-width: 33%; rule.
*/
.trix-content .attachment-gallery > action-text-attachment,
.trix-content .attachment-gallery > .attachment {
  flex: 1 0 33%;
  padding: 0 0.5em;
  max-width: 33%;
}

.trix-content
  .attachment-gallery.attachment-gallery--2
  > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--2 > .attachment,
.trix-content
  .attachment-gallery.attachment-gallery--4
  > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
  flex-basis: 50%;
  max-width: 50%;
}

.trix-content action-text-attachment .attachment {
  padding: 0 !important;
  max-width: 100% !important;
}
/* Admin & auth: layout and polish */

:root {
  --admin-bg: #f1f5f9;
  --admin-card-bg: #fff;
  --admin-border: #e2e8f0;
  --admin-text: #1e293b;
  --admin-text-muted: #64748b;
  --admin-primary: #0f172a;
  --admin-primary-hover: #334155;
  --admin-accent: #2563eb;
  --admin-accent-hover: #1d4ed8;
  --admin-success: #059669;
  --admin-danger: #dc2626;
  --admin-nav-height: 52px;
}

body {
  margin: 0;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

/* Top nav */
.admin-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--admin-primary);
  color: #fff;
  font-size: 0.9375rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.admin-nav a {
  color: #e2e8f0;
  text-decoration: none;
}

.admin-nav a:hover {
  color: #fff;
  text-decoration: underline;
}

.admin-nav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-nav-user .btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.admin-nav-user .btn:hover {
  background: rgba(255,255,255,0.25);
}

/* Main content */
.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.admin-container h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--admin-text);
}

.admin-container .breadcrumb,
.admin-container > p {
  font-size: 0.875rem;
  color: var(--admin-text-muted);
  margin-bottom: 1.5rem;
}

.admin-container .breadcrumb a,
.admin-container > p a {
  color: var(--admin-accent);
  text-decoration: none;
}

.admin-container .breadcrumb a:hover,
.admin-container > p a:hover {
  text-decoration: underline;
}

/* Cards */
.card {
  background: var(--admin-card-bg);
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--admin-text);
}

/* Tables in admin */
.admin-container .metrics-table,
.admin-container .data-table,
.admin-container .admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.admin-container .metrics-table td,
.admin-container .data-table th,
.admin-container .data-table td,
.admin-container .admin-table th,
.admin-container .admin-table td {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--admin-border);
  text-align: left;
}

.admin-container .metrics-table thead,
.admin-container .data-table thead,
.admin-container .admin-table thead {
  background: var(--admin-bg);
  font-weight: 600;
  color: var(--admin-text);
}

.admin-container .metrics-table tr:nth-child(even) td,
.admin-container .data-table tbody tr:nth-child(even) td,
.admin-container .admin-table tbody tr:nth-child(even) td {
  background: #fafafa;
}

.admin-container .hint {
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
}

.admin-container code {
  font-size: 0.8125rem;
  background: var(--admin-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  border: 1px solid var(--admin-border);
}

.admin-container .url-path-cell {
  vertical-align: middle;
}

.admin-container .url-path-cell code.url-path {
  display: inline-block;
  max-width: 20em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.admin-container .url-path-cell .btn-copy {
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  background: var(--admin-bg);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
}

.admin-container .url-path-cell .btn-copy:hover {
  background: var(--admin-border);
}

/* Buttons – scoped so admin wins over other stylesheets; always light text on colored bg */
.admin-container .btn,
.admin-container a.btn,
.admin-container input[type="submit"].btn,
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--admin-accent);
  color: #fff !important;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.admin-container .btn:hover,
.admin-container a.btn:hover,
.btn:hover {
  background: var(--admin-accent-hover);
  color: #fff !important;
}

.admin-container .btn-primary,
.admin-container a.btn-primary,
.btn-primary {
  background: var(--admin-primary);
  color: #fff !important;
}

.admin-container .btn-primary:hover,
.admin-container a.btn-primary:hover,
.btn-primary:hover {
  background: var(--admin-primary-hover);
  color: #fff !important;
}

.admin-container .btn-danger,
.admin-container a.btn-danger,
.btn-danger {
  background: var(--admin-danger);
  color: #fff !important;
}

.admin-container .btn-danger:hover,
.admin-container a.btn-danger:hover,
.btn-danger:hover {
  background: #b91c1c;
  color: #fff !important;
}

.admin-container .btn-sm,
.admin-container a.btn-sm,
.btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
}

form.inline { display: inline; }

/* Forms (admin & auth) */
.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.9375rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  max-width: 360px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.actions {
  margin-top: 1.25rem;
}

.actions input[type="submit"],
.actions .btn {
  min-width: 120px;
}

/* Alerts */
.notice {
  color: #065f46;
  background: #d1fae5;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #a7f3d0;
}

.alert {
  color: #991b1b;
  background: #fee2e2;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #fecaca;
}

/* Status badges */
.status-enabled {
  color: var(--admin-success);
  font-weight: 500;
}

.status-disabled {
  color: var(--admin-danger);
  font-weight: 500;
}

/* Session layout (login, 2FA) */
.session-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--admin-bg);
  flex-direction: column;
}

.session-container main {
  width: 100%;
  max-width: 400px;
  background: var(--admin-card-bg);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08);
}

.session-container h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1.25rem 0;
  text-align: center;
}

.session-container p {
  color: var(--admin-text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.session-container .field input {
  max-width: none;
}

.session-container .actions {
  margin-top: 1.5rem;
}

.session-container .actions input[type="submit"] {
  width: 100%;
  padding: 0.625rem;
  font-size: 1rem;
  cursor: pointer;
  background: var(--admin-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 500;
}

.session-container .actions input[type="submit"]:hover {
  background: var(--admin-primary-hover);
}

.session-container a {
  color: var(--admin-accent);
  text-decoration: none;
  font-size: 0.9375rem;
}

.session-container a:hover {
  text-decoration: underline;
}

/* Dashboard sections: use card style */
.admin-container .metrics,
.admin-container .clicks,
.admin-container .messages {
  background: var(--admin-card-bg);
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.admin-container .metrics h2,
.admin-container .clicks h2,
.admin-container .messages h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.errors ul {
  color: var(--admin-danger);
  margin: 0 0 1rem 0;
  padding-left: 1.25rem;
}
/* Campaign pages */
.campaign-container,
.result-container,
.oauth-failure {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1rem;
  font-family: system-ui, -apple-system, sans-serif;
}

.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
  font-family: system-ui, -apple-system, sans-serif;
}

.campaign-container h1,
.result-container h1,
.admin-container h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.notice {
  color: #05603a;
  background: #d1fae5;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert {
  color: #991b1b;
  background: #fee2e2;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.form-section .field,
.preview-section .field {
  margin-bottom: 1rem;
}

.form-section label,
.preview-section label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.form-section input[type="text"],
.form-section input[type="email"],
.form-section textarea {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
}

.btn:hover {
  background: #2563eb;
}

.btn-send {
  background: #059669;
}

.btn-send:hover {
  background: #047857;
}

.recipient-list {
  list-style: none;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 0.5rem;
  background: #f9fafb;
}

.recipient-list li {
  padding: 0.25rem 0;
  font-size: 0.875rem;
}

.preview-box {
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  background: #f9fafb;
}

.preview-box h3 {
  margin-top: 0;
  font-size: 1rem;
}

.preview-body {
  white-space: pre-wrap;
  font-size: 0.875rem;
  max-height: 200px;
  overflow-y: auto;
}

.preview-body--html {
  white-space: normal;
  line-height: 1.5;
}

.preview-body--html p { margin: 0.5rem 0; }
.preview-body--html p:first-child { margin-top: 0; }
.preview-body--html p:last-child { margin-bottom: 0; }
.preview-body--html a { color: #2563eb; }
.preview-body--html ul, .preview-body--html ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.preview-body--html li { margin: 0.25rem 0; }

.summary { font-size: 1.25rem; margin: 1rem 0; }

.errors ul { color: #991b1b; }

.metrics-table,
.clicks-table,
.messages-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.metrics-table td,
.clicks-table th,
.clicks-table td,
.messages-table th,
.messages-table td {
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  text-align: left;
}

.messages-table { font-size: 0.875rem; }

.campaign-logo { max-width: 200px; margin-bottom: 1rem; }
.by-whom { color: #6b7280; margin-bottom: 1rem; }
.campaign-description { margin-bottom: 1.5rem; padding: 1rem; background: #f3f4f6; border-radius: 4px; }
.transparency-box { border: 2px solid #e5e7eb; border-radius: 8px; padding: 1.5rem; margin: 1.5rem 0; background: #fafafa; }
.transparency-box h2 { margin-top: 0; }
.transparency-item { margin: 1rem 0; }
.transparency-item pre { background: #fff; padding: 0.5rem; border-radius: 4px; overflow-x: auto; }
.transparency-item .body-preview { max-height: 200px; overflow-y: auto; }
.transparency-item .body-preview.trix-content { white-space: normal; }
.transparency-item .hint { font-size: 0.875rem; color: #6b7280; margin-top: 0.25rem; }
.attachment-list { list-style: none; padding-left: 0; }
.attachment-list li { margin: 0.5rem 0; }
.attachment-list a { color: #2563eb; text-decoration: none; }
.attachment-list a:hover { text-decoration: underline; }
.attachment-preview { margin-top: 0.5rem; }
.attachment-image { max-width: 100%; max-height: 200px; border-radius: 4px; border: 1px solid #e5e7eb; }

.status-enabled { color: #059669; }
.status-disabled { color: #dc2626; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 0.5rem; border: 1px solid #e5e7eb; text-align: left; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.875rem; }

/* Admin form: current logo & attachments */
.current-attachment, .current-attachments { margin-top: 0.5rem; padding: 0.75rem; background: #f9fafb; border-radius: 4px; border: 1px solid #e5e7eb; }
.current-logo-preview { max-width: 150px; max-height: 100px; display: block; border-radius: 4px; border: 1px solid #e5e7eb; }
.current-attachment .filename, .current-attachments .filename { font-size: 0.875rem; color: #6b7280; margin-top: 0.25rem; }
.field .hint { font-size: 0.875rem; color: #6b7280; margin: 0.25rem 0 0.5rem 0; }
.current-attachments ul.attachment-items { list-style: none; padding-left: 0; margin: 0.5rem 0 0 0; }
.current-attachments li.attachment-item { margin: 0.5rem 0; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 4px; }
.current-attachments .attachment-info { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.current-attachments .attachment-link { color: #2563eb; text-decoration: none; flex-shrink: 0; }
.current-attachments .attachment-link:hover { text-decoration: underline; }
.attachment-thumb { max-width: 48px; max-height: 48px; border-radius: 4px; border: 1px solid #e5e7eb; flex-shrink: 0; }
.attachment-thumb--file { width: 48px; height: 48px; background: #e5e7eb; }
.attachment-filename { color: #374151; }
.btn-remove-attachment { padding: 0.25rem 0.5rem; font-size: 0.875rem; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; border-radius: 4px; cursor: pointer; flex-shrink: 0; text-decoration: none; display: inline-block; }
.btn-remove-attachment:hover { background: #fee2e2; }

.campaign-already-contributed { margin-top: 1.5rem; }
.campaign-thank-you { color: #059669; font-size: 1.125rem; margin: 0; }
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
