/* ============================================
   ForexEdge Pro — Premium CSS Design System
   ============================================ */

/* ---- Google Fonts & Variables ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-base: #040811;
  --bg-surface: #0a0f1d;
  --bg-card: #0e1529;
  --bg-card-hover: #131d38;
  --bg-input: #060a14;
  --border: rgba(255,255,255,0.06);
  --border-active: rgba(0,94,255,0.4);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --accent-cyan: #38bdf8; /* Sky Blue */
  --accent-purple: #005eff; /* Royal Blue */
  --accent-blue: #2563eb;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-gold: #eab308;

  --gradient-primary: linear-gradient(135deg, #e2e8f0 0%, #005eff 100%); /* Silver to Royal Blue */
  --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-red: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.005) 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --shadow-glow-cyan: 0 0 30px rgba(56,189,248,0.12);
  --shadow-glow-purple: 0 0 30px rgba(0,94,255,0.15);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
  width: 100% !important;
  position: relative;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- Animated Background ---- */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  animation: floatGlow 8s ease-in-out infinite;
}

.bg-glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,94,255,0.08) 0%, transparent 70%);
  top: -200px; right: -200px;
  animation-delay: 0s;
}
.bg-glow-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
  bottom: -150px; left: -150px;
  animation-delay: -3s;
}
.bg-glow-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(56,189,248,0.05) 0%, transparent 70%);
  top: 50%; left: 50%;
  animation-delay: -6s;
}

@keyframes floatGlow {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

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

/* ---- Header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,12,20,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0,212,255,0.05);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: rgba(0,212,255,0.08);
  border-radius: 10px;
  border: 1px solid rgba(0,212,255,0.15);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.logo-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-tab.active {
  color: var(--accent-cyan);
  background: rgba(0,212,255,0.08);
  border-color: rgba(0,212,255,0.2);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-green);
  letter-spacing: 0.08em;
}

.live-dot {
  width: 6px; height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.current-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---- Main Content ---- */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ---- Tab Sections ---- */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeSlideIn 0.3s ease; }

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

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---- Cards ---- */
.card {
  background: var(--gradient-card);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  border-color: rgba(255,255,255,0.1);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: 'Outfit', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-title svg { color: var(--accent-cyan); flex-shrink: 0; }

.card-body {
  padding: 1.4rem;
}

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--gradient-card);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  transition: var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: var(--transition-slow);
  transform-origin: left;
}

.stat-card:hover::before { transform: scaleX(1); }

.stat-card:hover {
  border-color: rgba(0,212,255,0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-cyan);
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-blue { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.stat-icon-green { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.stat-icon-red { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.stat-icon-purple { background: rgba(123,47,255,0.15); color: var(--accent-purple); }

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-change {
  font-size: 0.72rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.profit { color: var(--accent-green); }
.stat-change.loss { color: var(--accent-red); }
.stat-change.neutral { color: var(--text-muted); }

/* ---- Grids ---- */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.growth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

/* ---- Form Elements ---- */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: var(--transition);
  outline: none;
  appearance: none;
}

.form-input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input[type="number"]::-webkit-inner-spin-button,
.form-input[type="number"]::-webkit-outer-spin-button { opacity: 0.4; }

select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238494b0' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.form-input option {
  background: var(--bg-card);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .form-input {
  padding-left: 14px;
  padding-right: 14px;
}

/* Left icon present: pad left */
.input-with-icon .input-icon ~ .form-input {
  padding-left: 32px;
  padding-right: 14px;
}

/* Right icon present (input is first child): pad right */
.input-with-icon .form-input:first-child {
  padding-left: 14px;
  padding-right: 32px;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 1;
}

.input-icon-right {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
}

/* Preset Sizing Pills */
.preset-pill {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  outline: none;
}

.preset-pill:hover {
  background: rgba(0, 212, 255, 0.06);
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--accent-cyan);
}

.preset-pill:active {
  background: rgba(0, 212, 255, 0.12);
  transform: scale(0.96);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(0,212,255,0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(0,212,255,0.35);
}

.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}

.btn-full { width: 100%; margin-top: 0.5rem; }

/* ---- P&L Input Row ---- */
.pnl-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.pnl-input-row .form-input { flex: 1; }

.pnl-type-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.pnl-type-btn[data-type="profit"].active {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.35);
  color: var(--accent-green);
}

.pnl-type-btn[data-type="loss"].active {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.35);
  color: var(--accent-red);
}

/* ---- Drawdown Meter ---- */
.meter-container { margin-bottom: 1.25rem; }

.meter-bar {
  height: 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  overflow: visible;
  position: relative;
  margin-bottom: 8px;
}

.meter-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--gradient-green);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1),
              background 0.4s ease;
  position: relative;
}

