/* CausalFunnel Account Info Page - Dark Theme */

/* SVG icon colour helpers */
.cf-card-icon svg,
.cf-consent-icon svg,
.cf-support-icon svg,
.cf-account-icon svg { display: block; }

.cf-store-card       .cf-card-icon svg { stroke: #eab308; }
.cf-credentials-card .cf-card-icon svg { stroke: #818cf8; }
.cf-access-card      .cf-card-icon svg { stroke: #10b981; }
.cf-support-card     .cf-card-icon svg { stroke: #ef4444; }
.cf-account-icon svg { stroke: #818cf8; }
.cf-support-icon svg { stroke: #94a3b8; }
.cf-consent-icon svg { stroke: #818cf8; }
.cf-note-icon svg    { stroke: #818cf8; }
.cf-btn-icon svg     { stroke: currentColor; }
.cf-copy-icon svg,
.cf-eye-icon svg     { stroke: #94a3b8; }

/* Loading Overlay */
.cf-loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0f1523 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.cf-spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(129, 140, 248, 0.2);
  border-top: 4px solid #818cf8;
  border-radius: 50%;
  animation: cf-spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes cf-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cf-loading-overlay p {
  color: #94a3b8;
  font-size: 15px; font-weight: 500; margin: 0;
  background: rgba(26, 35, 50, 0.9);
  padding: 10px 24px; border-radius: 8px;
}

/* Main Container */
.causalfunnel-container {
  max-width: 100%; margin: 0; padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1523 !important;
  min-height: 100vh;
  color: #e2e8f0;
}

/* Header */
.cf-header {
  background: linear-gradient(135deg, #1a2332 0%, #1e2a3a 100%);
  border: 1px solid #2d3748;
  border-radius: 12px;
  padding: 24px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.cf-header::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #818cf8, #6366f1, #818cf8);
  border-radius: 12px 12px 0 0;
}

.cf-header-content {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 16px;
}

.cf-title-section { flex: 1; }

.cf-main-title {
  font-size: 1.8rem; font-weight: 700;
  margin: 0 0 6px 0; color: #e2e8f0;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.01em;
}

.cf-account-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  border-radius: 8px; font-size: 1rem;
}

.cf-subtitle {
  font-size: 0.9rem; color: #94a3b8; margin: 0; font-weight: 400;
}

.cf-status-badge,
.cf-privacy-status-badge {
  display: flex; align-items: center; gap: 8px;
  background: rgba(45, 55, 72, 0.6);
  padding: 8px 16px; border-radius: 20px;
  border: 1px solid #2d3748;
  font-size: 0.82rem; font-weight: 500; color: #e2e8f0;
}

.cf-status-dot { width: 8px; height: 8px; border-radius: 50%; }

.cf-status-active {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  animation: cf-glow 2s ease-in-out infinite alternate;
}

@keyframes cf-glow {
  from { opacity: 0.7; }
  to   { opacity: 1; }
}

.cf-status-text,
.cf-privacy-text { font-weight: 500; font-size: 0.82rem; color: #e2e8f0; }

.cf-privacy-status-badge.enabled  { border-left: 2px solid #10b981; }
.cf-privacy-status-badge.disabled { border-left: 2px solid #eab308; }
.cf-privacy-icon { font-size: 0.9rem; }

/* Header Badges */
.cf-header-badges { display: flex; gap: 10px; flex-wrap: wrap; }

/* Main Content */
.cf-main-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
}

/* Info Cards */
.cf-info-card {
  background: #1a2332; border: 1px solid #2d3748;
  border-radius: 12px; overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  opacity: 0; transform: translateY(16px);
}

.cf-info-card:hover {
  border-color: #4b5563;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.cf-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 14px 20px;
  border-bottom: 1px solid #2d3748;
  background: #1e2a3a;
}

.cf-card-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 1.1rem; flex-shrink: 0;
}

.cf-card-header h3 {
  margin: 0; font-size: 1rem; font-weight: 600; color: #e2e8f0;
}

.cf-card-content { padding: 20px; }

/* Card icon colours by type */
.cf-store-card       .cf-card-icon { background: rgba(234,179,  8,0.15); border: 1px solid rgba(234,179,  8,0.25); }
.cf-credentials-card .cf-card-icon { background: rgba(129,140,248,0.15); border: 1px solid rgba(129,140,248,0.25); }
.cf-access-card      .cf-card-icon { background: rgba( 16,185,129,0.15); border: 1px solid rgba( 16,185,129,0.25); }
.cf-support-card     .cf-card-icon { background: rgba(239, 68, 68,0.15); border: 1px solid rgba(239, 68, 68,0.25); }

/* Store Info rows */
.cf-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid #2d3748;
}
.cf-info-row:last-child { border-bottom: none; }
.cf-info-label { font-size: 0.85rem; color: #94a3b8; font-weight: 500; }
.cf-info-value { font-size: 0.9rem; font-weight: 600; color: #e2e8f0; text-align: right; }
.cf-link { color: #818cf8; text-decoration: none; transition: color 0.2s; }
.cf-link:hover { color: #a5b4fc; text-decoration: underline; }

/* Credentials */
.cf-credentials-note {
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.84rem; color: #94a3b8;
}
.cf-note-icon { font-size: 1rem; color: #818cf8; }

.cf-credential-item { margin-bottom: 14px; }
.cf-credential-item:last-child { margin-bottom: 0; }

.cf-credential-label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: #64748b; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.cf-credential-value { display: flex; gap: 6px; align-items: center; }

.cf-credential-input {
  flex: 1; padding: 10px 14px;
  background: #0f1523 !important;
  border: 1px solid #374151 !important;
  border-radius: 8px; color: #e2e8f0 !important;
  font-family: "SF Mono", "Monaco", "Menlo", monospace;
  font-size: 0.84rem; outline: none;
  transition: border-color 0.2s;
}
.cf-credential-input:focus {
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.15);
}

.cf-copy-btn,
.cf-toggle-btn {
  background: #1e2a3a; border: 1px solid #374151;
  border-radius: 8px; padding: 9px 12px;
  cursor: pointer; color: #94a3b8; font-size: 0.85rem;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  min-width: 40px; white-space: nowrap;
}
.cf-copy-btn:hover,
.cf-toggle-btn:hover { background: #2d3748; border-color: #4b5563; color: #e2e8f0; }
.cf-copy-icon, .cf-eye-icon { font-size: 0.9rem; }
.cf-checkmark { color: #fff; font-weight: bold; }

/* Access Card */
.cf-access-description {
  color: #94a3b8; font-size: 0.88rem; line-height: 1.6; margin-bottom: 18px;
}
.cf-access-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.cf-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border: none; border-radius: 8px;
  font-weight: 500; font-size: 0.88rem;
  text-decoration: none; cursor: pointer; transition: all 0.2s;
}
.cf-btn-primary {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff; border: 1px solid transparent;
}
.cf-btn-primary:hover {
  background: linear-gradient(135deg, #a5b4fc, #818cf8);
  box-shadow: 0 4px 14px rgba(129, 140, 248, 0.35);
  transform: translateY(-1px); color: #fff;
}
.cf-btn-secondary {
  background: #1e2a3a; color: #e2e8f0; border: 1px solid #374151;
}
.cf-btn-secondary:hover {
  background: #2d3748; border-color: #4b5563; transform: translateY(-1px);
}
.cf-btn-small { padding: 8px 14px; font-size: 0.82rem; }
.cf-btn-icon  { font-size: 0.9rem; }

/* Support Card */
.cf-support-options { display: flex; flex-direction: column; gap: 12px; }

.cf-support-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: #1e2a3a; border: 1px solid #2d3748;
  border-radius: 8px; transition: all 0.2s;
}
.cf-support-link { text-decoration: none; color: inherit; }
.cf-support-link:hover {
  background: #253347; border-color: #374151;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.cf-support-icon {
  font-size: 1.3rem; width: 36px;
  display: flex; justify-content: center; flex-shrink: 0;
}
.cf-support-text strong {
  display: block; color: #e2e8f0; font-size: 0.9rem; margin-bottom: 2px; font-weight: 600;
}
.cf-support-text p { margin: 0; color: #94a3b8; font-size: 0.8rem; }

/* Privacy Section */
.cf-privacy-section {
  background: #1a2332; border: 1px solid #2d3748;
  border-radius: 12px; padding: 24px; margin-bottom: 24px;
}
.cf-privacy-header { margin-bottom: 20px; }
.cf-privacy-header h3 {
  margin: 0 0 4px 0;
  font-size: 1.1rem; font-weight: 600; color: #e2e8f0;
  display: flex; align-items: center; gap: 8px;
}
.cf-privacy-header p { margin: 0; color: #94a3b8; font-size: 0.88rem; }

.cf-consent-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin-bottom: 20px;
}

.cf-consent-item {
  background: #1e2a3a; border: 1px solid #2d3748;
  border-radius: 10px; padding: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cf-consent-item:hover {
  border-color: #818cf8;
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.15);
}
.cf-consent-header {
  display: flex; justify-content: space-between;
  align-items: center; gap: 12px;
}
.cf-consent-info { display: flex; align-items: center; gap: 12px; }

.cf-consent-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: 8px; font-size: 1.1rem; flex-shrink: 0;
}
.cf-consent-details h4 {
  margin: 0 0 2px 0; font-size: 0.92rem; font-weight: 600; color: #e2e8f0;
}
.cf-consent-details p { margin: 0; color: #94a3b8; font-size: 0.8rem; }

.cf-consent-toggle {
  position: relative; width: 46px; height: 24px;
  background: #374151; border-radius: 12px;
  cursor: pointer; transition: background 0.3s ease;
  flex-shrink: 0; border: 1px solid #4b5563;
}
.cf-consent-toggle.active { background: #10b981; border-color: #059669; }
.cf-consent-toggle::before {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #e2e8f0; border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.cf-consent-toggle.active::before { transform: translateX(22px); }

.cf-consent-actions {
  display: flex; gap: 12px;
  justify-content: flex-start; padding-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .causalfunnel-container { padding: 14px; }
  .cf-header { padding: 18px 20px; }
  .cf-main-title { font-size: 1.4rem; }
  .cf-header-content { flex-direction: column; align-items: flex-start; }
  .cf-header-badges  { width: 100%; gap: 8px; }
  .cf-main-content   { grid-template-columns: 1fr; }
  .cf-consent-grid   { grid-template-columns: 1fr; }
  .cf-credential-value { flex-direction: column; align-items: stretch; }
  .cf-copy-btn, .cf-toggle-btn { min-width: 100%; justify-content: center; }
  .cf-access-buttons { flex-direction: column; }
  .cf-btn  { justify-content: center; width: 100%; }
  .cf-consent-actions { flex-direction: column; }
}

@media (max-width: 480px) {
  .cf-card-content { padding: 16px; }
  .cf-card-header  { padding: 14px 16px 12px 16px; }
  .cf-info-row     { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cf-info-value   { text-align: left; }
}
