@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Plus Jakarta Sans', monospace;
  
  --bg-canvas: #060810;
  --bg-glass: rgba(11, 19, 43, 0.72);
  --bg-glass-elevated: rgba(18, 28, 58, 0.78);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(56, 189, 248, 0.38);
  
  --primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-glow: rgba(14, 165, 233, 0.45);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-glass: 0 10px 30px -5px rgba(0, 0, 0, 0.6), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 25px var(--accent-glow);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-canvas);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(14, 165, 233, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(79, 70, 229, 0.12) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #7dd3fc;
}

/* Glass Cards */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  border-color: var(--border-glass-hover);
}

.glass-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 14px;
}

.glass-header h2, .glass-header h3 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* High-Impact Glass Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Glass Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-cyan);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

select.form-control option {
  background: #0f172a;
  color: #ffffff;
}

/* App Layout */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
  width: 260px;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-section {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.5);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-size: 0.93rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: #ffffff;
  background: var(--primary-gradient);
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.35);
}

.nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-glass);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Main Content Area */
.app-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.app-topbar {
  height: 72px;
  background: rgba(10, 15, 29, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.user-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-cyan);
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Container Body */
.app-content {
  padding: 32px;
  flex: 1;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-cyan);
}

.stat-info .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-info .stat-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
}

/* High Contrast Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.glass-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.glass-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 18px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-glass);
}

.glass-table td {
  padding: 14px 18px;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.glass-table td code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.glass-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-completed, .badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-inprogress, .badge-processing {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.badge-canceled, .badge-deactive {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-content, .modal-card {
  background: #0b1329;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.9);
  width: 92%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 26px;
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 10000;
}

.modal-overlay.active .modal-content,
.modal-overlay.active .modal-card {
  transform: translateY(0);
}

/* Mobile Responsive */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 991px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  
  .app-sidebar.open {
    transform: translateX(0);
  }
  
  .app-main {
    margin-left: 0;
  }
  
  .mobile-toggle {
    display: block;
  }
  
  .app-content {
    padding: 20px 16px;
  }
  
  .app-topbar {
    padding: 0 16px;
  }
}

/* Theme Accents Dynamic Overrides */
body[data-theme-accent="purple"] {
  --primary-gradient: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  --accent-cyan: #c084fc;
  --accent-blue: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.45);
  --border-glass-hover: rgba(192, 132, 252, 0.35);
}
body[data-theme-accent="emerald"] {
  --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --accent-cyan: #34d399;
  --accent-blue: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.45);
  --border-glass-hover: rgba(52, 211, 153, 0.35);
}
body[data-theme-accent="amber"] {
  --primary-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --accent-cyan: #fbbf24;
  --accent-blue: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.45);
  --border-glass-hover: rgba(251, 191, 36, 0.35);
}

.accent-btn.active {
  border-color: #ffffff !important;
  box-shadow: 0 0 14px var(--accent-glow) !important;
  transform: translateY(-2px);
}
.anim-mode-btn.active {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Public Layout & Landing Page */
.public-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 16px 0;
}

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.public-nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.public-nav-link:hover, .public-nav-link.active {
  color: #ffffff;
}

.hero-section {
  padding: 90px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 22px;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 60px 0;
}

.stat-item {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 40px 0;
}

.feature-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: all 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glass-hover);
  box-shadow: 0 12px 30px -10px var(--accent-glow);
}

.feature-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.public-footer {
  border-top: 1px solid var(--border-glass);
  background: rgba(3, 7, 18, 0.85);
  padding: 50px 0 30px;
  margin-top: 80px;
}

@media (max-width: 991px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .public-nav-links {
    display: none;
  }
}
