:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #273549;
  --border: #334155;
  --border-focus: #6366f1;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;
  --sidebar-width: 260px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Utilities */
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.btn-gradient {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.4);
}

.btn-gradient:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-secondary);
}

/* App Container */
#app {
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  background: transparent;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-icon-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.brand-full-logo {
  height: 36px;
  max-width: 180px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}

.brand-full-logo:hover {
  transform: scale(1.03);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 10px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: auto;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.3);
  font-weight: 600;
}

.nav-icon {
  font-size: 18px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.streak-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.streak-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.streak-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-amber);
}

/* Main Content Area */
.main-content {
  flex: 1;
  background: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: #fff;
}

.member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent);
}

.member-tier-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  text-transform: uppercase;
}

.content-body {
  padding: 32px;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Cards & Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-control, .input-field {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus, .input-field:focus {
  border-color: var(--border-focus);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Straight Line Calibration */
.straight-line-box {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, rgba(15, 23, 42, 0.5) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.particle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Tier Cards */
.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.2s ease;
}

.tier-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.tier-card.featured {
  border: 2px solid var(--accent);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.15) 0%, rgba(30, 41, 59, 1) 100%);
}

.tier-badge {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.tier-price {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin: 12px 0;
}

.tier-price span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.tier-features {
  list-style: none;
  margin: 16px 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.tier-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.tier-features li .check-icon {
  color: var(--accent-green);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.tier-features li .cross-icon {
  color: #ef4444;
  font-weight: 800;
  font-size: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}

.tier-features li.not-included {
  color: var(--text-muted);
  opacity: 0.5;
  text-decoration: line-through;
}

/* Value Ladder Comparison Matrix Table */
.comparison-matrix-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  margin-top: 32px;
  padding: 8px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.matrix-table th {
  padding: 16px 14px;
  border-bottom: 2px solid var(--border);
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.6);
}

.matrix-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.matrix-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.matrix-feature-name {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 220px;
}

.matrix-cell-center {
  text-align: center;
  font-weight: 700;
}

.cell-yes {
  color: var(--accent-green);
  font-size: 16px;
}

.cell-no {
  color: #ef4444;
  opacity: 0.45;
  font-size: 16px;
}

/* Book Reader */
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.book-cover {
  height: 140px;
  background: var(--accent-gradient);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.book-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.book-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

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

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-google:hover {
  background: #f3f4f6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider span {
  padding: 0 12px;
}

/* Footer & Trust Seal */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: auto;
}

.jas-brand-seal {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.jas-logo-img {
  height: 38px;
  max-width: 150px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}

.jas-logo-img:hover {
  transform: scale(1.05);
}

.jas-text-wrap {
  display: flex;
  flex-direction: column;
}

.jas-powered-by {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jas-company-name {
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8;
}

.gateway-trust-seal {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  #app {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .nav-menu {
    flex-direction: row;
    overflow-x: auto;
  }
  .app-footer {
    flex-direction: column;
    text-align: center;
  }
}