.meter-fill::after {
  content: '';
  position: absolute;
  right: -2px; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  border: 3px solid;
  border-color: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.meter-marker {
  position: absolute;
  top: -4px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.meter-marker-line {
  width: 2px;
  height: 24px;
  background: var(--accent-red);
  opacity: 0.6;
}

.meter-marker-label {
  font-size: 0.62rem;
  color: var(--accent-red);
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.drawdown-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.drawdown-stat { text-align: center; }
.drawdown-stat-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.drawdown-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.drawdown-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.08em;
}
.drawdown-status.safe {
  background: rgba(16,185,129,0.12);
  color: var(--accent-green);
  border: 1px solid rgba(16,185,129,0.25);
}
.drawdown-status.warning {
  background: rgba(245,158,11,0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(245,158,11,0.25);
}
.drawdown-status.danger {
  background: rgba(239,68,68,0.12);
  color: var(--accent-red);
  border: 1px solid rgba(239,68,68,0.25);
  animation: dangerPulse 1s ease infinite;
}

@keyframes dangerPulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ---- Allocation / Capital Tab ---- */
.allocation-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0,212,255,0.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,212,255,0.12);
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.allocation-info .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.allocation-slider-section {
  margin-bottom: 1rem;
}

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

.allocation-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.allocation-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.range-slider {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  margin-bottom: 4px;
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gradient-primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,212,255,0.4);
  transition: var(--transition);
}

.range-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.allocation-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

.allocation-donut {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.allocation-donut canvas { flex-shrink: 0; }

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Weekly Chart ---- */
.weekly-chart-container {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
}

.weekly-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.weekly-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weekly-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.weekly-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.weekly-stat-value.profit { color: var(--accent-green); }
.weekly-stat-value.loss { color: var(--accent-red); }

/* ---- Projection Table ---- */
.projection-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.projection-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.projection-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

.projection-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
}

.projection-table tr:last-child td { border-bottom: none; }
.projection-table tr:hover td { background: rgba(255,255,255,0.025); }
.projection-table td:first-child { color: var(--text-muted); }
.projection-table .profit-cell { color: var(--accent-green); }
.projection-table .loss-cell { color: var(--accent-red); }

/* ---- Calc Tabs ---- */
.calc-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.03);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  width: fit-content;
}

.calc-tab {
  padding: 7px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.calc-tab:hover { color: var(--text-primary); }

.calc-tab.active {
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,212,255,0.3);
}

.calc-panel { display: none; }
.calc-panel.active { display: block; animation: fadeSlideIn 0.25s ease; }

