/* === OnNetMailer Dark Blue Glass Theme === */
:root {
  --onm-primary: #0a1628;
  --onm-secondary: #112240;
  --onm-accent: #64ffda;
  --onm-accent-hover: #4cd6b5;
  --onm-text: #ccd6f6;
  --onm-text-muted: #8892b0;
  --onm-glass-bg: rgba(17, 34, 64, 0.7);
  --onm-glass-border: rgba(100, 255, 218, 0.15);
  --onm-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --onm-gradient: linear-gradient(135deg, #0a1628 0%, #1a2744 50%, #0d2137 100%);
  --onm-card-bg: rgba(17, 34, 64, 0.6);
  --onm-input-bg: rgba(10, 22, 40, 0.8);
  --onm-btn-primary: linear-gradient(135deg, #64ffda 0%, #00b4d8 100%);
  --onm-btn-primary-text: #0a1628;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background: var(--onm-gradient);
  background-attachment: fixed;
  color: var(--onm-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Glass card */
.glass-card {
  background: var(--onm-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--onm-glass-border);
  border-radius: 16px;
  box-shadow: var(--onm-glass-shadow);
  padding: 2rem;
}

.glass-card-sm {
  background: var(--onm-glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--onm-glass-border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
}

/* Navbar */
.navbar-glass {
  background: rgba(10, 22, 40, 0.85) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--onm-glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1050;
}

.navbar-glass .navbar-brand {
  color: var(--onm-accent) !important;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.navbar-glass .nav-link {
  color: var(--onm-text-muted) !important;
  font-weight: 500;
  transition: color 0.2s ease;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
}

.navbar-glass .nav-link:hover,
.navbar-glass .nav-link.active {
  color: var(--onm-accent) !important;
  background: rgba(100, 255, 218, 0.05);
}

/* Buttons */
.btn-accent {
  background: var(--onm-btn-primary);
  color: var(--onm-btn-primary-text) !important;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(100, 255, 218, 0.3);
  color: var(--onm-btn-primary-text) !important;
}

.btn-outline-glass {
  background: transparent;
  color: var(--onm-accent) !important;
  border: 1px solid var(--onm-accent);
  border-radius: 10px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-outline-glass:hover {
  background: rgba(100, 255, 218, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(100, 255, 218, 0.15);
  color: var(--onm-accent) !important;
}

/* Forms */
.form-control, .form-select {
  background: var(--onm-input-bg) !important;
  border: 1px solid rgba(100, 255, 218, 0.2) !important;
  color: var(--onm-text) !important;
  border-radius: 10px;
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgba(10, 22, 40, 0.95) inset !important;
  -webkit-text-fill-color: var(--onm-text) !important;
  transition: background-color 5000s ease-in-out 0s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--onm-accent) !important;
  box-shadow: 0 0 0 0.2rem rgba(100, 255, 218, 0.15) !important;
  background: var(--onm-input-bg) !important;
  color: var(--onm-text) !important;
}

.form-control::placeholder {
  color: var(--onm-text-muted) !important;
}

.form-floating > label {
  color: var(--onm-text-muted) !important;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--onm-text-muted) !important;
}

.form-check-input {
  background-color: var(--onm-input-bg);
  border-color: rgba(100, 255, 218, 0.3);
}

.form-check-input:checked {
  background-color: var(--onm-accent);
  border-color: var(--onm-accent);
}

/* Links */
a {
  color: var(--onm-accent);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--onm-accent-hover);
}

/* Footer */
.footer-glass {
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--onm-glass-border);
  color: var(--onm-text-muted);
  position: absolute;
  bottom: 0;
  width: 100%;
  line-height: 60px;
  white-space: nowrap;
}

.footer-glass a {
  color: var(--onm-accent);
}

/* Hero section for landing page */
.hero-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(100, 255, 218, 0.03) 0%, transparent 70%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(-10%, -10%) rotate(0deg); }
  100% { transform: translate(10%, 10%) rotate(5deg); }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, var(--onm-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 4.5rem;
  }
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--onm-text-muted);
  max-width: 600px;
}

/* Feature cards */
.feature-card {
  background: var(--onm-card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--onm-glass-border);
  border-radius: 16px;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(100, 255, 218, 0.1);
  border-color: rgba(100, 255, 218, 0.3);
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(100, 255, 218, 0.15), rgba(0, 180, 216, 0.15));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.feature-card h4 {
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--onm-text-muted);
  margin-bottom: 0;
}

