/* ═══════════════════════════════════════════════
   RAMANI EXCHANGE — Main Stylesheet
   Professional P2P Crypto Marketplace
   ═══════════════════════════════════════════════ */

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

/* ── CSS Variables ── */
:root {
  --navy:        #1B4F72;
  --navy-dark:   #154060;
  --navy-light:  #2E86C1;
  --green:       #27AE60;
  --green-dark:  #1E8449;
  --green-light: #D5F5E3;
  --red:         #E74C3C;
  --red-light:   #FADBD8;
  --amber:       #F39C12;
  --amber-light: #FDEBD0;
  --blue-light:  #EBF5FB;
  --gray-100:    #F8F9FA;
  --gray-200:    #E9ECEF;
  --gray-300:    #DEE2E6;
  --gray-400:    #CED4DA;
  --gray-500:    #ADB5BD;
  --gray-600:    #6C757D;
  --gray-700:    #495057;
  --gray-800:    #343A40;
  --gray-900:    #212529;
  --white:       #FFFFFF;
  --body-bg:     #F0F2F5;
  --card-bg:     #FFFFFF;
  --border:      #DEE2E6;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow:      0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg:   0 4px 20px rgba(0,0,0,0.12);
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   16px;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:   'SF Mono', 'Roboto Mono', 'Consolas', monospace;
  --transition:  all 0.2s ease;
  --nav-height:  64px;
}

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family:      var(--font);
  font-size:        0.9375rem;
  line-height:      1.6;
  color:            var(--gray-900);
  background:       var(--body-bg);
  min-height:       100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--navy-dark); }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ── Layout ── */
.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; padding-top: var(--nav-height); }
.container    { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 560px;  margin: 0 auto; padding: 0 1rem; }
.container-md { max-width: 800px;  margin: 0 auto; padding: 0 1rem; }