/* ---- Result Cards ---- */
.result-card .card-body {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.result-placeholder p { font-size: 0.82rem; }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.result-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.result-item-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.result-item-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.result-item.highlighted {
  background: rgba(0,212,255,0.06);
  border-color: rgba(0,212,255,0.2);
}

.result-item.highlighted .result-item-value {
  font-size: 1.4rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-rr-bar {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.rr-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.rr-bar-visual {
  display: flex;
  height: 12px;
  border-radius: 100px;
  overflow: hidden;
  gap: 2px;
}

.rr-bar-risk {
  background: rgba(239,68,68,0.6);
  border-radius: 100px 0 0 100px;
  transition: width 0.4s ease;
}

.rr-bar-reward {
  background: rgba(16,185,129,0.6);
  border-radius: 0 100px 100px 0;
  transition: width 0.4s ease;
  flex: 1;
}

/* ---- Tooltip ---- */
.tooltip-wrapper { position: relative; }

.info-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}

.tooltip {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.tooltip-wrapper:hover .tooltip { opacity: 1; }

/* ---- Trade Log ---- */
.trades-summary {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.trade-summary-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.summary-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.summary-val {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-val.profit { color: var(--accent-green); }
.summary-val.loss { color: var(--accent-red); }

.table-wrapper { overflow-x: auto; }

.trade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.trade-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

.trade-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
}

.trade-table tr:hover td { background: rgba(255,255,255,0.025); }

.trade-table .trade-profit { color: var(--accent-green); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.trade-table .trade-loss { color: var(--accent-red); font-family: 'JetBrains Mono', monospace; font-weight: 600; }

.trade-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trade-badge.profit {
  background: rgba(16,185,129,0.12);
  color: var(--accent-green);
  border: 1px solid rgba(16,185,129,0.25);
}

.trade-badge.loss {
  background: rgba(239,68,68,0.12);
  color: var(--accent-red);
  border: 1px solid rgba(239,68,68,0.25);
}

.delete-btn {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--accent-red);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
}

.delete-btn:hover {
  background: rgba(239,68,68,0.1);
}

.synced-badge {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  display: inline-block;
}

.empty-row td { padding: 0 !important; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 3rem;
  color: var(--text-muted);
  text-align: center;
}

.empty-state p { font-size: 0.82rem; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
              opacity 0.3s ease;
  opacity: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.warning { border-color: rgba(245,158,11,0.3); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
  display: flex;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s cubic-bezier(0.4,0,0.2,1);
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon-warning {
  width: 60px; height: 60px;
  background: rgba(239,68,68,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  color: var(--accent-red);
  border: 1px solid rgba(239,68,68,0.2);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ============================================
   MOBILE RESPONSIVE OVERHAUL
   ============================================ */

/* ── Mobile Bottom Navigation Bar ── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(8,12,22,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 8px 4px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
}

.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 2px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  letter-spacing: 0.02em;
}

.mobile-nav-btn svg {
  transition: var(--transition);
  opacity: 0.5;
}

.mobile-nav-btn:hover,
.mobile-nav-btn.active {
  color: var(--accent-cyan);
}

.mobile-nav-btn.active svg {
  opacity: 1;
}

.mobile-nav-btn.active span {
  color: var(--accent-cyan);
}

.mobile-nav-btn:hover svg,
.mobile-nav-btn.active svg {
  filter: drop-shadow(0 0 4px rgba(56,189,248,0.5));
}

/* ── Tablet (max 1100px) ── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .trades-summary { grid-template-columns: repeat(4, 1fr); }
}

/* ── Large Mobile & Tablet (max 768px) ── */
@media (max-width: 768px) {
  /* Header */
  .header-inner {
    gap: 0.75rem;
    padding: 0 1rem;
    height: 56px;
  }

  /* Hide top nav, show bottom nav */
  .nav-tabs { display: none !important; }
  .mobile-bottom-nav { display: flex; }

  /* Shrink header right elements */
  .header-right { gap: 6px; }
  .live-badge { display: none; }
  .current-time { font-size: 0.65rem; display: none; }
  .logo-sub { display: none; }

  /* Logout button compact */
  #btn-logout span { display: none; }
  #btn-logout svg { margin: 0; }
  #btn-logout { padding: 6px 8px !important; }

  /* MT5 badge compact */
  .mt5-status-badge { font-size: 0.6rem; padding: 3px 7px; }
  #mt5-status-text { display: none; }

  /* Main content padding — account for bottom nav */
  .main-content {
    padding: 1rem;
    padding-bottom: 90px !important;
  }

  /* Grid fixes */
  .two-col-grid { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .growth-grid { grid-template-columns: 1fr 1fr; }
  .trades-summary { grid-template-columns: repeat(3, 1fr); }

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-title { font-size: 1.2rem; }

  /* Card padding */
  .card { padding: 1rem !important; }
  .card-body { padding: 1rem; }
  .card-header { padding: 0.9rem 1rem; }

  /* Stats cards compact */
  .stat-card { padding: 0.9rem 1rem; }
  .stat-value { font-size: 1.3rem; }

  /* MT5 account grid */
  .mt5-account-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .mt5-acc-value { font-size: 1rem; }

  /* Tables: make scrollable */
  .table-wrap, .overflow-x-auto, [style*="overflow-x:auto"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table { min-width: 520px; }

  /* Form grid: single column */
  .form-grid-2 { grid-template-columns: 1fr !important; }

  /* Meter */
  .meter-container { padding: 0.9rem; }

  /* Dashboard hero/top stats */
  .dash-top-stats {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ── Small Mobile (max 480px) ── */
@media (max-width: 480px) {
  .header-inner { padding: 0 0.75rem; height: 52px; }

  /* Main content */
  .main-content {
    padding: 0.75rem;
    padding-bottom: 88px !important;
  }

  /* Grids */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .growth-grid { grid-template-columns: 1fr !important; }
  .trades-summary { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }

  /* MT5 grid full-width cards */
  .mt5-account-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .mt5-acc-card { padding: 0.75rem; }
  .mt5-acc-value { font-size: 0.9rem; }
  .mt5-acc-label { font-size: 0.6rem; }

  /* Cards */
  .card { padding: 0.85rem !important; }
  .card-body { padding: 0.75rem; }
  .card-header { padding: 0.75rem; }
  .card-title { font-size: 0.85rem; }

  /* Stats */
  .stat-card { padding: 0.75rem; }
  .stat-value { font-size: 1.15rem; }
  .stat-label { font-size: 0.65rem; }

  /* Buttons */
  .btn { padding: 9px 14px; font-size: 0.78rem; }
  .btn-group { flex-direction: column; gap: 8px; }

  /* Page header */
  .page-title { font-size: 1.1rem; }

  /* Calc tabs */
  .calc-tabs { flex-wrap: wrap; gap: 4px; }
  .calc-tab { font-size: 0.72rem; padding: 6px 10px; }

  /* Drawdown meter */
  .meter-stats-grid { grid-template-columns: 1fr 1fr !important; gap: 0.5rem !important; }

  /* AI Journal timeframe buttons */
  .timeframe-btns { flex-wrap: wrap; gap: 4px; }

  /* AI Advisor card */
  .ai-rec-box { flex-direction: column; gap: 4px; align-items: flex-start; }
  .ai-header { flex-wrap: wrap; }

  /* Table */
  table { min-width: 460px; font-size: 0.75rem; }
  th, td { padding: 8px 10px !important; }

  /* Trades summary row */
  .trade-summary-item { padding: 0.6rem 0.5rem; }

  /* News Calendar */
  .news-event-card { padding: 0.75rem; }

  /* Floating background glows — reduce for performance */
  .bg-glow-1 { width: 200px; height: 200px; }
  .bg-glow-2 { width: 150px; height: 150px; }
  .bg-glow-3 { width: 120px; height: 120px; }

  /* Modal */
  .modal { padding: 1.5rem; margin: 1rem; border-radius: var(--radius-lg); }

  /* Toast position */
  .toast-container { bottom: 88px !important; right: 10px !important; left: 10px !important; }
  .toast { width: 100%; text-align: center; font-size: 0.8rem; }

  /* Scrollbars hide on mobile for cleaner look */
  ::-webkit-scrollbar { width: 0; height: 3px; }
  ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); }

  /* Mobile Header Layout Optimization */
  .logo-text { display: none !important; }
  #header-acc-selector-wrapper { margin-right: 4px !important; gap: 4px !important; }
  #header-acc-selector-wrapper svg { display: none !important; }
  #header-mfxb-account-select {
    font-size: 0.72rem !important;
    height: 28px !important;
    min-width: 80px !important;
    max-width: 110px !important;
    padding: 2px 4px !important;
  }

  /* Trading Calendar Mobile Optimizations */
  .calendar-grid-header { gap: 3px !important; font-size: 0.58rem !important; }
  .calendar-grid-body { gap: 3px !important; }
  .calendar-day-cell { min-height: auto !important; aspect-ratio: 1.05 !important; padding: 3px !important; }
  .calendar-day-num { font-size: 0.62rem !important; }
  .calendar-day-pnl { font-size: 0.54rem !important; text-align: center !important; }
  
  /* Stack Card Headers on small screens to prevent overflow */
  .card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .calendar-nav {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 4px !important;
  }
  .calendar-nav button {
    padding: 3px 6px !important;
    font-size: 0.68rem !important;
  }
  #calendar-month-year {
    font-size: 0.76rem !important;
    min-width: 60px !important;
  }
}


/* ---- Mono util ---- */
.mono { font-family: 'JetBrains Mono', monospace; }
.profit { color: var(--accent-green); }
.loss { color: var(--accent-red); }

/* ---- MT5 Status Badge (Header) ---- */
.mt5-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  cursor: default;
  transition: var(--transition);
}

.mt5-status-badge.connected {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  color: var(--accent-green);
}

.mt5-status-badge.disconnected {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--accent-red);
}

.mt5-status-badge.stale {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  color: var(--accent-gold);
}

.mt5-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.mt5-status-badge.connected .mt5-status-dot {
  animation: pulseDot 1.5s ease-in-out infinite;
}

/* ---- MT5 Connection Badge (inside tab) ---- */
.mt5-conn-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}

.mt5-conn-badge.connected {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.25);
  color: var(--accent-green);
}

.mt5-conn-badge.disconnected {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.2);
  color: var(--accent-red);
}

.mt5-conn-badge.stale {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.2);
  color: var(--accent-gold);
}

.mt5-conn-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.mt5-conn-badge.connected .mt5-conn-dot {
  animation: pulseDot 1.5s ease-in-out infinite;
}

/* ---- MT5 Account Grid Cards ---- */
.mt5-account-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mt5-acc-card {
  background: var(--gradient-card);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.3rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.mt5-acc-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition-slow);
}

.mt5-acc-card:hover::before { transform: scaleX(1); }
.mt5-acc-card:hover {
  border-color: rgba(0,212,255,0.15);
  transform: translateY(-2px);
}

.mt5-acc-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.mt5-acc-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

/* ---- MT5 Positions Count ---- */
.mt5-positions-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ---- Setup Steps ---- */
.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setup-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.setup-step:hover {
  background: rgba(0,212,255,0.03);
  border-color: rgba(0,212,255,0.12);
}

.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,212,255,0.3);
}

