/* ═══════════════════════════════════════════════════════════════════
   PriceMy3D — Premium Dark Glassmorphism Theme
   ═══════════════════════════════════════════════════════════════════ */

/* ── Google Font ──────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── CSS Variables ────────────────────────────────────────────────── */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #0f0f2a;
  --bg-card: rgba(20, 20, 55, 0.6);
  --bg-card-hover: rgba(30, 30, 70, 0.7);
  --bg-input: rgba(15, 15, 40, 0.8);
  --bg-input-focus: rgba(20, 20, 50, 0.9);
  --border-subtle: rgba(99, 102, 241, 0.15);
  --border-accent: rgba(99, 102, 241, 0.4);
  --border-glow: rgba(99, 102, 241, 0.6);
  --text-primary: #e8e8f0;
  --text-secondary: #9d9db8;
  --text-muted: #6b6b8a;
  --text-inverse: #0a0a1a;
  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --accent-gradient-hover: linear-gradient(135deg, #7c7ff5, #a78bfa);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info: #3b82f6;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --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 20px rgba(99, 102, 241, 0.3);
  --shadow-glow-hover: 0 0 30px rgba(99, 102, 241, 0.5);
  --glass-bg: rgba(20, 20, 55, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 16px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
  --bg-primary: #f0f2f9;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-input: rgba(240, 242, 249, 0.8);
  --bg-input-focus: rgba(255, 255, 255, 1);
  --border-subtle: rgba(99, 102, 241, 0.12);
  --border-accent: rgba(99, 102, 241, 0.3);
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888aa;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(99, 102, 241, 0.1);
  --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.08);
  --shadow-md: 0 4px 16px rgba(99, 102, 241, 0.1);
  --shadow-lg: 0 8px 32px rgba(99, 102, 241, 0.12);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent-1);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-2);
}

/* ── Navbar ───────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.navbar-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-nav a {
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-sans);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  box-shadow: var(--shadow-glow-hover);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--accent-1);
}

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-google {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.btn-facebook {
  background: #1877f2;
  color: #fff;
}

/* ── Cards (Glassmorphism) ────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
  position: relative;
  z-index: 1;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.form-control:focus {
  outline: none;
  background: var(--bg-input-focus);
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

input[type="number"] {
  font-family: var(--font-mono);
  font-weight: 500;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-radius: var(--radius) 0 0 var(--radius);
  flex: 1;
}

.input-suffix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--border-subtle);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239d9db8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--accent-1);
  border-color: var(--accent-1);
}

.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(20px);
  background: #fff;
}

/* ── Section Headers ──────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-icon {
  width: 28px;
  height: 28px;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-1);
}

/* ── Result Values ────────────────────────────────────────────────── */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.result-row+.result-row {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.result-label {
  color: var(--text-secondary);
}

.result-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.result-value.negative {
  color: var(--danger);
}

.result-value.positive {
  color: var(--success);
}

.result-total {
  font-size: 1.2rem;
  font-weight: 800;
  padding: 0.75rem 0;
  border-top: 2px solid var(--border-accent);
  margin-top: 0.5rem;
}

.profit-display {
  text-align: center;
  padding: 1.5rem;
}

.profit-amount {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all var(--transition-slow);
}

.profit-amount.loss {
  background: linear-gradient(135deg, #ef4444, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
}

.margin-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.margin-badge.good {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.margin-badge.bad {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.margin-badge.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ── Calculator Layout ────────────────────────────────────────────── */
.calc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.calc-results {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 80px;
}

/* ── Hero Section ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 2rem 2rem;
  position: relative;
  z-index: 1;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-1) 50%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-1);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Pricing Cards ────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.pricing-card {
  text-align: center;
  padding: 2rem 1.5rem;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--accent-1);
  box-shadow: var(--shadow-glow);
  transform: scale(1.03);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gradient);
  color: #fff;
  padding: 0.25rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-price {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 1rem 0 0.25rem;
}

.pricing-period {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 2rem;
}

.pricing-features li {
  padding: 0.4rem 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.pricing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

.pricing-features li.disabled {
  color: var(--text-muted);
  text-decoration: line-through;
}

.pricing-features li.disabled::before {
  content: '✗';
  color: var(--danger);
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  padding: 3rem 2rem 1.5rem;
  margin-top: 4rem;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li+li {
  margin-top: 0.5rem;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent-1);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Auth Pages ───────────────────────────────────────────────────── */
.auth-container {
  max-width: 440px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.auth-card {
  padding: 2.5rem;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.social-buttons {
  display: flex;
  gap: 0.75rem;
}

.social-buttons .btn {
  flex: 1;
}

/* ── Comparison Table ─────────────────────────────────────────────── */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.comparison-table th {
  background: rgba(99, 102, 241, 0.1);
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--accent-1);
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.comparison-table tr:hover td {
  background: rgba(99, 102, 241, 0.04);
}

/* ── Animations ───────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: var(--shadow-glow);
  }

  50% {
    box-shadow: var(--shadow-glow-hover);
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

.animate-delay-1 {
  animation-delay: 0.1s;
}

.animate-delay-2 {
  animation-delay: 0.2s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

.pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* ── Go-to-top ────────────────────────────────────────────────────── */
.go-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition);
  z-index: 99;
}

.go-top.visible {
  display: flex;
}

.go-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow-hover);
}

/* ── Utilities ────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent-1);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.font-mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

/* ── Navbar Desktop (inline nav inside sticky navbar) ────────────── */
.navbar-desktop {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
}

.navbar-desktop .navbar-right {
  margin-left: auto;
}

/* ── Mobile Menu (outside navbar, avoids stacking context) ───────── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 9999;
  flex-direction: column;
  padding: 1.5rem;
  gap: 0.5rem;
  overflow-y: auto;
  border-top: 1px solid var(--border-subtle);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.mobile-menu-nav li a {
  display: block;
  padding: 0.9rem 1rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: var(--radius);
  transition: background var(--transition);
}

.mobile-menu-nav li a:hover,
.mobile-menu-nav li a.active {
  background: rgba(99, 102, 241, 0.12);
}

.mobile-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.5rem 0;
}

.mobile-menu .mobile-lang {
  width: 100%;
  padding: 0.65rem 0.75rem;
}

.mobile-menu .mobile-theme {
  width: 100%;
  height: auto;
  padding: 0.65rem;
  font-size: 1.1rem;
}

.mobile-menu .btn-block {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.75rem;
  font-size: 0.95rem;
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  backdrop-filter: blur(4px);
}

.nav-backdrop.open {
  display: block;
}

/* ── Hamburger Toggle ────────────────────────────────────────────── */
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 8px;
  cursor: pointer;
  z-index: 110;
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.navbar-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.navbar-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Tip Modal ────────────────────────────────────────────────────── */
.tip-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.tip-modal-overlay.visible {
  opacity: 1;
}

.tip-modal {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.15);
}

.tip-modal-overlay.visible .tip-modal {
  transform: scale(1) translateY(0);
}

.tip-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
}

