/* ═══════════════════════════════════════════
   Fragenta Profile — CSS
   Dark glassmorphism design, consistent with main site
   ═══════════════════════════════════════════ */

:root {
  --profile-bg: #050508;
  --profile-surface: rgba(15, 15, 22, 0.85);
  --profile-border: rgba(255, 255, 255, 0.08);
  --profile-text: #f0f0f5;
  --profile-text-muted: rgba(255, 255, 255, 0.5);
  --profile-accent: #8b5cf6;
  --profile-accent-light: #a78bfa;
  --profile-green: #34d399;
  --profile-radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--profile-bg);
  color: var(--profile-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.profile-container {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
}

/* ── Loading Screen ── */
.profile-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--profile-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 400ms ease, visibility 400ms ease;
}

.profile-loading.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(139, 92, 246, 0.15);
  border-top-color: var(--profile-accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

/* ── Topbar ── */
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.profile-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--profile-border);
  color: var(--profile-text-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 180ms ease;
}

.btn-back:hover {
  color: var(--profile-text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ── Account Cards ── */
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.account-card {
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  border-radius: var(--profile-radius);
  padding: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 20px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--profile-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.card-info h3 {
  font-size: 13px;
  color: var(--profile-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.card-info .value {
  font-size: 20px;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
  transition: transform 200ms ease;
}
.btn-primary:hover { transform: translateY(-1px); }

/* ── Videos Section ── */
.videos-section {
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  border-radius: var(--profile-radius);
  padding: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.videos-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--profile-border);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--profile-text-muted);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.video-card {
  border: 1px solid var(--profile-border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: flex-start;
}
.status-completed { background: rgba(52, 211, 153, 0.15); color: var(--profile-green); border: 1px solid rgba(52, 211, 153, 0.3); }
.status-processing { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.status-error { background: rgba(248, 113, 113, 0.15); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }

.video-prompt {
  font-size: 14px;
  line-height: 1.4;
  color: var(--profile-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  font-size: 12px;
  color: var(--profile-text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-download {
  display: block;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--profile-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 150ms ease;
}
.btn-download:hover { background: rgba(255, 255, 255, 0.1); }

@media (max-width: 768px) {
  .account-grid { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; align-items: flex-start; gap: 16px; }
}