/* ── Navigation ── */
.navbar {
  position:   fixed;
  top:        0; left: 0; right: 0;
  height:     var(--nav-height);
  background: var(--navy);
  z-index:    1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.navbar-inner {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  height:          100%;
  max-width:       1200px;
  margin:          0 auto;
  padding:         0 1rem;
  gap:             1rem;
}
.navbar-brand {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  font-size:   1.25rem;
  font-weight: 700;
  color:       var(--white) !important;
  letter-spacing: -0.3px;
}
.brand-icon {
  width:           36px;
  height:          36px;
  background:      var(--green);
  border-radius:   8px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-weight:     800;
  font-size:       1rem;
  color:           var(--white);
  flex-shrink:     0;
}
.navbar-nav {
  display:     flex;
  align-items: center;
  gap:         0.25rem;
  list-style:  none;
}
.navbar-nav .nav-link {
  display:       flex;
  align-items:   center;
  gap:           0.35rem;
  padding:       0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  color:         rgba(255,255,255,0.82);
  font-size:     0.875rem;
  font-weight:   500;
  transition:    var(--transition);
  white-space:   nowrap;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color:      var(--white);
  background: rgba(255,255,255,0.12);
}
.navbar-nav .nav-link img {
  width: 16px; height: 16px;
  filter: brightness(0) invert(1);
  opacity: 0.82;
}
.navbar-nav .nav-link:hover img,
.navbar-nav .nav-link.active img { opacity: 1; }

.nav-badge {
  background:    var(--red);
  color:         var(--white);
  font-size:     0.65rem;
  font-weight:   700;
  min-width:     18px;
  height:        18px;
  border-radius: 9px;
  padding:       0 4px;
  display:       inline-flex;
  align-items:   center;
  justify-content: center;
  line-height:   1;
}

.navbar-actions {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
}

/* Hamburger for mobile */
.nav-toggle {
  display:         none;
  background:      none;
  border:          none;
  padding:         0.4rem;
  border-radius:   var(--radius-sm);
  color:           var(--white);
  cursor:          pointer;
}
.nav-toggle img { width: 22px; height: 22px; filter: brightness(0) invert(1); }

.mobile-menu {
  display:    none;
  background: var(--navy-dark);
  padding:    0.75rem 1rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.mobile-menu.open { display: block; }
.mobile-menu .nav-link {
  display:       flex;
  align-items:   center;
  gap:           0.5rem;
  padding:       0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color:         rgba(255,255,255,0.85);
  font-size:     0.9rem;
  font-weight:   500;
}
.mobile-menu .nav-link:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.mobile-menu .nav-link img   { width: 18px; height: 18px; filter: brightness(0) invert(1); }
.mobile-menu-divider { border-top: 1px solid rgba(255,255,255,0.1); margin: 0.5rem 0; }

/* ── Buttons ── */
.btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             0.4rem;
  padding:         0.55rem 1.25rem;
  border-radius:   var(--radius-sm);
  font-size:       0.9rem;
  font-weight:     600;
  border:          2px solid transparent;
  transition:      var(--transition);
  white-space:     nowrap;
  line-height:     1.4;
  text-decoration: none;
}
.btn img { width: 16px; height: 16px; flex-shrink: 0; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--navy);
  color:      var(--white);
  border-color: var(--navy);
}
.btn-primary:hover:not(:disabled) {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
  color: var(--white);
}
.btn-green {
  background:   var(--green);
  color:        var(--white);
  border-color: var(--green);
}
.btn-green:hover:not(:disabled) {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--white);
}
.btn-outline {
  background:   transparent;
  color:        var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover:not(:disabled) {
  background: var(--navy);
  color:      var(--white);
}
.btn-outline-white {
  background:   transparent;
  color:        var(--white);
  border-color: rgba(255,255,255,0.6);
}
.btn-outline-white:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.btn-danger { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-danger:hover:not(:disabled) { background: #c0392b; border-color: #c0392b; color: var(--white); }
.btn-amber { background: var(--amber); color: var(--white); border-color: var(--amber); }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.45rem; border-radius: var(--radius-sm); }

/* ── Cards ── */
.card {
  background:    var(--card-bg);
  border-radius: var(--radius);
  box-shadow:    var(--shadow-sm);
  border:        1px solid var(--border);
  overflow:      hidden;
}
.card-header {
  padding:         1rem 1.25rem;
  border-bottom:   1px solid var(--border);
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             0.75rem;
}
.card-header h2, .card-header h3 {
  font-size:   1rem;
  font-weight: 600;
  color:       var(--gray-900);
}
.card-body   { padding: 1.25rem; }
.card-footer {
  padding:     0.875rem 1.25rem;
  border-top:  1px solid var(--border);
  background:  var(--gray-100);
}

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display:       block;
  font-size:     0.85rem;
  font-weight:   600;
  color:         var(--gray-700);
  margin-bottom: 0.4rem;
}
.form-label .required { color: var(--red); margin-left: 2px; }
.form-control {
  width:         100%;
  padding:       0.6rem 0.9rem;
  font-size:     0.9375rem;
  border:        1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background:    var(--white);
  color:         var(--gray-900);
  transition:    border-color 0.15s ease, box-shadow 0.15s ease;
  appearance:    none;
  line-height:   1.5;
}
.form-control:focus {
  outline:      none;
  border-color: var(--navy);
  box-shadow:   0 0 0 3px rgba(27,79,114,0.12);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control.is-invalid { border-color: var(--red); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(231,76,60,0.12); }
.form-hint { font-size: 0.8rem; color: var(--gray-600); margin-top: 0.3rem; }
.form-error { font-size: 0.8rem; color: var(--red); margin-top: 0.3rem; }

.input-group { position: relative; display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .input-addon {
  padding:         0.6rem 0.9rem;
  background:      var(--gray-100);
  border:          1.5px solid var(--gray-300);
  border-left:     none;
  border-radius:   0 var(--radius-sm) var(--radius-sm) 0;
  font-size:       0.875rem;
  font-weight:     600;
  color:           var(--gray-700);
  display:         flex;
  align-items:     center;
  white-space:     nowrap;
}

select.form-control {
  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='%236C757D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat:   no-repeat;
  background-position: right 0.75rem center;
  padding-right:       2.25rem;
}

/* ── Alerts ── */
.alert {
  padding:       0.875rem 1rem;
  border-radius: var(--radius-sm);
  border:        1px solid transparent;
  display:       flex;
  align-items:   flex-start;
  gap:           0.6rem;
  font-size:     0.9rem;
  margin-bottom: 1rem;
}
.alert img { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-light); border-color: #a9dfbf; color: #1a6335; }
.alert-danger  { background: var(--red-light);   border-color: #f1948a; color: #922b21; }
.alert-warning { background: var(--amber-light);  border-color: #f8c471; color: #7d5a0a; }
.alert-info    { background: var(--blue-light);   border-color: #aed6f1; color: #1a5276; }

/* ── Badges ── */
.badge {
  display:       inline-flex;
  align-items:   center;
  gap:           0.2rem;
  padding:       0.2rem 0.55rem;
  border-radius: 20px;
  font-size:     0.72rem;
  font-weight:   700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space:   nowrap;
}
.badge img { width: 12px; height: 12px; }
.badge-navy    { background: var(--navy);         color: var(--white); }
.badge-green   { background: var(--green);        color: var(--white); }
.badge-red     { background: var(--red);          color: var(--white); }
.badge-amber   { background: var(--amber);        color: var(--white); }
.badge-gray    { background: var(--gray-200);     color: var(--gray-700); }
.badge-outline { background: transparent; border: 1.5px solid var(--navy); color: var(--navy); }

/* Seller badges */
.seller-badge-verified { background: #1a5276; color: #fff; }
.seller-badge-power    { background: #6c3483; color: #fff; }
.seller-badge-expert   { background: #1a6335; color: #fff; }
.seller-badge-trusted  { background: #7d6608; color: #fff; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table {
  width:           100%;
  border-collapse: collapse;
  font-size:       0.9rem;
}
thead th {
  padding:         0.75rem 1rem;
  text-align:      left;
  font-size:       0.78rem;
  font-weight:     700;
  text-transform:  uppercase;
  letter-spacing:  0.5px;
  color:           var(--gray-600);
  background:      var(--gray-100);
  border-bottom:   2px solid var(--border);
  white-space:     nowrap;
}
tbody td {
  padding:        0.75rem 1rem;
  border-bottom:  1px solid var(--gray-200);
  vertical-align: middle;
}
tbody tr:last-child td  { border-bottom: none; }
tbody tr:hover          { background: var(--gray-100); }

/* ── Offer Cards (Marketplace) ── */
.offer-card {
  background:    var(--white);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1rem 1.25rem;
  transition:    var(--transition);
  display:       flex;
  align-items:   center;
  gap:           1rem;
}
.offer-card:hover {
  border-color: var(--navy);
  box-shadow:   var(--shadow);
  transform:    translateY(-1px);
}
.offer-seller {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  min-width:   150px;
}
.seller-avatar {
  width:           42px;
  height:          42px;
  border-radius:   50%;
  background:      var(--navy);
  color:           var(--white);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-weight:     700;
  font-size:       1rem;
  flex-shrink:     0;
}
.seller-name  { font-weight: 600; font-size: 0.9rem; }
.seller-stats { font-size: 0.78rem; color: var(--gray-600); }
.online-dot {
  width:         8px;
  height:        8px;
  border-radius: 50%;
  background:    var(--green);
  display:       inline-block;
  margin-right:  3px;
}
.offer-rate {
  flex: 1;
  text-align: center;
}
.rate-value {
  font-size:   1.3rem;
  font-weight: 700;
  color:       var(--navy);
  font-family: var(--font-mono);
}
.rate-currency { font-size: 0.8rem; color: var(--gray-600); }
.offer-limits  { flex: 1; text-align: center; font-size: 0.875rem; }
.offer-limits .limit-value { font-weight: 600; }
.offer-payment { flex: 1; }
.offer-action  { flex-shrink: 0; }

/* ── Trade Chat ── */
.chat-container {
  display:        flex;
  flex-direction: column;
  height:         420px;
  border:         1px solid var(--border);
  border-radius:  var(--radius);
  overflow:       hidden;
  background:     var(--gray-100);
}
.chat-messages {
  flex:       1;
  overflow-y: auto;
  padding:    1rem;
  display:    flex;
  flex-direction: column;
  gap:        0.6rem;
}
.chat-message { display: flex; flex-direction: column; max-width: 75%; }
.chat-message.mine    { align-self: flex-end; align-items: flex-end; }
.chat-message.theirs  { align-self: flex-start; }
.chat-message.system  { align-self: center; max-width: 90%; }
.msg-bubble {
  padding:       0.6rem 0.9rem;
  border-radius: 12px;
  font-size:     0.875rem;
  line-height:   1.5;
}
.mine   .msg-bubble { background: var(--navy);    color: var(--white); border-bottom-right-radius: 3px; }
.theirs .msg-bubble { background: var(--white);   color: var(--gray-900); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.system .msg-bubble { background: var(--amber-light); color: var(--gray-800); font-size: 0.8rem; text-align: center; border-radius: 8px; border: 1px solid #f8c471; }
.msg-meta { font-size: 0.72rem; color: var(--gray-500); margin-top: 0.2rem; padding: 0 0.25rem; }
.chat-input-bar {
  display:    flex;
  gap:        0.5rem;
  padding:    0.75rem;
  background: var(--white);
  border-top: 1px solid var(--border);
}
.chat-input-bar .form-control { border-radius: 20px; padding: 0.5rem 1rem; font-size: 0.9rem; }
.chat-input-bar .btn           { border-radius: 20px; padding: 0.5rem 1.1rem; }

/* ── Stats & Info Boxes ── */
.stat-card {
  background:    var(--white);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1.25rem;
  text-align:    center;
}
.stat-value {
  font-size:   1.75rem;
  font-weight: 700;
  color:       var(--navy);
  font-family: var(--font-mono);
  line-height: 1.2;
}
.stat-label { font-size: 0.8rem; color: var(--gray-600); margin-top: 0.25rem; font-weight: 500; }

.info-box {
  border-radius: var(--radius-sm);
  padding:       0.875rem 1rem;
  display:       flex;
  gap:           0.75rem;
  align-items:   flex-start;
  font-size:     0.875rem;
  margin-bottom: 1rem;
}
.info-box img { width: 20px; height: 20px; flex-shrink: 0; }
.info-box.navy   { background: var(--blue-light);   border-left: 4px solid var(--navy); }
.info-box.green  { background: var(--green-light);  border-left: 4px solid var(--green); }
.info-box.amber  { background: var(--amber-light);  border-left: 4px solid var(--amber); }
.info-box.red    { background: var(--red-light);    border-left: 4px solid var(--red); }

/* ── Trade Status ── */
.status-pill {
  display:       inline-flex;
  align-items:   center;
  gap:           0.3rem;
  padding:       0.3rem 0.75rem;
  border-radius: 20px;
  font-size:     0.78rem;
  font-weight:   700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-open     { background: #d6eaf8; color: #1a5276; }
.status-paid     { background: #d5f5e3; color: #1a6335; }
.status-released { background: #d5f5e3; color: #1a6335; }
.status-disputed { background: #fdebd0; color: #784212; }
.status-cancelled{ background: var(--gray-200); color: var(--gray-700); }
.status-expired  { background: var(--gray-200); color: var(--gray-700); }

/* ── Tabs ── */
.tabs {
  display:      flex;
  border-bottom: 2px solid var(--border);
  gap:           0;
  margin-bottom: 1.25rem;
  overflow-x:    auto;
}
.tab-btn {
  padding:         0.65rem 1.1rem;
  font-size:       0.875rem;
  font-weight:     600;
  color:           var(--gray-600);
  border:          none;
  background:      none;
  border-bottom:   3px solid transparent;
  margin-bottom:  -2px;
  cursor:          pointer;
  transition:      var(--transition);
  white-space:     nowrap;
  display:         flex;
  align-items:     center;
  gap:             0.35rem;
}
.tab-btn img { width: 16px; height: 16px; opacity: 0.6; }
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-btn.active img { opacity: 1; }

/* ── Page Headers ── */
.page-header {
  background:    var(--navy);
  padding:       2rem 0;
  margin-bottom: 2rem;
}
.page-header h1 {
  font-size:   1.6rem;
  font-weight: 700;
  color:       var(--white);
  margin-bottom: 0.25rem;
}
.page-header p { color: rgba(255,255,255,0.75); font-size: 0.95rem; }

/* ── Hero Section (Home) ── */
.hero {
  background:  linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
  padding:     3.5rem 0;
  text-align:  center;
  position:    relative;
  overflow:    hidden;
}
.hero::before {
  content:    '';
  position:   absolute;
  inset:      0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero h1 {
  font-size:     2.5rem;
  font-weight:   800;
  color:         var(--white);
  margin-bottom: 0.75rem;
  line-height:   1.2;
  position:      relative;
}
.hero p {
  font-size:     1.1rem;
  color:         rgba(255,255,255,0.82);
  margin-bottom: 2rem;
  position:      relative;
}
.hero-search {
  max-width:     700px;
  margin:        0 auto;
  position:      relative;
}
.hero-search-bar {
  display:       flex;
  background:    var(--white);
  border-radius: var(--radius-lg);
  overflow:      hidden;
  box-shadow:    var(--shadow-lg);
  gap:           0;
}
.hero-search-bar select,
.hero-search-bar input {
  border:   none;
  outline:  none;
  padding:  0.85rem 1rem;
  font-size: 0.95rem;
  font-family: var(--font);
}
.hero-search-bar select { border-right: 1px solid var(--border); color: var(--gray-800); min-width: 120px; background: var(--gray-100); }
.hero-search-bar input  { flex: 1; color: var(--gray-900); }
.hero-search-bar .btn   { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; padding: 0.85rem 1.5rem; }

/* ── Filter Bar ── */
.filter-bar {
  background:    var(--white);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1rem 1.25rem;
  margin-bottom: 1.25rem;
  display:       flex;
  flex-wrap:     wrap;
  gap:           0.75rem;
  align-items:   center;
}
.filter-bar .filter-group { display: flex; align-items: center; gap: 0.4rem; }
.filter-bar .filter-label { font-size: 0.78rem; font-weight: 600; color: var(--gray-600); white-space: nowrap; }
.filter-bar .form-control { min-width: 120px; padding: 0.4rem 0.7rem; font-size: 0.875rem; }
.filter-toggle {
  display:       inline-flex;
  align-items:   center;
  gap:           0.35rem;
  padding:       0.4rem 0.8rem;
  border-radius: 20px;
  border:        1.5px solid var(--border);
  font-size:     0.8rem;
  font-weight:   600;
  color:         var(--gray-600);
  cursor:        pointer;
  transition:    var(--transition);
  background:    var(--white);
  white-space:   nowrap;
}
.filter-toggle:hover  { border-color: var(--navy); color: var(--navy); }
.filter-toggle.active { border-color: var(--navy); background: var(--navy); color: var(--white); }
.filter-toggle input[type=checkbox] { display: none; }

/* ── Countdown timer ── */
.countdown {
  font-family:   var(--font-mono);
  font-size:     1.4rem;
  font-weight:   700;
  color:         var(--navy);
}
.countdown.urgent { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.6; } }

/* ── Wallet ── */
.wallet-card {
  background:    linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: var(--radius-lg);
  padding:       1.75rem;
  color:         var(--white);
  position:      relative;
  overflow:      hidden;
}
.wallet-card::after {
  content:    '';
  position:   absolute;
  right:      -30px; top: -30px;
  width:      160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.wallet-crypto { font-size: 0.85rem; opacity: 0.8; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.wallet-amount { font-size: 2rem; font-weight: 700; font-family: var(--font-mono); margin: 0.25rem 0; }
.wallet-sub    { font-size: 0.8rem; opacity: 0.7; }

/* ── Section ── */
.section { padding: 1.5rem 0; }
.section-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   1rem;
}
.section-title { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); }

/* ── Empty state ── */
.empty-state {
  text-align:  center;
  padding:     3rem 1rem;
  color:       var(--gray-600);
}
.empty-state img { width: 64px; height: 64px; opacity: 0.4; margin-bottom: 1rem; }
.empty-state h3  { font-size: 1rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.4rem; }
.empty-state p   { font-size: 0.875rem; }

/* ── Auth pages ── */
.auth-page {
  min-height:      100vh;
  display:         flex;
  align-items:     center;
  justify-content: center;
  background:      linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  padding:         1.5rem;
}
.auth-card {
  background:    var(--white);
  border-radius: var(--radius-lg);
  padding:       2.5rem;
  width:         100%;
  max-width:     440px;
  box-shadow:    var(--shadow-lg);
}
.auth-logo {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             0.6rem;
  margin-bottom:   2rem;
  font-size:       1.4rem;
  font-weight:     800;
  color:           var(--navy);
}
.auth-logo .brand-icon { width: 40px; height: 40px; font-size: 1.1rem; }
.auth-title { font-size: 1.3rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.3rem; }
.auth-sub   { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 1.75rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.875rem; color: var(--gray-600); }
.auth-divider { text-align: center; color: var(--gray-400); margin: 1rem 0; font-size: 0.8rem; position: relative; }
.auth-divider::before, .auth-divider::after {
  content:    '';
  position:   absolute;
  top:        50%; width: 43%;
  height:     1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* OTP Input */
.otp-inputs {
  display:         flex;
  gap:             0.5rem;
  justify-content: center;
  margin:          1.5rem 0;
}
.otp-input {
  width:       48px;
  height:      56px;
  text-align:  center;
  font-size:   1.4rem;
  font-weight: 700;
  border:      2px solid var(--border);
  border-radius: var(--radius-sm);
  outline:     none;
  font-family: var(--font-mono);
  transition:  var(--transition);
}
.otp-input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27,79,114,0.12); }

/* ── Notifications ── */
.notif-item {
  display:       flex;
  gap:           0.875rem;
  padding:       1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  transition:    var(--transition);
  align-items:   flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--gray-100); }
.notif-item.unread { background: var(--blue-light); }
.notif-item.unread:hover { background: #dbedf9; }
.notif-icon {
  width:           38px;
  height:          38px;
  border-radius:   50%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  flex-shrink:     0;
  background:      var(--gray-200);
}
.notif-icon img { width: 20px; height: 20px; }
.notif-icon.trade    { background: #d6eaf8; }
.notif-icon.wallet   { background: var(--green-light); }
.notif-icon.account  { background: var(--amber-light); }
.notif-icon.system   { background: var(--gray-200); }
.notif-content   { flex: 1; min-width: 0; }
.notif-title     { font-size: 0.875rem; font-weight: 600; color: var(--gray-900); margin-bottom: 0.15rem; }
.notif-msg       { font-size: 0.82rem; color: var(--gray-600); line-height: 1.45; }
.notif-time      { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.25rem; }
.unread-dot      { width: 8px; height: 8px; border-radius: 50%; background: var(--navy); flex-shrink: 0; margin-top: 6px; }

/* ── Utility ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

.d-flex   { display: flex; }
.d-none   { display: none; }
.flex-1   { flex: 1; }
.gap-1    { gap: 0.25rem; }
.gap-2    { gap: 0.5rem; }
.gap-3    { gap: 0.75rem; }
.gap-4    { gap: 1rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-600); }
.text-sm     { font-size: 0.85rem; }
.text-xs     { font-size: 0.78rem; }
.text-navy   { color: var(--navy); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mono   { font-family: var(--font-mono); }
.mt-1   { margin-top: 0.25rem; }
.mt-2   { margin-top: 0.5rem; }
.mt-3   { margin-top: 0.75rem; }
.mt-4   { margin-top: 1rem; }
.mb-1   { margin-bottom: 0.25rem; }
.mb-2   { margin-bottom: 0.5rem; }
.mb-3   { margin-bottom: 0.75rem; }
.mb-4   { margin-bottom: 1rem; }
.mb-5   { margin-bottom: 1.5rem; }
.p-3    { padding: 0.75rem; }
.p-4    { padding: 1rem; }
.rounded { border-radius: var(--radius); }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* ── Spinner ── */
.spinner {
  width:  20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.footer {
  background:   var(--navy-dark);
  color:        rgba(255,255,255,0.7);
  padding:      2.5rem 0 1.5rem;
  margin-top:   auto;
}
.footer-top {
  display:       grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap:           2rem;
  margin-bottom: 2rem;
}
.footer-brand { font-size: 1.1rem; font-weight: 700; color: var(--white); margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.footer-desc  { font-size: 0.85rem; line-height: 1.6; }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; color: var(--white); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col a  { display: block; font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: 0.4rem; }
.footer-col a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.25rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8rem; }

/* ── Toast notifications ── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background:    var(--white);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:    var(--shadow-lg);
  padding:       0.875rem 1.1rem;
  display:       flex;
  align-items:   center;
  gap:           0.6rem;
  min-width:     280px;
  max-width:     380px;
  font-size:     0.875rem;
  font-weight:   500;
  animation:     slideIn 0.25s ease;
}
.toast img       { width: 20px; height: 20px; flex-shrink: 0; }
.toast.success   { border-left: 4px solid var(--green); }
.toast.error     { border-left: 4px solid var(--red); }
.toast.warning   { border-left: 4px solid var(--amber); }
@keyframes slideIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }

/* ── Progress Steps (Register) ── */
.steps {
  display:         flex;
  align-items:     center;
  justify-content: center;
  margin-bottom:   2rem;
  gap:             0;
}
.step {
  display:     flex;
  align-items: center;
  gap:         0.4rem;
  font-size:   0.8rem;
  font-weight: 600;
  color:       var(--gray-400);
}
.step-num {
  width:           26px;
  height:          26px;
  border-radius:   50%;
  border:          2px solid var(--gray-300);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       0.75rem;
  font-weight:     700;
}
.step.active .step-num  { background: var(--navy); border-color: var(--navy); color: var(--white); }
.step.done .step-num    { background: var(--green); border-color: var(--green); color: var(--white); }
.step.active            { color: var(--navy); }
.step.done              { color: var(--green); }
.step-line              { width: 40px; height: 2px; background: var(--gray-200); margin: 0 0.25rem; }
.step.done + .step-line { background: var(--green); }

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── RESPONSIVE ── */
@media (max-width: 992px) {
  .navbar-nav    { display: none; }
  .nav-toggle    { display: flex; }
  .footer-top    { grid-template-columns: 1fr 1fr; }
  .hero h1       { font-size: 1.9rem; }
  .grid-4        { grid-template-columns: 1fr 1fr; }
  .grid-3        { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root          { --nav-height: 58px; }
  .hero          { padding: 2rem 0; }
  .hero h1       { font-size: 1.6rem; }
  .hero-search-bar { flex-wrap: wrap; }
  .hero-search-bar select { width: 100%; border-right: none; border-bottom: 1px solid var(--border); border-radius: 0; }
  .hero-search-bar input  { width: 100%; }
  .hero-search-bar .btn   { width: 100%; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .offer-card    { flex-wrap: wrap; }
  .offer-seller  { min-width: unset; width: 100%; }
  .offer-rate, .offer-limits, .offer-payment { flex: 0 0 33%; text-align: left; }
  .offer-action  { width: 100%; }
  .offer-action .btn { width: 100%; }
  .grid-2        { grid-template-columns: 1fr; }
  .grid-3        { grid-template-columns: 1fr; }
  .grid-4        { grid-template-columns: 1fr 1fr; }
  .filter-bar    { gap: 0.5rem; }
  .footer-top    { grid-template-columns: 1fr; gap: 1.25rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .auth-card     { padding: 1.75rem 1.25rem; }
  .otp-input     { width: 42px; height: 50px; font-size: 1.2rem; }
  .page-header h1 { font-size: 1.3rem; }
  .stat-value    { font-size: 1.4rem; }
  .chat-container { height: 350px; }
  .wallet-amount { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .tabs   { gap: 0; }
  .tab-btn { padding: 0.55rem 0.75rem; font-size: 0.8rem; }
  .btn-lg { padding: 0.65rem 1.25rem; font-size: 0.95rem; }
  .hero h1 { font-size: 1.35rem; }
  .otp-inputs { gap: 0.35rem; }
  .otp-input  { width: 38px; height: 46px; font-size: 1.1rem; }
}
/* ── Ramani Mobile Responsiveness ────────────────────────────────────────── */

/* Trade Room — stack columns on mobile */
@media (max-width: 768px) {
  .trade-room-grid {
    grid-template-columns: 1fr !important;
  }
  .trade-chat-card {
    height: 450px !important;
  }
}

/* Browse page filters — wrap on mobile */
@media (max-width: 768px) {
  .browse-filters {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .browse-filters > * {
    flex: 1 1 45%;
    min-width: 0;
  }
  .browse-offer-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* Offer detail — stack calculator on mobile */
@media (max-width: 768px) {
  .offer-detail-grid {
    grid-template-columns: 1fr !important;
  }
}

/* General mobile fixes */
@media (max-width: 640px) {
  .container { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
  .card { border-radius: 8px; }
  .btn-block-mobile { width: 100% !important; }
  .hide-mobile { display: none !important; }
  .text-sm-mobile { font-size: 0.8rem !important; }

  /* Navbar wallet balance — shorten on small screens */
  .nav-wallet-balance { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Trade summary cards — smaller text */
  .trade-summary-amount { font-size: 0.95rem !important; }

  /* Modal — full width on mobile */
  .modal-content { width: 95vw !important; max-width: 95vw !important; padding: 1rem !important; }

  /* Table-like rows in offer detail */
  .offer-detail-row { flex-direction: column; align-items: flex-start !important; gap: 0.25rem; }
  .offer-detail-row span:last-child { font-weight: 700; }
}

/* ── Browse page mobile ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Filter bar — stack crypto + currency on their own row */
  #filterForm { gap: 0.4rem !important; }

  /* Offer table header — hide on mobile */
  .offer-table-header { display: none !important; }

  /* Offer rows — card style on mobile */
  .offer-row {
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0.85rem !important;
    border-bottom: 1px solid var(--border);
  }
  .offer-row > div { width: 100% !important; min-width: unset !important; }

  /* Trade column on mobile — side by side */
  .offer-row .trade-col {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  /* Buy/Sell button full width on mobile */
  .offer-row .trade-col a {
    width: auto !important;
    padding: 0.5rem 1.2rem !important;
  }

  /* Trade room — full width chat on mobile */
  .trade-room-grid {
    grid-template-columns: 1fr !important;
  }
  .trade-chat-card { height: 400px !important; }

  /* Offer detail — stack on mobile */
  .offer-detail-grid {
    grid-template-columns: 1fr !important;
  }

  /* Dispute modal full screen on mobile */
  #disputeModal > div {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 1rem !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* My trades page */
  .trades-row {
    flex-direction: column !important;
    gap: 0.4rem !important;
  }

  /* Dashboard stats — 2 columns on mobile */
  .dashboard-stats {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Wallet page */
  .wallet-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 400px) {
  /* Very small screens */
  .trade-room-grid { padding: 0 !important; }
  .trade-chat-card { height: 350px !important; }
  .btn { font-size: 0.8rem !important; padding: 0.45rem 0.75rem !important; }
}


/* ── PayPal-style bottom navigation bar (mobile, authenticated) ─────────── */
.bottom-nav {
  display:        none;
  position:       fixed;
  bottom:         0;
  left:           0;
  right:          0;
  height:         60px;
  background:     #ffffff;
  border-top:     1px solid #E2E8F0;
  z-index:        900;
  box-shadow:     0 -1px 12px rgba(0,0,0,0.07);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-inner {
  display:         flex;
  align-items:     center;
  justify-content: space-around;
  height:          60px;
  max-width:       500px;
  margin:          0 auto;
  padding:         0 0.25rem;
}
.bottom-nav-item {
  flex:            1;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  gap:             2px;
  text-decoration: none;
  color:           #94A3B8;
  font-size:       0.6rem;
  font-weight:     600;
  letter-spacing:  0.01em;
  border:          none;
  background:      none;
  cursor:          pointer;
  padding:         0;
  position:        relative;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item img {
  width:   22px;
  height:  22px;
  opacity: 0.4;
}
.bottom-nav-item.active,
.bottom-nav-item:active { color: #1B4F72; }
.bottom-nav-item.active img { opacity: 1; filter: invert(20%) sepia(80%) saturate(400%) hue-rotate(190deg); }
.bottom-nav-badge {
  position:      absolute;
  top:           0;
  right:         calc(50% - 20px);
  background:    #EF4444;
  color:         white;
  font-size:     0.55rem;
  font-weight:   700;
  min-width:     15px;
  height:        15px;
  border-radius: 8px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  padding:       0 3px;
  line-height:   1;
}
.bottom-nav-post {
  flex:            1;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  gap:             2px;
  text-decoration: none;
  color:           #1B4F72;
  font-size:       0.6rem;
  font-weight:     700;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-post-icon {
  width:           40px;
  height:          40px;
  background:      #1B4F72;
  border-radius:   50%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  box-shadow:      0 3px 10px rgba(27,79,114,0.4);
}
.bottom-nav-post-icon img {
  width:  18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

/* Profile drawer */
.profile-drawer-overlay {
  display:    none;
  position:   fixed;
  inset:      0;
  background: rgba(0,0,0,0.45);
  z-index:    1000;
}
.profile-drawer-overlay.open { display: block; }
.profile-drawer {
  position:      fixed;
  bottom:        0;
  left:          0;
  right:         0;
  background:    #ffffff;
  border-radius: 16px 16px 0 0;
  z-index:       1001;
  padding:       1rem 1.25rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  transform:     translateY(100%);
  transition:    transform 0.28s cubic-bezier(0.32,0.72,0,1);
  max-height:    85vh;
  overflow-y:    auto;
}
.profile-drawer.open { transform: translateY(0); }
.profile-drawer-handle {
  width:         40px;
  height:        4px;
  background:    #E2E8F0;
  border-radius: 2px;
  margin:        0 auto 1.25rem;
}
.profile-drawer-item {
  display:      flex;
  align-items:  center;
  gap:          0.75rem;
  padding:      0.8rem 0.5rem;
  color:        #1E293B;
  font-size:    0.9rem;
  font-weight:  500;
  text-decoration: none;
  border-bottom:   1px solid #F1F5F9;
}
.profile-drawer-item:last-child { border-bottom: none; }
.profile-drawer-item img { width: 20px; height: 20px; opacity: 0.55; }
.profile-drawer-item.danger { color: #EF4444; }
.profile-drawer-item.danger img {
  filter: invert(25%) sepia(80%) saturate(500%) hue-rotate(320deg);
  opacity: 1;
}

/* Show on mobile, hide on desktop */
@media (max-width: 768px) {
  .bottom-nav                      { display: block; }
  .main-content                    { padding-bottom: 68px; }
  .navbar-actions-auth             { display: none !important; }
  .navbar-nav                      { display: none !important; }
  .nav-toggle.nav-toggle-auth      { display: none !important; }
  .navbar-inner                    { padding: 0 1rem; }
}
@media (min-width: 769px) {
  .bottom-nav              { display: none !important; }
  .profile-drawer-overlay  { display: none !important; }
  .profile-drawer          { display: none !important; }
}

/* ── Footer — simplified on mobile ── */
@media (max-width: 768px) {
  .footer { padding: 1.5rem 0 1rem; }
  .footer-top { display: none; }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #94A3B8;
  }
}



/* ── show-mobile: visible only on mobile ────────────────────────────────── */
@media (max-width: 768px) {
  .show-mobile { display: flex !important; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}

/* ── Offer detail page — mobile layout ───────────────────────────────────── */
@media (max-width: 768px) {
  .offer-detail-grid {
    grid-template-columns: 1fr !important;
  }
  /* On mobile: show calculator first (top), then offer details below */
  .offer-detail-grid > div:first-child { order: 2; }
  .offer-detail-grid > div:last-child  { order: 1; position: static !important; }
}

@media (max-width: 480px) {
  .offer-detail-stats { gap: 0.75rem !important; }
  .offer-detail-stats > div > div:first-child { font-size: 0.82rem !important; }
  .offer-detail-stats > div > div:last-child  { font-size: 0.58rem !important; }
}

/* ── Offer detail — prevent horizontal overflow on mobile ────────────────── */
@media (max-width: 768px) {
  .offer-detail-grid,
  .offer-detail-grid > div,
  .offer-detail-grid > div > div {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  /* Fix the detail rows that show value on right — wrap on small screens */
  .offer-detail-grid [style*="justify-content:space-between"] {
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }
  /* Balance display — truncate */
  .offer-detail-grid [style*="Balance:"] {
    font-size: 0.65rem !important;
    max-width: 160px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

/* ── Offer detail calculator — mobile overflow fix ───────────────────────── */
@media (max-width: 768px) {
  /* Fix the input row with MAX + currency badge */
  .offer-detail-grid [style*="border:2px solid #CBD5E1"] {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .offer-detail-grid [style*="border:2px solid #CBD5E1"] input {
    min-width: 0 !important;
    width: 0 !important;
    flex: 1 !important;
  }
  /* Fix the seller stats row overflow */
  .offer-detail-stats {
    flex-wrap: wrap !important;
    gap: 0.5rem 1rem !important;
  }
  /* Ensure the container itself never overflows */
  .container { overflow-x: hidden !important; }
}