.step-body { flex: 1; }

.step-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-desc code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.15);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-size: 0.78rem;
}

/* ---- Responsive MT5 ---- */
@media (max-width: 1100px) {
  .mt5-account-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .mt5-account-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Credentials Form ---- */
.investor-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  color: var(--accent-green);
  letter-spacing: 0.05em;
}

.cred-info-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0,212,255,0.05);
  border: 1px solid rgba(0,212,255,0.12);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.cred-info-box svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Password show/hide button */
.password-group {
  position: relative;
}

.password-group .form-input {
  padding-right: 44px !important;
  padding-left: 14px !important;
}

.show-pass-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.show-pass-btn:hover { color: var(--text-primary); }

/* Credential save status */
.cred-status {
  margin-top: 10px;
  font-size: 0.78rem;
  text-align: center;
  min-height: 20px;
  transition: var(--transition);
}

.cred-status.success { color: var(--accent-green); }
.cred-status.error   { color: var(--accent-red); }

/* ---- Quick Steps ---- */
.quick-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.quick-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.quick-step:hover {
  background: rgba(0,212,255,0.03);
  border-color: rgba(0,212,255,0.1);
}

.quick-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.quick-step-body { flex: 1; }

.quick-step-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.quick-step-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.quick-step-desc code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.15);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-size: 0.72rem;
}

