/* OnlyTrade.ai - Global Styles */
:root {
  --ot-blue: #F27A1A;
  --ot-blue-dark: #D4690F;
  --ot-blue-light: #FEF3E8;
  --ot-dark: #0D1117;
  --ot-dark-2: #161B22;
  --ot-dark-3: #21262D;
  --ot-text: #E6EDF3;
  --ot-text-muted: #8B949E;
  --ot-border: #30363D;
  --ot-success: #2EA043;
  --ot-warning: #D29922;
  --ot-danger: #F85149;
  --ot-white: #FFFFFF;
  --ot-radius: 8px;
  --ot-radius-lg: 12px;
  --ot-shadow: 0 2px 8px rgba(0,0,0,0.3);
  --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--ot-dark);
  color: var(--ot-text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--ot-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border: none; border-radius: var(--ot-radius);
  font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s;
  min-height: 44px; min-width: 44px; text-decoration: none;
}
.btn-primary { background: var(--ot-blue); color: var(--ot-white); }
.btn-primary:hover { background: var(--ot-blue-dark); text-decoration: none; }
.btn-secondary { background: var(--ot-dark-3); color: var(--ot-text); border: 1px solid var(--ot-border); }
.btn-secondary:hover { background: var(--ot-border); text-decoration: none; }
.btn-outline { background: transparent; color: var(--ot-blue); border: 2px solid var(--ot-blue); }
.btn-outline:hover { background: var(--ot-blue); color: var(--ot-white); text-decoration: none; }
.btn-danger { background: var(--ot-danger); color: var(--ot-white); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-lg { padding: 16px 32px; font-size: 18px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--ot-text); font-size: 14px; }
.form-control {
  width: 100%; padding: 12px 16px; font-size: 16px;
  background: var(--ot-dark-2); color: var(--ot-text);
  border: 1px solid var(--ot-border); border-radius: var(--ot-radius);
  transition: border-color 0.2s; min-height: 44px;
}
.form-control:focus { outline: none; border-color: var(--ot-blue); box-shadow: 0 0 0 3px rgba(242,122,26,0.2); }
.form-control::placeholder { color: var(--ot-text-muted); }
.form-error { color: var(--ot-danger); font-size: 13px; margin-top: 4px; }
.form-hint { color: var(--ot-text-muted); font-size: 13px; margin-top: 4px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B949E' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* Cards */
.card {
  background: var(--ot-dark-2); border: 1px solid var(--ot-border);
  border-radius: var(--ot-radius-lg); padding: 24px;
}
.card-header { margin-bottom: 20px; }
.card-header h2 { font-size: 20px; font-weight: 600; }
.card-header p { color: var(--ot-text-muted); font-size: 14px; margin-top: 4px; }

/* Auth Layout */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  background: var(--ot-dark);
}
.auth-logo { margin-bottom: 32px; text-align: center; }
.auth-logo h1 { font-size: 28px; font-weight: 700; color: var(--ot-white); }
.auth-logo h1 span { color: var(--ot-blue); }
.auth-logo p { color: var(--ot-text-muted); font-size: 14px; margin-top: 4px; }
.auth-card { width: 100%; max-width: 480px; }
.auth-footer { margin-top: 24px; text-align: center; color: var(--ot-text-muted); font-size: 14px; }

/* Dashboard Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width); background: var(--ot-dark-2);
  border-right: 1px solid var(--ot-border); display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform 0.3s;
}
.sidebar-header {
  padding: 20px; border-bottom: 1px solid var(--ot-border);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-header h1 { font-size: 20px; font-weight: 700; }
.sidebar-header h1 span { color: var(--ot-blue); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: var(--ot-text-muted); font-size: 14px;
  transition: all 0.2s; text-decoration: none; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: var(--ot-dark-3); color: var(--ot-text); }
.sidebar-nav a.active { color: var(--ot-blue); background: rgba(242,122,26,0.08); border-left-color: var(--ot-blue); }
.sidebar-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-nav .nav-badge {
  margin-left: auto; background: var(--ot-blue); color: var(--ot-white);
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
}
.sidebar-nav .nav-divider { height: 1px; background: var(--ot-border); margin: 8px 20px; }
.sidebar-nav .nav-section { padding: 8px 20px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--ot-text-muted); }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--ot-border); }
.sidebar-user { display: flex; align-items: center; gap: 12px; }
.sidebar-user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ot-blue); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--ot-white); font-size: 14px; }
.sidebar-user-info { flex: 1; }
.sidebar-user-info .name { font-size: 14px; font-weight: 500; }
.sidebar-user-info .role { font-size: 12px; color: var(--ot-text-muted); }

.main-content { flex: 1; margin-left: var(--sidebar-width); }
.top-bar {
  height: 60px; background: var(--ot-dark-2); border-bottom: 1px solid var(--ot-border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.top-bar .hamburger { display: none; background: none; border: none; color: var(--ot-text); cursor: pointer; padding: 8px; }
.top-bar .page-title { font-size: 18px; font-weight: 600; }
.content-area { padding: 24px; max-width: 1200px; }

/* Bottom Nav (mobile) */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--ot-dark-2); border-top: 1px solid var(--ot-border);
  z-index: 100; padding: 8px 0; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
}
.bottom-nav-inner { display: flex; justify-content: space-around; align-items: center; }
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ot-text-muted); font-size: 10px; text-decoration: none;
  padding: 4px 8px; min-width: 44px; min-height: 44px; justify-content: center;
}
.bottom-nav a.active { color: var(--ot-blue); }
.bottom-nav a svg { width: 22px; height: 22px; }

/* Overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }

/* Tier badges */
.tier-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.tier-starter { background: rgba(242,122,26,0.15); color: var(--ot-blue); }
.tier-pro { background: rgba(210,153,34,0.15); color: var(--ot-warning); }
.tier-business { background: rgba(46,160,67,0.15); color: var(--ot-success); }

/* Gated feature badge */
.gated-badge { font-size: 10px; background: var(--ot-warning); color: var(--ot-dark); padding: 1px 6px; border-radius: 4px; margin-left: 8px; font-weight: 600; }

/* Registration wizard */
.wizard-progress { display: flex; align-items: center; margin-bottom: 32px; overflow-x: auto; padding-bottom: 8px; }
.wizard-step-dot {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
  background: var(--ot-dark-3); color: var(--ot-text-muted); border: 2px solid var(--ot-border);
}
.wizard-step-dot.active { background: var(--ot-blue); color: var(--ot-white); border-color: var(--ot-blue); }
.wizard-step-dot.completed { background: var(--ot-success); color: var(--ot-white); border-color: var(--ot-success); }
.wizard-step-line { flex: 1; height: 2px; background: var(--ot-border); min-width: 16px; }
.wizard-step-line.completed { background: var(--ot-success); }

/* Trade selection */
.trade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.trade-chip {
  padding: 10px 12px; border: 2px solid var(--ot-border); border-radius: var(--ot-radius);
  text-align: center; cursor: pointer; transition: all 0.2s; font-size: 13px; min-height: 44px;
  display: flex; align-items: center; justify-content: center; background: var(--ot-dark-2);
}
.trade-chip:hover { border-color: var(--ot-blue); }
.trade-chip.selected { border-color: var(--ot-blue); background: rgba(242,122,26,0.1); color: var(--ot-blue); }

/* Pricing cards */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.pricing-card {
  border: 2px solid var(--ot-border); border-radius: var(--ot-radius-lg);
  padding: 24px; text-align: center; cursor: pointer; transition: all 0.2s;
  background: var(--ot-dark-2);
}
.pricing-card:hover { border-color: var(--ot-blue); }
.pricing-card.selected { border-color: var(--ot-blue); box-shadow: 0 0 0 1px var(--ot-blue); }
.pricing-card.popular { position: relative; }
.pricing-card.popular::before {
  content: 'Most Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--ot-blue); color: var(--ot-white); padding: 2px 16px; border-radius: 12px; font-size: 12px; font-weight: 600;
}
.pricing-card h3 { font-size: 20px; margin-bottom: 8px; }
.pricing-card .price { font-size: 36px; font-weight: 700; color: var(--ot-white); }
.pricing-card .price span { font-size: 16px; font-weight: 400; color: var(--ot-text-muted); }
.pricing-card .features { margin-top: 16px; text-align: left; font-size: 14px; color: var(--ot-text-muted); }
.pricing-card .features li { padding: 4px 0; list-style: none; }
.pricing-card .features li::before { content: '✓ '; color: var(--ot-success); font-weight: 600; }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--ot-dark-2); border: 1px solid var(--ot-border); border-radius: var(--ot-radius-lg); padding: 20px; }
.stat-card .stat-label { font-size: 13px; color: var(--ot-text-muted); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--ot-white); }
.stat-card .stat-change { font-size: 13px; margin-top: 4px; }
.stat-card .stat-change.up { color: var(--ot-success); }
.stat-card .stat-change.down { color: var(--ot-danger); }

/* Empty states */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-state svg { width: 64px; height: 64px; color: var(--ot-text-muted); margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--ot-text-muted); max-width: 400px; margin: 0 auto 24px; font-size: 14px; }

/* Address results */
.address-results { max-height: 200px; overflow-y: auto; border: 1px solid var(--ot-border); border-radius: var(--ot-radius); margin-top: 8px; }
.address-results .address-option { padding: 10px 16px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--ot-border); }
.address-results .address-option:hover { background: var(--ot-dark-3); }
.address-results .address-option:last-child { border-bottom: none; }

/* Alert/toast */
.alert { padding: 12px 16px; border-radius: var(--ot-radius); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: rgba(248,81,73,0.1); border: 1px solid var(--ot-danger); color: var(--ot-danger); }
.alert-success { background: rgba(46,160,67,0.1); border: 1px solid var(--ot-success); color: var(--ot-success); }
.alert-info { background: rgba(242,122,26,0.1); border: 1px solid var(--ot-blue); color: var(--ot-blue); }

/* Loading spinner */
.spinner { width: 24px; height: 24px; border: 3px solid var(--ot-border); border-top-color: var(--ot-blue); border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--ot-border); font-size: 14px; }
th { color: var(--ot-text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover td { background: var(--ot-dark-3); }

/* Status badges */
.status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-active { background: rgba(46,160,67,0.15); color: var(--ot-success); }
.status-pending { background: rgba(210,153,34,0.15); color: var(--ot-warning); }
.status-overdue { background: rgba(248,81,73,0.15); color: var(--ot-danger); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; padding-bottom: 80px; }
  .top-bar .hamburger { display: flex; }
  .bottom-nav { display: block; }
  .content-area { padding: 16px; }
  .auth-card { padding: 20px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .wizard-progress { gap: 0; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .trade-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--ot-text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.gap-2 { gap: 16px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.hidden { display: none !important; }
