/* ============================================
   PhoenixGroup CSV Converter — Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(24, 34, 56, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-border: rgba(255, 255, 255, 0.08);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #8b5cf6;
  --accent-secondary: #6366f1;
  --accent-glow: rgba(139, 92, 246, 0.3);
  --accent-glow-strong: rgba(139, 92, 246, 0.5);

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --container-max: 1200px;
  --section-padding: 6rem 2rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-primary);
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-normal);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
}

.navbar-user span {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px var(--accent-glow-strong);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.btn-google {
  background: white;
  color: #333;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-google:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.btn-google svg {
  width: 18px;
  height: 18px;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  box-shadow: 0 6px 25px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- Cards / Glass panels ---------- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.glass-card-glow {
  position: relative;
}

.glass-card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-primary), transparent, var(--accent-secondary));
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: -1;
}

.glass-card-glow:hover::before {
  opacity: 0.3;
}

/* ---------- Container ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ============================================
   LANDING PAGE
   ============================================ */

/* --- Hero Section --- */
.hero {
  padding: 10rem 2rem 6rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-primary);
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent-primary), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Features Section --- */
.features {
  padding: var(--section-padding);
  position: relative;
  z-index: 1;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

.feature-card {
  padding: 2rem;
  text-align: center;
}

.feature-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform var(--transition-normal);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Pricing Section --- */
.pricing {
  padding: var(--section-padding);
  text-align: center;
  position: relative;
  z-index: 1;
}

.pricing h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.pricing .subtitle {
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.pricing-card {
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.pricing-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--border-light), var(--text-muted));
}

.pricing-card-featured {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.1);
}

.pricing-card-featured::after {
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.pricing-badge {
  position: absolute;
  top: 22px;
  right: -32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 0.3rem 0;
  width: 140px;
  text-align: center;
  transform: rotate(45deg);
}

.pricing-amount {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.pricing-label {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 2.5rem;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.pricing-features li .check {
  color: var(--success);
  font-weight: 700;
  font-size: 1.1rem;
}

.payment-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#paypal-button-container {
  min-height: 45px;
}

.payment-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* --- Auth Section (login prompt) --- */
.auth-section {
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.auth-section p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

#google-signin-btn {
  display: inline-flex;
}

/* --- Footer --- */
.footer {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
}

.footer a {
  color: var(--text-secondary);
}

/* ============================================
   DASHBOARD PAGE
   ============================================ */

.dashboard {
  padding: 6rem 2rem 3rem;
  max-width: var(--container-max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.dashboard-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-panel {
  padding: 1.75rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.panel-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Upload Zone --- */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.05);
}

.upload-zone.drag-over {
  box-shadow: 0 0 30px var(--accent-glow);
}

.upload-zone.has-file {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.upload-zone h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.upload-zone p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.upload-filename {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--success);
  font-weight: 500;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* --- Rounding Settings --- */
.settings-panel {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.settings-row label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.threshold-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.threshold-input input[type="range"] {
  width: 120px;
  accent-color: var(--accent-primary);
}

.threshold-input .threshold-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-primary);
  min-width: 35px;
  text-align: center;
}

.rounding-preview {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(139, 92, 246, 0.05);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rounding-preview span {
  color: var(--accent-primary);
  font-weight: 600;
}

/* --- Sealed Products Section --- */
.sealed-section {
  grid-column: 1 / -1;
}

.sealed-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sealed-banner .icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.sealed-products-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sealed-product-row {
  display: grid;
  grid-template-columns: 1fr 1fr 80px 100px 140px 100px 160px auto;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

@media (max-width: 1100px) {
  .sealed-product-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.85rem;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-group select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sealed-image-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.sealed-image-status.found {
  color: var(--success);
}

.sealed-image-status.not-found {
  color: var(--warning);
}

.sealed-image-status.error {
  color: var(--error);
}

.btn-remove-sealed {
  align-self: end;
  padding: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--error);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-fast);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-sealed:hover {
  background: rgba(239, 68, 68, 0.2);
}

.add-sealed-btn {
  margin-top: 0.75rem;
}

/* --- Convert Button Area --- */
.convert-section {
  margin-top: 1.5rem;
  text-align: center;
}

.convert-section .btn {
  min-width: 300px;
}

/* --- Progress Bar --- */
.progress-container {
  margin-top: 1.5rem;
  display: none;
}

.progress-container.active {
  display: block;
}

.progress-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 100px;
  width: 0%;
  transition: width var(--transition-normal);
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

/* --- Status Messages --- */
.status-message {
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 1rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.status-message.active {
  display: flex;
}

.status-message.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.status-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.status-message.info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--info);
}

/* --- Payment Required Overlay --- */
.payment-required {
  text-align: center;
  padding: 4rem 2rem;
}

.payment-required h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.payment-required p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 4px 15px var(--accent-glow);
  }

  50% {
    box-shadow: 0 4px 30px var(--accent-glow-strong);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease both;
}

.animate-fade-in {
  animation: fadeIn 0.4s ease both;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

.delay-4 {
  animation-delay: 0.4s;
}

/* ---------- Utilities ---------- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

/* ---------- Loading Spinner ---------- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  .hero {
    padding: 7rem 1.5rem 4rem;
  }

  .pricing-card {
    padding: 2rem;
  }

  .dashboard {
    padding: 5rem 1rem 2rem;
  }

  .sealed-product-row {
    grid-template-columns: 1fr;
  }

  .convert-section .btn {
    min-width: 100%;
  }
}