/* ---- Launch Box ---- */
.launch-box {
  background: rgba(123,47,255,0.06);
  border: 1px solid rgba(123,47,255,0.15);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 1rem;
}

.launch-box-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.launch-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent-purple);
  word-break: break-all;
}

/* ---- Requirements Box ---- */
.requirements-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

.req-check { font-size: 0.85rem; }

/* ---- MyFxBook Hero Banner ---- */
.mfxb-hero-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(0,212,255,0.06) 0%, rgba(123,47,255,0.08) 100%);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.mfxb-hero-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-primary);
}

.mfxb-hero-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  box-shadow: 0 8px 20px rgba(0,212,255,0.25);
}

.mfxb-hero-text { flex: 1; }

.mfxb-hero-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mfxb-hero-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.mfxb-hero-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* ---- MyFxBook Link ---- */
.mfxb-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.mfxb-link:hover {
  color: white;
  text-decoration: underline;
}

/* ---- Use Live Balance Links ---- */
.use-live-balance-link {
  transition: var(--transition);
}
.use-live-balance-link:hover {
  color: white !important;
  text-shadow: 0 0 8px rgba(0,212,255,0.5);
}

/* ---- Over-Leverage Warning Banner ---- */
.risk-warning-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.22);
  border-radius: var(--radius-md);
  color: var(--accent-red);
  position: relative;
  overflow: hidden;
  animation: pulseWarningBorder 2s ease-in-out infinite;
}

