/* ============================================
 * FreemiumPDF Portal — Dark Mode Stylesheet
 * Matches the existing landing page aesthetic.
 * ============================================ */

/* ── Reset & Variables ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors — Deep navy/violet dark mode */
  --bg-primary: #0a0a1a;
  --bg-secondary: #10102a;
  --bg-card: rgba(22, 22, 52, 0.7);
  --bg-card-hover: rgba(30, 30, 64, 0.8);
  --bg-input: rgba(30, 30, 60, 0.5);

  --text-primary: #f0f0ff;
  --text-secondary: #a0a0c8;
  --text-muted: #6b6b9a;

  --accent-primary: #8b5cf6;
  --accent-primary-hover: #7c3aed;
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #6366f1);
  --accent-glow: rgba(139, 92, 246, 0.3);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);

  --border-color: rgba(139, 92, 246, 0.15);
  --border-hover: rgba(139, 92, 246, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-primary-hover);
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
  color: white;
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

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

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* ── Google Login Button ── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: white;
  color: #1f1f1f;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-family);
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-google:hover {
  background: #f8f8f8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #1f1f1f;
}

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

/* ── Auth Page ── */
.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

.auth-container {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.auth-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
}

.auth-glow-1 {
  width: 300px;
  height: 300px;
  background: var(--accent-primary);
  top: -100px;
  right: -100px;
  animation: float 8s ease-in-out infinite;
}

.auth-glow-2 {
  width: 250px;
  height: 250px;
  background: #6366f1;
  bottom: -80px;
  left: -80px;
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

.auth-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 56px;
  height: 56px;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
}

.auth-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ── Alert ── */
.alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Dashboard Page ── */
.dashboard-page,
.settings-page {
  flex: 1;
  padding: 2rem 0 4rem;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  object-fit: cover;
}

.user-avatar-lg {
  width: 80px;
  height: 80px;
}

.user-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
}

.user-info h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.text-muted {
  color: var(--text-secondary);
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* ── Subscription Badge ── */
.subscription-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-active {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-inactive {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Dashboard Grid ── */
.dashboard-grid,
.settings-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(10px);
  transition: border-color var(--transition);
}

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

.card-main {
  grid-column: 1;
}

.card-side {
  grid-column: 2;
}

.card-full {
  grid-column: 1 / -1;
}

.card-danger {
  border-color: rgba(239, 68, 68, 0.15);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.card-title-row h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card-icon-success {
  background: var(--success-bg);
  color: var(--success);
}

.card-icon-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

/* ── Price Display ── */
.price-display {
  margin: 1.5rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.price-amount {
  font-size: 2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.price-period {
  font-size: 1rem;
  color: var(--text-muted);
}

/* ── Feature List ── */
.feature-list {
  list-style: none;
  margin: 1.5rem 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.feature-list .check {
  color: var(--success);
  font-weight: 700;
}

/* ── Expiry Box ── */
.expiry-box {
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.expiry-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.expiry-date {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--success);
}

.expiry-countdown {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.expiry-countdown.expired {
  color: var(--danger);
}

/* ── QRIS Section ── */
.qris-section {
  margin-top: 2rem;
  text-align: center;
}

.qris-header h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.qris-wrapper {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem auto;
  max-width: 280px;
}

.qris-image {
  width: 100%;
  height: auto;
  display: block;
}

.qris-amount {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 1rem 0;
}

.qris-amount strong {
  color: var(--text-primary);
  font-size: 1.25rem;
}

.qris-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ── Quick Links ── */
.quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
}

.quick-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.quick-link-danger:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

/* ── Profile Info ── */
.profile-info {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.profile-details {
  flex: 1;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.detail-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ── Data Table ── */
.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.05);
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: rgba(139, 92, 246, 0.03);
}

/* ── Status Badge ── */
.status-badge {
  display: inline-flex;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-paid {
  background: var(--success-bg);
  color: var(--success);
}

.status-unpaid {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-expired,
.status-failed {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.95rem;
}

/* ── Spinner ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Footer ── */
.footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.footer-brand a {
  color: var(--accent-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .dashboard-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .card-main,
  .card-side,
  .card-full {
    grid-column: 1;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .detail-row {
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
  }

  .nav-links {
    gap: 0.75rem;
  }

  .auth-card {
    padding: 1.75rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .user-info h1 {
    font-size: 1.2rem;
  }

  .price-amount {
    font-size: 1.75rem;
  }
}
