/* UI/UX Promax Advanced Design System for Email API Dashboard */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #080b11;
  --bg-gradient: radial-gradient(circle at 50% 0%, #151a2e 0%, #080b11 70%);
  --panel-bg: rgba(17, 24, 43, 0.45);
  --panel-hover: rgba(25, 34, 58, 0.6);
  --border-color: rgba(255, 255, 255, 0.05);
  --border-glow: rgba(99, 102, 241, 0.15);
  
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  
  --accent: #d946ef;
  --accent-gradient: linear-gradient(135deg, #d946ef 0%, #a21caf 100%);
  --accent-glow: rgba(217, 70, 239, 0.25);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.25);
  
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.25);
  
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

body {
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* Custom Typography */
h1, h2, h3, h4, h5, h6, .brand-name, .page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* Glassmorphism Styles */
.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass:hover {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

/* Premium Card Accent Borders */
.card-glow {
  position: relative;
}
.card-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.card-glow:hover::before {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(217, 70, 239, 0.05) 100%);
}

/* Navigation Sidebar */
aside {
  width: 280px;
  background: rgba(8, 11, 17, 0.6);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 10;
}

.aside-header {
  padding: 28px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 10px;
  box-shadow: 0 0 20px var(--primary-glow);
  position: relative;
}
.logo-icon::after {
  content: '';
  position: absolute;
  top: 25%; left: 25%;
  width: 50%; height: 50%;
  border: 2px solid white;
  border-radius: 4px;
  transform: rotate(45deg);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.aside-menu {
  flex: 1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.menu-item svg {
  opacity: 0.65;
  transition: transform 0.25s;
}

.menu-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}
.menu-item:hover svg {
  transform: translateX(2px);
  opacity: 1;
}

.menu-item.active {
  color: var(--text-primary);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.03) 100%);
  border-left: 3px solid var(--primary);
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.05);
}
.menu-item.active svg {
  color: var(--primary-light);
  opacity: 1;
}

.aside-footer {
  padding: 20px 16px;
  border-top: 1px solid var(--border-color);
}

.profile-card {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(217, 70, 239, 0.2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary-light);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.profile-details {
  flex: 1;
  overflow: hidden;
}

.profile-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.profile-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  transform: scale(1.05);
}

/* Main Canvas */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

header {
  height: 80px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(8, 11, 17, 0.4);
  backdrop-filter: blur(10px);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
}

/* Metrics and Cards Grid */
.grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  margin-bottom: 40px;
}

.metric-card {
  padding: 28px;
  position: relative;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.metric-val {
  font-size: 2.25rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: linear-gradient(to right, #ffffff, #e5e7eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Custom Charts styling */
.graph-container {
  padding: 28px;
  margin-bottom: 40px;
}

/* Table grid style improvements */
.table-card {
  padding: 28px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

th {
  color: var(--text-secondary);
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.01);
}

tr td {
  transition: background-color 0.2s;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

/* Pulsing indicators */
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.pulse-dot.success {
  background-color: var(--success);
  box-shadow: 0 0 12px var(--success-glow);
}
.pulse-dot.success::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid var(--success);
  animation: pulse-ring 1.8s infinite ease-in-out;
}

.pulse-dot.warning {
  background-color: var(--warning);
  box-shadow: 0 0 12px var(--warning-glow);
}
.pulse-dot.warning::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid var(--warning);
  animation: pulse-ring 1.8s infinite ease-in-out;
}

.pulse-dot.danger {
  background-color: var(--danger);
  box-shadow: 0 0 12px var(--danger-glow);
}
.pulse-dot.danger::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid var(--danger);
  animation: pulse-ring 1.8s infinite ease-in-out;
}

.pulse-dot.unknown {
  background-color: var(--text-muted);
}

/* Dynamic forms styling */
.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  background: rgba(8, 11, 17, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  background: rgba(8, 11, 17, 0.6);
}

/* Button UI */
.btn {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
  filter: brightness(1.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

/* Badges */
.badge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.success { 
  background: rgba(16, 185, 129, 0.12); 
  color: #10b981; 
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.badge.failed { 
  background: rgba(239, 68, 68, 0.12); 
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

/* Document Environment Code Tab controls */
.docs-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Drawer Log Details Slider Panel */
.drawer {
  position: fixed;
  top: 0;
  right: -600px;
  width: 550px;
  height: 100%;
  z-index: 100;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  background: rgba(8, 11, 17, 0.8);
  border-left: 1px solid var(--border-color);
  box-shadow: none;
}

.drawer.open {
  right: 0;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.6);
}

.drawer-header {
  padding: 28px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.preview-frame {
  width: 100%;
  height: 320px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: white;
  margin-top: 14px;
}

.attachment-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  margin-top: 10px;
}

.attachment-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Overlays and Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 12, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 480px;
  max-width: 90%;
  padding: 40px;
}
