/* Global Variables & Design Tokens */
:root {
  --bg-color: #0b0f19;
  --panel-bg: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-focus: rgba(99, 102, 241, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.3);
  
  --accent-blue: #0ea5e9;
  --accent-purple: #a855f7;
  
  --success: #10b981; /* Green */
  --success-glow: rgba(16, 185, 129, 0.2);
  --error: #ef4444; /* Red */
  --error-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b; /* Amber */
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Outfit', sans-serif;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Animated Floating Background Orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  animation: floatOrb 25s infinite alternate ease-in-out;
}

.bg-orb-purple {
  background: var(--accent-purple);
  width: 50vw;
  height: 50vw;
  top: -10vw;
  left: -10vw;
}

.bg-orb-blue {
  background: var(--primary);
  width: 45vw;
  height: 45vw;
  bottom: -5vw;
  right: -5vw;
  animation-delay: -5s;
  animation-duration: 30s;
}

.bg-orb-pink {
  background: #ec4899;
  width: 35vw;
  height: 35vw;
  top: 30%;
  left: 45%;
  animation-delay: -10s;
  animation-duration: 20s;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(8vw, 5vw) scale(1.15);
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Typography Helpers */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Layout Shell */
#app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism Containers */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  border-radius: var(--radius-lg);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Navigation Header */
header.app-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
  animation: slideDown 0.6s ease-out;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-logo i {
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary));
}

.header-user {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.user-badge-name {
  font-weight: 500;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge-alias {
  font-size: 0.8rem;
  color: var(--accent-blue);
  background: rgba(14, 165, 233, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Custom Interactive Buttons */
.btn {
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  color: var(--text-primary);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
  background: linear-gradient(135deg, #7073f4 0%, #b36bf9 100%);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error);
}

.btn-danger:hover {
  background: var(--error);
  color: var(--text-primary);
  box-shadow: 0 4px 15px var(--error-glow);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Authentication Layout (Form Wrapper) */
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.6s ease-out;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  padding: 3rem;
  text-align: center;
}

.auth-card-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-card-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

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

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  width: 20px;
  height: 20px;
}

.form-control {
  width: 100%;
  font-family: var(--font-family);
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
  background: rgba(0, 0, 0, 0.4);
}

.toggle-password {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
}

.toggle-password:hover {
  color: var(--text-primary);
}

.form-footer {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.form-link:hover {
  color: var(--accent-purple);
  text-decoration: underline;
}

/* Dashboard Panel Layout */
.dashboard-container {
  max-width: 1300px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 2rem;
  flex: 1;
  animation: fadeIn 0.8s ease-out;
}

@media (max-width: 1024px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dashboard-card {
  padding: 2rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 0.75rem;
}

.card-title i {
  color: var(--primary);
}

/* Profile Section */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.profile-name {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.profile-email {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-enabled {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-disabled {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Alias Claimer styles */
.alias-input-group {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.5rem 0.35rem 1rem;
  transition: var(--transition-smooth);
}

.alias-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
  background: rgba(0, 0, 0, 0.4);
}

.alias-input-prefix {
  font-family: var(--font-family);
  font-size: 1.1rem;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  flex: 1;
  width: 100%;
}

.alias-input-suffix {
  color: var(--text-secondary);
  font-weight: 500;
  padding-right: 0.5rem;
  font-size: 1rem;
}

.alias-status-hint {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.alias-available {
  color: var(--success);
}

.alias-unavailable {
  color: var(--error);
}

.alias-checking {
  color: var(--warning);
}

.claimed-alias-box {
  background: rgba(14, 165, 233, 0.05);
  border: 1px dashed rgba(14, 165, 233, 0.3);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: 1.5rem;
}

.claimed-alias-address {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.claimed-alias-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Timeline Audit Log styling */
.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.audit-item {
  display: flex;
  gap: 1rem;
  position: relative;
}

.audit-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.audit-marker-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.audit-marker-fail {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.audit-marker-info {
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.audit-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.audit-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.15rem;
}

.audit-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.audit-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.audit-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.audit-ip {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Modal overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 10, 17, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  width: 100%;
  max-width: 540px;
  padding: 2.5rem;
  position: relative;
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* MFA Verification Grid Code boxes */
.mfa-code-grid {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.mfa-digit-input {
  width: 50px;
  height: 60px;
  font-family: var(--font-family);
  font-size: 1.8rem;
  font-weight: 600;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.mfa-digit-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
  background: rgba(0, 0, 0, 0.5);
}

/* Recovery codes listing */
.recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.recovery-code-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 1rem;
  text-align: center;
  color: var(--accent-purple);
  letter-spacing: 0.05em;
  user-select: all;
}

.mfa-qr-container {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

.mfa-qr-canvas {
  background: white;
  padding: 12px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.mfa-secret-text {
  font-family: monospace;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
  word-break: break-all;
  margin-top: 0.5rem;
  color: var(--text-secondary);
}

/* Alert Banner */
.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  line-height: 1.4;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* UI feedback effects */
.pulse-glow {
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.2); }
  100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.5); }
}