/* Stats section */
.stat-item {
  text-align: center;
  padding: 1rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--onm-accent);
}

.stat-label {
  color: var(--onm-text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Auth pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: var(--onm-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--onm-glass-border);
  border-radius: 20px;
  box-shadow: var(--onm-glass-shadow);
  padding: 3rem;
  width: 100%;
  max-width: 480px;
}

.auth-card h1, .auth-card h2 {
  color: #fff;
  font-weight: 700;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--onm-text-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(100, 255, 218, 0.15);
}

.auth-divider span {
  padding: 0 1rem;
  font-size: 0.85rem;
}

/* Dashboard / content area */
.content-header {
  margin-bottom: 2rem;
}

.content-header h1 {
  color: #fff;
  font-weight: 700;
}

/* Table styling */
.table {
  color: var(--onm-text);
}

.table thead th {
  border-color: var(--onm-glass-border);
  color: var(--onm-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.table thead.table-light {
  --bs-table-bg: rgba(17, 34, 64, 0.5);
  --bs-table-color: var(--onm-text-muted);
}

.table .table-secondary {
  --bs-table-bg: rgba(17, 34, 64, 0.3);
  --bs-table-color: var(--onm-text-muted);
  --bs-table-border-color: rgba(100, 255, 218, 0.08);
}

.table tbody td {
  border-color: rgba(100, 255, 218, 0.08);
}

.table tbody tr:hover {
  background: rgba(100, 255, 218, 0.03);
}

/* Status pills */
.status-pill {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: capitalize;
}
.status-sent { background: rgba(0, 180, 216, 0.15); color: #00b4d8; border: 1px solid rgba(0, 180, 216, 0.3); }
.status-delivered { background: rgba(100, 255, 218, 0.12); color: #64ffda; border: 1px solid rgba(100, 255, 218, 0.3); }
.status-opened { background: rgba(100, 255, 218, 0.2); color: #64ffda; border: 1px solid rgba(100, 255, 218, 0.4); }
.status-clicked { background: rgba(100, 255, 218, 0.25); color: #64ffda; border: 1px solid rgba(100, 255, 218, 0.5); }
.status-queued { background: rgba(136, 146, 176, 0.15); color: #8892b0; border: 1px solid rgba(136, 146, 176, 0.3); }
.status-processing { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.status-bounced { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.status-failed { background: rgba(255, 107, 107, 0.12); color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.3); }
.status-deferred { background: rgba(251, 191, 36, 0.1); color: #f59e0b; border: 1px solid rgba(251, 191, 36, 0.25); }
.status-active { background: rgba(100, 255, 218, 0.12); color: #64ffda; border: 1px solid rgba(100, 255, 218, 0.3); }
.status-revoked { background: rgba(136, 146, 176, 0.15); color: #8892b0; border: 1px solid rgba(136, 146, 176, 0.3); }
.status-disabled { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.status-inactive { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }

/* Preview button */
.btn-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--onm-text-muted);
  transition: all 0.2s ease;
}
.btn-preview:hover {
  color: var(--onm-accent);
  background: rgba(100, 255, 218, 0.1);
}

/* Glass card header (inside glass-card with p-0) */
.glass-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--onm-glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.glass-card-header h5 {
  margin-bottom: 0;
  color: #e6f1ff;
  font-weight: 600;
}

/* Enhanced table styling for glass cards */
.table.align-middle {
  --bs-table-bg: transparent;
  --bs-table-color: var(--onm-text);
  --bs-table-hover-bg: rgba(100, 255, 218, 0.03);
  --bs-table-hover-color: var(--onm-text);
}
.table.align-middle thead tr {
  background: rgba(10, 22, 40, 0.6);
}
.table.align-middle thead th {
  color: var(--onm-text-muted);
  border-bottom: 1px solid var(--onm-glass-border);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.table.align-middle tbody td {
  color: var(--onm-text);
  border-bottom: 1px solid rgba(100, 255, 218, 0.06);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.table.align-middle tbody tr {
  background: rgba(17, 34, 64, 0.4);
}
.table.align-middle tbody tr:nth-child(even) {
  background: rgba(17, 34, 64, 0.6);
}

/* Pagination styling */
.pagination .page-link {
  background: var(--onm-input-bg);
  border-color: var(--onm-glass-border);
  color: var(--onm-text-muted);
  border-radius: 8px;
  margin: 0 2px;
}
.pagination .page-link:hover {
  background: rgba(100, 255, 218, 0.1);
  border-color: var(--onm-accent);
  color: var(--onm-accent);
}
.pagination .page-item.active .page-link {
  background: var(--onm-btn-primary);
  border-color: transparent;
  color: var(--onm-btn-primary-text);
}
.pagination .page-item.disabled .page-link {
  background: rgba(17, 34, 64, 0.3);
  border-color: transparent;
  color: rgba(136, 146, 176, 0.4);
}

/* Profile / Manage nav */
.manage-nav .nav-link {
  color: var(--onm-text-muted);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
}

.manage-nav .nav-link:hover {
  color: var(--onm-accent);
  background: rgba(100, 255, 218, 0.05);
}

.manage-nav .nav-link.active {
  color: var(--onm-btn-primary-text);
  background: var(--onm-btn-primary);
  font-weight: 600;
}

/* Alerts */
.alert-success {
  background: rgba(100, 255, 218, 0.1);
  border-color: rgba(100, 255, 218, 0.3);
  color: var(--onm-accent);
}

.alert-danger {
  background: rgba(255, 100, 100, 0.1);
  border-color: rgba(255, 100, 100, 0.3);
  color: #ff6b6b;
}

/* Badge */
.badge-glass {
  background: rgba(100, 255, 218, 0.15);
  color: var(--onm-accent);
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Utility */
.text-accent {
  color: var(--onm-accent) !important;
}

.bg-glass {
  background: var(--onm-glass-bg);
  backdrop-filter: blur(16px);
}

/* Override Bootstrap for dark theme */
.btn-primary {
  background: var(--onm-btn-primary);
  border: none;
  color: var(--onm-btn-primary-text);
  font-weight: 600;
  border-radius: 10px;
}

.btn-primary:hover {
  background: var(--onm-btn-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(100, 255, 218, 0.25);
  color: var(--onm-btn-primary-text);
}

.btn-outline-secondary {
  color: var(--onm-text-muted);
  border-color: var(--onm-text-muted);
  border-radius: 10px;
}

.btn-outline-secondary:hover {
  color: var(--onm-accent);
  border-color: var(--onm-accent);
  background: rgba(100, 255, 218, 0.05);
}

.btn-copy {
  min-width: 88px;
  font-size: 0.8rem;
}

.btn-copy.is-copied {
  color: var(--onm-accent);
  border-color: var(--onm-accent);
  background: rgba(100, 255, 218, 0.08);
}

.text-muted {
  color: var(--onm-text-muted) !important;
}

h1, h2, h3, h4, h5, h6 {
  color: #e6f1ff;
}

.card {
  background: var(--onm-card-bg);
  border: 1px solid var(--onm-glass-border);
  color: var(--onm-text);
}

.card .card-header {
  background: rgba(17, 34, 64, 0.5) !important;
  border-bottom: 1px solid var(--onm-glass-border);
  color: var(--onm-text);
}

.bg-light {
  background: var(--onm-input-bg) !important;
  color: var(--onm-text) !important;
}

pre, code {
  color: var(--onm-text);
}

textarea.form-control {
  background: var(--onm-input-bg) !important;
  color: var(--onm-text) !important;
}

.form-control-plaintext {
  color: var(--onm-text) !important;
}

.text-danger {
  color: #ff6b6b !important;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--onm-text-muted);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Dropdown menus */
.dropdown-menu {
  background: var(--onm-secondary);
  border: 1px solid var(--onm-glass-border);
  border-radius: 12px;
  box-shadow: var(--onm-glass-shadow);
  z-index: 1050;
}

.dropdown-item {
  color: var(--onm-text-muted);
  border-radius: 8px;
  padding: 0.5rem 1rem;
}

.dropdown-item:hover, .dropdown-item:focus {
  color: var(--onm-accent);
  background: rgba(100, 255, 218, 0.05);
}

.dropdown-divider {
  border-color: var(--onm-glass-border);
}