/* ================================================
   THE FILM VFX — Auth & Dashboard Styles
   ================================================ */

/* ─── Auth Pages ─────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030712;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: 16px;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-decoration: none;
}

.auth-logo .brand-top {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: #94a3b8;
}

.auth-logo .brand-vfx {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #06B6D4, #F59E0B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: #94a3b8;
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
}

.form-group input {
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.form-group input:focus {
  outline: none;
  border-color: #06B6D4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-group input::placeholder {
  color: #475569;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  display: none;
}

.auth-error.visible {
  display: block;
}

.auth-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  display: none;
}

.auth-success.visible {
  display: block;
}

.btn-auth {
  padding: 0.85rem;
  background: linear-gradient(135deg, #06B6D4, #0891B2);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.btn-auth:hover {
  background: linear-gradient(135deg, #0891B2, #0E7490);
  transform: translateY(-1px);
}

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

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

.auth-footer a {
  color: #06B6D4;
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.password-requirements {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: -0.25rem;
}

/* ─── Dashboard ──────────────────────────────── */
.dashboard-page {
  min-height: 100vh;
  background: #030712;
  color: #f1f5f9;
}

.dash-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.dash-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.dash-nav-logo .brand-vfx {
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #06B6D4, #F59E0B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.dash-credits {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.9rem;
}

.dash-user {
  color: #94a3b8;
  font-size: 0.9rem;
}

.btn-signout {
  background: none;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.btn-signout:hover {
  border-color: #ef4444;
  color: #f87171;
}

/* Dashboard Content */
.dash-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.dash-welcome {
  margin-bottom: 2rem;
}

.dash-welcome h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dash-welcome p {
  color: #94a3b8;
}

/* Tab Navigation */
.dash-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
}

.dash-tab:hover {
  color: #cbd5e1;
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.dash-tab.active {
  color: #06B6D4;
  border-bottom-color: #06B6D4;
}

.dash-tab svg {
  flex-shrink: 0;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: tabFadeIn 0.25s ease-out;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Overview Quick Actions */
.overview-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.overview-action-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.overview-action-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.04);
  transform: translateY(-1px);
}

.overview-action-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, 0.1);
  border-radius: 12px;
  color: #06B6D4;
}

.overview-action-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 0.15rem;
}

.overview-action-card p {
  font-size: 0.8rem;
  color: #64748b;
}

/* Stats Cards */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
}

.stat-card-label {
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
}

.stat-card-value.credits {
  color: #fbbf24;
}

.stat-card-value.revenue {
  color: #34d399;
}

/* Sections */
.dash-section {
  margin-bottom: 2.5rem;
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.dash-section-title {
  font-size: 1.2rem;
  font-weight: 600;
}

/* Purchase Section */
.purchase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.purchase-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.purchase-card:hover {
  border-color: #06B6D4;
  transform: translateY(-2px);
}

.purchase-card.featured {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.05);
}

.purchase-card .badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: linear-gradient(135deg, #06B6D4, #0891B2);
  color: white;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.purchase-amount {
  font-size: 2rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.25rem;
}

.purchase-amount .currency {
  font-size: 1.2rem;
  color: #94a3b8;
}

.purchase-credits {
  color: #fbbf24;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.purchase-bonus {
  font-size: 0.8rem;
  color: #34d399;
}

/* Custom Amount */
.custom-purchase {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
}

.custom-purchase-header {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #cbd5e1;
}

.custom-purchase-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.custom-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.custom-input-group label {
  font-size: 0.8rem;
  color: #64748b;
}

.custom-input-group input {
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  width: 100%;
}

.custom-input-group input:focus {
  outline: none;
  border-color: #06B6D4;
}

.custom-result {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.custom-result-credits {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fbbf24;
  white-space: nowrap;
}

.custom-result-bonus {
  font-size: 0.85rem;
  color: #34d399;
  white-space: nowrap;
}

.btn-purchase {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #06B6D4, #0891B2);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}

.btn-purchase:hover {
  background: linear-gradient(135deg, #0891B2, #0E7490);
}

.btn-purchase:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Download Section */
.download-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.download-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.download-card .os-icon {
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.download-card p {
  color: #94a3b8;
  font-size: 0.85rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #06B6D4;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
}

.btn-download:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06B6D4;
}

/* Transaction History */
.transactions-table {
  width: 100%;
  border-collapse: collapse;
}

.transactions-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.transactions-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}

.tx-credits-pos {
  color: #34d399;
  font-weight: 600;
}

.tx-credits-neg {
  color: #f87171;
  font-weight: 600;
}

.tx-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tx-type-purchase {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

.tx-type-usage {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

.tx-type-refund {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

.tx-type-admin {
  background: rgba(139, 92, 246, 0.1);
  color: #a78bfa;
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .auth-card {
    padding: 1.5rem;
  }

  .dash-nav {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .dash-content {
    padding: 1rem;
  }

  .dash-stats {
    grid-template-columns: 1fr 1fr;
  }

  .download-section {
    grid-template-columns: 1fr;
  }

  .custom-purchase-form {
    flex-direction: column;
  }

  .purchase-grid {
    grid-template-columns: 1fr;
  }

  .dash-tabs {
    gap: 0;
  }

  .dash-tab {
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
  }

  .dash-tab span {
    display: none;
  }

  .overview-actions {
    grid-template-columns: 1fr;
  }
}

/* ─── Generations ────────────────────────────── */
.gen-filters {
  display: flex;
  gap: 0.5rem;
}

.gen-filter {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.gen-filter:hover {
  border-color: rgba(6,182,212,0.3);
  color: #e2e8f0;
}

.gen-filter.active {
  background: rgba(6,182,212,0.15);
  border-color: #06B6D4;
  color: #06B6D4;
}

.gen-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(6,182,212,0.05);
  border: 1px solid rgba(6,182,212,0.1);
  border-radius: 12px;
}

.gen-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.gen-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f1f5f9;
}

.gen-stat-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.gen-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem;
  color: #64748b;
  text-align: center;
}

.gen-card {
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.gen-card:hover {
  border-color: rgba(6,182,212,0.3);
  transform: translateY(-2px);
}

.gen-card-preview {
  aspect-ratio: 16/10;
  background: #0a0f1a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gen-card-preview img,
.gen-card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gen-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,0.8);
}

.spinner-small {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(6,182,212,0.2);
  border-top-color: #06B6D4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.gen-card-info {
  padding: 0.75rem 1rem;
}

.gen-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.gen-card-type {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #06B6D4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gen-card-status {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 500;
}

.gen-status-completed {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}

.gen-status-processing {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
}

.gen-status-failed {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}

.gen-card-prompt {
  font-size: 0.85rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.4rem;
}

.gen-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
}

.install-hint {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}

.install-hint code {
  display: inline-block;
  margin-top: 0.25rem;
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  color: #06B6D4;
  word-break: break-all;
}

@media (max-width: 640px) {
  .gen-grid {
    grid-template-columns: 1fr 1fr;
  }
  .gen-stats {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .gen-filters {
    flex-wrap: wrap;
  }
  .dash-section-header {
    flex-direction: column;
    gap: 0.75rem;
  }
}
