/* Rankingderiv Community Trading Journal — luxury edition
   Deep black + champagne gold, matching rankingderiv.net */
* { box-sizing: border-box; }

:root {
  --gold: #C6A15B;
  --gold-soft: rgba(198, 161, 91, 0.35);
  --ivory: #f5f0e6;
  --muted: #a89f8d;
  --card-bg: rgba(12, 12, 12, 0.82);
  --input-bg: rgba(255, 255, 255, 0.04);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ivory);
  line-height: 1.5;
  background: #060606 url("bg.jpg") no-repeat center top fixed;
  background-size: cover;
  min-height: 100vh;
}

/* soft dark veil so text always reads */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,4,4,0.55) 0%, rgba(4,4,4,0.78) 60%, rgba(4,4,4,0.92) 100%);
  pointer-events: none;
  z-index: 0;
}

.site-header, main, footer { position: relative; z-index: 1; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--gold-soft);
  position: sticky;
  top: 0;
  background: rgba(6, 6, 6, 0.9);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.brand {
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  text-decoration: none;
  font-size: 15px;
}

.cta {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  border: 1px solid var(--gold-soft);
  border-radius: 14px;
  padding: 20px;
  margin: 16px 0;
  background: var(--card-bg);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.hidden { display: none !important; }

h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ivory);
  font-weight: 600;
  letter-spacing: 0.5px;
}
h1 { font-size: 26px; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 26px 0 10px; }
h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin-top: 8px;
  border-radius: 2px;
}

.muted { color: var(--muted); font-size: 14px; }
.error { color: #ff8a8a; font-size: 14px; min-height: 20px; margin: 8px 0; }
.success { color: #7fd6a0; font-size: 14px; min-height: 20px; margin: 8px 0; }

label {
  display: block;
  margin: 12px 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--ivory);
}

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--gold-soft);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--ivory);
}

input::placeholder, textarea::placeholder { color: #6e675c; }
select option { background: #111; color: var(--ivory); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(198, 161, 91, 0.25);
}

label small.muted {
  display: block;
  margin-top: 4px;
  font-weight: 400;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #d4af6a, #b08a45);
  color: #0a0a0a;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.btn-primary:disabled { opacity: 0.5; cursor: wait; }

.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-soft);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-small { padding: 6px 10px; font-size: 13px; }
.danger { border-color: #b0413e; color: #ff8a8a; }

.tabs { display: flex; gap: 8px; margin: 16px 0; }

.tab {
  flex: 1;
  padding: 11px;
  border: 1px solid var(--gold-soft);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.tab.active {
  background: linear-gradient(135deg, #d4af6a, #b08a45);
  color: #0a0a0a;
  border-color: transparent;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  padding: 14px;
  background: var(--card-bg);
  backdrop-filter: blur(6px);
}

.stat-label {
  display: block;
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.stat-value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  margin-top: 6px;
  color: var(--ivory);
  word-break: break-word;
}

.pos { color: #7fd6a0; }
.neg { color: #ff8a8a; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.form-actions .btn-primary { margin-top: 0; }

.trades { list-style: none; padding: 0; margin: 0; }

.trade {
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  padding: 14px;
  margin: 10px 0;
  background: var(--card-bg);
  backdrop-filter: blur(6px);
}

.trade-top { display: flex; align-items: center; gap: 8px; }
.trade-top strong { font-size: 17px; color: var(--ivory); }

.dir {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: #0a0a0a;
  letter-spacing: 1px;
}

.pnl { margin-left: auto; font-weight: 800; font-size: 16px; }
.trade-meta { margin-top: 4px; color: var(--muted); font-size: 13px; }
.trade-notes { margin-top: 6px; font-size: 14px; color: var(--ivory); }
.trade-actions { display: flex; gap: 8px; margin-top: 10px; }

.userbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.userbar .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

footer {
  text-align: center;
  padding: 28px 16px;
  border-top: 1px solid var(--gold-soft);
  margin-top: 36px;
  font-size: 14px;
  color: var(--muted);
}

footer a { color: var(--gold); font-weight: 700; }

@media (min-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- Light theme ---------- */
html[data-theme="light"] {
  --gold: #9a7a34;
  --gold-soft: rgba(154, 122, 52, 0.45);
  --ivory: #211d14;
  --muted: #6f6656;
  --card-bg: rgba(255, 255, 255, 0.94);
  --input-bg: rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] body {
  background: #f4eee1;
}
html[data-theme="light"] body::before { display: none; }
html[data-theme="light"] .site-header {
  background: rgba(244, 238, 225, 0.94);
}
html[data-theme="light"] select option { background: #fff; color: #211d14; }
html[data-theme="light"] .card,
html[data-theme="light"] .stat,
html[data-theme="light"] .trade {
  box-shadow: 0 4px 18px rgba(120, 95, 40, 0.12);
}

/* ---------- Theme toggle button ---------- */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--gold-soft);
  color: var(--gold);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  flex-shrink: 0;
}
.header-actions { display: flex; align-items: center; }
.header-actions .btn-ghost + .btn-ghost,
.header-actions .btn-small + .btn-ghost { margin-left: 8px; }