@keyframes pulseWarningBorder {
  0% { border-color: rgba(239,68,68,0.22); box-shadow: 0 0 0 0 rgba(239,68,68,0.06); }
  50% { border-color: rgba(239,68,68,0.45); box-shadow: 0 0 10px 2px rgba(239,68,68,0.12); }
  100% { border-color: rgba(239,68,68,0.22); box-shadow: 0 0 0 0 rgba(239,68,68,0.06); }
}

.warning-icon {
  color: var(--accent-red);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.warning-content { flex: 1; }

.warning-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-red);
}

.warning-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ---- Trading Calendar ---- */
.calendar-day-cell {
  aspect-ratio: 1.35;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  min-height: 52px;
}

.calendar-day-cell:hover {
  background: rgba(0,94,255,0.06);
  border-color: rgba(0,94,255,0.3);
  transform: translateY(-1.5px);
}

.calendar-day-num {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.calendar-day-cell.active-month .calendar-day-num {
  color: var(--text-secondary);
}

.calendar-day-cell.today {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 10px rgba(56,189,248,0.15);
}

.calendar-day-cell.today .calendar-day-num {
  color: var(--accent-cyan) !important;
  font-weight: 800;
}

.calendar-day-pnl {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
  width: 100%;
}

.calendar-day-cell.profit-day {
  background: rgba(16,185,129,0.05) !important;
  border-color: rgba(16,185,129,0.2) !important;
}
.calendar-day-cell.profit-day:hover {
  background: rgba(16,185,129,0.08) !important;
  border-color: rgba(16,185,129,0.35) !important;
}
.calendar-day-cell.profit-day .calendar-day-pnl {
  color: var(--accent-green) !important;
}

.calendar-day-cell.loss-day {
  background: rgba(239,68,68,0.05) !important;
  border-color: rgba(239,68,68,0.2) !important;
}
.calendar-day-cell.loss-day:hover {
  background: rgba(239,68,68,0.08) !important;
  border-color: rgba(239,68,68,0.35) !important;
}
.calendar-day-cell.loss-day .calendar-day-pnl {
  color: var(--accent-red) !important;
}

/* Empty days out of range */
.calendar-day-cell.out-of-range {
  opacity: 0.15;
  cursor: default;
  pointer-events: none;
}

/* Selected calendar filter cell */
.calendar-day-cell.selected-filter {
  border-color: var(--accent-gold) !important;
  background: rgba(234,179,8,0.06) !important;
  box-shadow: 0 0 12px rgba(234,179,8,0.18);
}

/* ---- AI Smart Advisor Card ---- */
.ai-advisor-card {
  position: relative;
  border: 1px solid rgba(0, 212, 255, 0.25) !important;
  background: linear-gradient(145deg, rgba(10, 25, 41, 0.6) 0%, rgba(2, 8, 16, 0.9) 100%) !important;
  box-shadow: 0 0 20px 2px rgba(0, 212, 255, 0.15) !important;
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.ai-advisor-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(to bottom right, var(--accent-cyan), var(--accent-purple));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.4;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.15);
  padding-bottom: 12px;
  margin-bottom: 15px;
}

.ai-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
  animation: floatAvatar 3s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes floatAvatar {
  0% { transform: translateY(0); }
  50% { transform: translateY(-3px); box-shadow: 0 0 15px rgba(0, 212, 255, 0.4); }
  100% { transform: translateY(0); }
}

.ai-title-group {
  flex: 1;
}

.ai-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ai-streak-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-streak-badge.winning {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
}

.ai-streak-badge.losing {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}

.ai-streak-badge.neutral {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.ai-body {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.ai-rec-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
}

.ai-rec-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.ai-rec-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* ---- News Currency Filter Buttons ---- */
.news-cur-btn {
  background: rgba(255, 255, 255, 0.02) !important;
  color: var(--text-secondary) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 5px 12px !important;
  font-size: 0.72rem !important;
  border-radius: 6px !important;
  transition: all 0.2s var(--ease) !important;
  opacity: 0.55;
  cursor: pointer;
}

.news-cur-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-primary) !important;
  opacity: 0.8;
}

.news-cur-btn.active {
  background: rgba(14, 165, 233, 0.1) !important;
  color: #38bdf8 !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
  opacity: 1 !important;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.15);
}

/* ---- Tutorials Card Grid ---- */
.tutorials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .tutorials-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

@media (max-width: 480px) {
  .tutorials-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}