.tip-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.tip-modal-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: tipSteam 2s ease-in-out infinite;
}

@keyframes tipSteam {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.tip-modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.tip-modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.tip-modal-amounts {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.tip-modal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  flex: 1;
}

.tip-modal-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-1);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
}

.tip-modal-btn-popular {
  border-color: var(--accent-1);
  background: rgba(99, 102, 241, 0.08);
}

.tip-modal-btn-popular:hover {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow-hover);
}

.tip-modal-btn-popular:hover .tip-label,
.tip-modal-btn-popular:hover .tip-emoji {
  color: #fff;
}

.tip-popular-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tip-emoji {
  font-size: 1.3rem;
}

.tip-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.tip-modal-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: color var(--transition);
  font-family: var(--font-sans);
}

.tip-modal-dismiss:hover {
  color: var(--text-primary);
}

/* ── Blog Cards ──────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}

.blog-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.blog-thumb {
  height: 160px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin: -1.5rem -1.5rem 1.25rem;
}

.blog-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-1);
  margin-bottom: 0.5rem;
}

.blog-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.blog-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.blog-read-more {
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-1);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ── Testimonials ────────────────────────────────────────────────── */
.testimonials-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.testimonial-card {
  text-align: left;
  padding: 1.5rem;
}

.testimonial-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 1rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.testimonial-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  font-weight: 700;
}

.testimonial-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.testimonial-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Margin Gauge ────────────────────────────────────────────────── */
.margin-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.5rem;
}

.margin-gauge {
  position: relative;
  width: 120px;
  height: 60px;
  overflow: hidden;
}

.margin-gauge canvas {
  width: 120px;
  height: 60px;
}

.margin-gauge-value {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ── Share & Export ──────────────────────────────────────────────── */
.action-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.action-bar .btn {
  flex: 1;
  font-size: 0.8rem;
  padding: 0.5rem;
}

/* ── Blog Article ────────────────────────────────────────────────── */
.article-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}

.article-container h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.article-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2rem 0 0.75rem;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}

.article-body p {
  margin-bottom: 1rem;
}

.article-body ul,
.article-body ol {
  margin: 1rem 0 1rem 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body strong {
  color: var(--text-primary);
}

.article-body blockquote {
  border-left: 3px solid var(--accent-1);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

.article-cta {
  background: var(--accent-gradient);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin: 2.5rem 0;
  color: #fff;
}

.article-cta h3 {
  color: #fff !important;
  margin-bottom: 0.5rem;
}

.article-cta p {
  opacity: 0.9;
  margin-bottom: 1rem;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
    z-index: 1000;
  }

  .navbar-toggle {
    display: flex;
  }

  .navbar-desktop {
    display: none;
  }

  body.nav-open {
    overflow: hidden;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-stats {
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .calc-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .calc-results {
    position: static;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .pricing-card.featured {
    transform: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    left: -240px;
    transition: left 0.3s;
    z-index: 200;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .social-buttons {
    flex-direction: column;
  }

  .action-bar {
    flex-direction: column;
  }

  .tip-amounts {
    flex-direction: column;
    align-items: center;
  }
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-1);
}

/* ── Affiliate Recommendations ──────────────────────────────────── */
#affiliateSection {
  margin-top: 0;
}

.affiliate-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.affiliate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  text-decoration: none;
  transition: all 0.2s ease;
  gap: 0.5rem;
}

.affiliate-item:hover {
  border-color: var(--accent-1);
  background: var(--bg-card-hover);
  transform: translateX(2px);
}

.affiliate-item .aff-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.affiliate-item .aff-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.affiliate-item .aff-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.affiliate-item .aff-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.affiliate-item .aff-price {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
}

.affiliate-item .aff-cta {
  font-size: 0.6rem;
  padding: 0.2rem 0.45rem;
  background: var(--accent-gradient);
  color: #fff;
  border-radius: 5px;
  font-weight: 600;
  white-space: nowrap;
}

.affiliate-disclosure {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.4rem;
  margin-bottom: 0;
  font-style: italic;
}