/* ==========================================================================
   POLYFORTUNE.AI - PREMIUM CONSUMER AESTHETIC
   Aesthetics: Sleek, Modern Fintech, Dark Theme, Approachable
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #050505;
  --bg-secondary: #121212;
  --bg-tertiary: #1A1A1A;
  
  --border-color: #2A2A2A;
  --border-focus: #555555;

  --text-primary: #FFFFFF;
  --text-secondary: #A0A0A0;
  --text-muted: #666666;
  --text-inverse: #000000;

  --accent-blue: #4A6B8C;
  --accent-blue-hover: #5B84AD;
  
  --data-green: #34D399;
  --data-green-bg: rgba(52, 211, 153, 0.1);
  --data-red: #F87171;
  --data-red-bg: rgba(248, 113, 113, 0.1);

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --container-max: 1100px;
  --radius: 8px; /* Consumer friendly rounded corners */
  --transition: 0.2s ease-in-out;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 15px; /* Slightly larger for consumer readability */
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Utilities */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.mono {
  font-family: var(--font-mono);
}

.text-green { color: var(--data-green); }
.text-red { color: var(--data-red); }
.text-muted { color: var(--text-muted); }

h1, h2, h3, h4 {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--text-primary);
}

/* Header */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.nav-menu {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Internal Dashboard/Settings Header */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.02);
  z-index: 20;
}
.dash-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #34D399 0%, #064E3B 100%) !important;
  border: none !important;
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  font-size: 0;
  color: transparent;
  transition: transform var(--transition);
}
.profile-icon:hover {
  transform: scale(1.05);
}

.profile-dropdown {
  position: absolute;
  top: 72px;
  right: 24px;
  width: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  z-index: 100;
}
.profile-dropdown.active {
  display: flex;
}
.dropdown-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: var(--radius);
  transition: all var(--transition);
  text-align: center;
}

.btn:hover {
  border-color: var(--border-focus);
  background: var(--border-color);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}

.btn-primary:hover {
  background: #E0E0E0;
  border-color: #E0E0E0;
}

/* Layout Elements */
.section {
  padding: 80px 0;
}

.section-header {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-secondary);
  max-width: 600px;
  font-size: 1.05rem;
}

/* Hero Section */
.hero {
  padding: 150px 0 100px 0;
}

.hero-content {
  max-width: 850px;
  text-align: center;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Metrics */
.metrics-wrap {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  background: var(--bg-secondary);
  margin-top: 40px;
}

.metric-item {
  text-align: center;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Data Tables (Scanner) */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.data-table th {
  padding: 16px 20px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-right: 8px;
}

/* Terminal / Sandbox */
.terminal-block {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  overflow: hidden;
}

.terminal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

.terminal-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
}

.terminal-main {
  padding: 32px;
  border-right: 1px solid var(--border-color);
}

.terminal-sidebar {
  padding: 32px;
  background: var(--bg-secondary);
}

.input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.text-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: 1rem;
  border-radius: var(--radius);
}

.text-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.evidence-list {
  list-style: none;
  margin-top: 24px;
}

.evidence-item {
  font-size: 0.95rem;
  margin-bottom: 16px;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}

.evidence-item::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.stat-label {
  color: var(--text-secondary);
}

.verdict-box {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  text-align: center;
  background: var(--bg-tertiary);
}

.verdict-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.verdict-value {
  font-weight: 700;
  font-size: 1.25rem;
}

/* Calculator Matrix */
.matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.matrix-panel {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  background: var(--bg-secondary);
}

.matrix-label {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.control-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 15%, rgba(255,255,255,0.08) 85%, transparent 100%);
  margin: 32px 0;
  border: none;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  outline: none;
  margin-bottom: 32px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--text-primary);
  cursor: pointer;
  border-radius: 50%;
}

.toggle-group {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 4px;
}

.toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
}

.toggle-btn.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.result-hero {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

/* Chart Area */
.chart-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  background: var(--bg-secondary);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.chart-legend {
  display: flex;
  gap: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.canvas-wrap {
  width: 100%;
  height: 350px;
}

/* Footer */
.footer {
  padding: 60px 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-muted);
  position: relative;
}

.footer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #050505 0%, #4A6B8C 50%, #050505 100%);
}

.footer-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .terminal-body, .matrix-grid {
    grid-template-columns: 1fr;
  }
  .terminal-main {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-menu {
    display: none;
  }
  .metrics-wrap {
    flex-direction: column;
    gap: 24px;
  }
}

/* Social Login Buttons */
.btn-social {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 12px;
  transition: all var(--transition);
}

.btn-social:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-focus);
}

.btn-social svg {
  width: 18px;
  height: 18px;
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.login-divider:not(:empty)::before {
  margin-right: 16px;
}

.login-divider:not(:empty)::after {
  margin-left: 16px;
}

/* Corner Ambient Gradients */
.corner-glow {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  background: var(--accent-blue);
  opacity: 0.12;
  filter: blur(150px);
  border-radius: 50%;
  transform: translate3d(0,0,0);
}

.glow-tl { top: -200px; left: -300px; width: 700px; height: 500px; }
.glow-tr { top: -300px; right: -200px; width: 500px; height: 800px; }
.glow-bl { bottom: -300px; left: -200px; width: 800px; height: 600px; }
.glow-br { bottom: -200px; right: -300px; width: 600px; height: 700px; }

/* Form Styles */
.form-group {
  margin-bottom: 24px;
}
.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.05);
}
.form-input:disabled, .form-input[readonly] {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
}
