/* ================================================================
   CoinEdge Wealth — Global Design System
   assets/css/main.css
   ================================================================ */

/* === DESIGN TOKENS === */
:root {
  /* Admin Brand */
  --admin-topbar-bg:       #1a2035;
  --admin-sidebar-bg:      #ffffff;
  --admin-sidebar-active:  #1a2035;
  --admin-sidebar-text:    #6c757d;
  --admin-body-bg:         #f0f2f5;
  --admin-card-bg:         #ffffff;
  --admin-footer-bg:       #1a2035;
  --admin-accent:          #3d5a99;
  --admin-btn-dark:        #1a2035;
  --admin-btn-danger:      #e74c3c;
  --admin-btn-warning:     #f39c12;
  --admin-btn-info:        #3498db;
  --admin-btn-success:     #27ae60;

  /* User Brand */
  --user-header-bg:        #f5a623;
  --user-header-text:      #1a1a1a;
  --user-sidebar-active:   #f5a623;
  --user-body-bg:          #f8f9fa;
  --user-ticker-bg:        #1a1a1a;
  --user-accent:           #f5a623;
  --user-btn-primary:      #f5a623;
  --user-btn-buy:          #27ae60;
  --user-btn-sell:         #e74c3c;

  /* Shared status */
  --status-active:         #27ae60;
  --status-blocked:        #e74c3c;
  --status-pending:        #f39c12;
  --status-verified:       #27ae60;

  /* Shared neutral */
  --color-white:           #ffffff;
  --color-body-text:       #333333;
  --color-muted:           #6c757d;
  --color-border:          #e9ecef;
  --color-input-border:    #ced4da;
  --shadow-card:           0 1px 4px rgba(0,0,0,0.08);
  --shadow-modal:          0 10px 40px rgba(0,0,0,0.15);
  --shadow-dropdown:       0 4px 20px rgba(0,0,0,0.12);
  --radius-card:           8px;
  --radius-btn:            5px;
  --radius-badge:          50px;
  --transition:            0.2s ease;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-display: 'Impact', 'Arial Black', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-body-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* === SHARED BADGE === */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-badge);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-success  { background: var(--status-active);  color: #fff; }
.badge-danger   { background: var(--status-blocked); color: #fff; }
.badge-warning  { background: var(--status-pending); color: #fff; }
.badge-info     { background: #3498db;               color: #fff; }
.badge-dark     { background: var(--admin-btn-dark);  color: #fff; }

/* === SHARED BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 600;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--admin-accent);       color: #fff; }
.btn-dark      { background: var(--admin-btn-dark);     color: #fff; }
.btn-danger    { background: var(--admin-btn-danger);   color: #fff; }
.btn-warning   { background: var(--admin-btn-warning);  color: #fff; }
.btn-info      { background: var(--admin-btn-info);     color: #fff; }
.btn-success   { background: var(--admin-btn-success);  color: #fff; }
.btn-amber     { background: var(--user-accent);        color: #1a1a1a; }
.btn-sm        { padding: 5px 12px; font-size: 12px; }
.btn-lg        { padding: 12px 28px; font-size: 15px; }
.btn-block     { width: 100%; justify-content: center; }

.btn-outline-amber {
  background: transparent;
  border: 2px solid var(--user-accent);
  color: var(--user-accent);
}
.btn-outline-amber:hover { background: var(--user-accent); color: #1a1a1a; }

/* === FORM ELEMENTS === */
.form-group   { margin-bottom: 18px; }
.form-label   { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 6px; }
.form-hint    { font-size: 12px; color: var(--color-muted); margin-top: 4px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-input-border);
  border-radius: var(--radius-btn);
  font-size: 14px;
  color: var(--color-body-text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--admin-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(61,90,153,0.12);
}
.form-control.user-focus:focus {
  border-color: var(--user-accent);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.15);
}
.form-control[readonly] { background: #f5f5f5; cursor: not-allowed; }
.form-control.error     { border-color: var(--status-blocked); }

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group-prefix,
.input-group-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f0f2f5;
  border: 1.5px solid var(--color-input-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  white-space: nowrap;
}
.input-group-prefix { border-right: none; border-radius: var(--radius-btn) 0 0 var(--radius-btn); }
.input-group-suffix { border-left:  none; border-radius: 0 var(--radius-btn) var(--radius-btn) 0; }
.input-group .form-control { border-radius: 0; flex: 1; }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.52);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-dialog {
  background: #fff;
  border-radius: var(--radius-card);
  width: 90%;
  max-width: 500px;
  padding: 28px;
  box-shadow: var(--shadow-modal);
  transform: translateY(-20px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal-dialog { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title  { font-size: 17px; font-weight: 700; color: var(--admin-btn-dark); }
.modal-close  {
  background: none; border: none; font-size: 22px;
  color: var(--color-muted); cursor: pointer; line-height: 1;
  padding: 2px 6px; border-radius: 4px;
}
.modal-close:hover { background: #f0f2f5; }
.modal-footer { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* === ALERT FLASH === */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--status-active); }
.alert-error   { background: #f8d7da; color: #721c24; border-left: 4px solid var(--status-blocked); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--status-pending); }
.alert-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }
.alert-dismiss { margin-left: auto; background: none; border: none; font-size: 18px; cursor: pointer; opacity: 0.6; }
.alert-dismiss:hover { opacity: 1; }

/* === CARD === */
.card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--admin-btn-dark); }
.card-sm    { padding: 16px; }

/* === DATA TABLE === */
.datatable-wrapper { overflow-x: auto; }
.table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.export-btns { display: flex; gap: 6px; }
.search-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.search-wrap input { width: 200px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: #f8f9fa;
  padding: 12px 14px;
  font-weight: 700;
  color: #444;
  border-bottom: 2px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
}
.data-table thead th.sortable { cursor: pointer; user-select: none; }
.data-table thead th.sortable:hover { background: #eef0f3; }
.data-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.data-table tbody tr:hover  { background: #fafbfc; }
.data-table tbody tr:last-child td { border-bottom: none; }

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  justify-content: flex-end;
}
.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius-btn);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}
.page-btn:hover  { background: #f0f2f5; }
.page-btn.active { background: var(--admin-accent); color: #fff; border-color: var(--admin-accent); }

/* === TABS === */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 24px;
  gap: 2px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 20px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  border-radius: var(--radius-btn) var(--radius-btn) 0 0;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}
.tab-btn:hover  { color: var(--admin-btn-dark); background: #f5f5f5; }
.tab-btn.active { background: var(--admin-btn-dark); color: #fff; border-color: transparent; }
.tab-content.hidden { display: none; }

/* === TOGGLE PAIR === */
.toggle-group { display: inline-flex; border: 1.5px solid var(--color-border); border-radius: var(--radius-btn); overflow: hidden; }
.toggle-btn   { padding: 8px 20px; border: none; background: #fff; font-size: 13px; font-weight: 600; color: var(--color-muted); cursor: pointer; transition: background var(--transition), color var(--transition); }
.toggle-btn.active { background: var(--admin-btn-dark); color: #fff; }

/* === PLAN CARD === */
.plan-card {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1.5px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.plan-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.10); }
.plan-card-header { display: flex; align-items: center; justify-content: space-between; }
.plan-name   { font-size: 16px; font-weight: 700; color: var(--admin-btn-dark); }
.plan-label-popular { background: #eafbf0; color: var(--status-active); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-badge); }
.plan-label-vip     { background: #e8f0fb; color: var(--admin-accent); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-badge); }
.plan-price  { font-size: 48px; font-weight: 800; color: var(--admin-accent); line-height: 1; }
.plan-price span.currency { font-size: 24px; vertical-align: top; margin-top: 8px; display: inline-block; }
.plan-details { font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.plan-detail-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f0f2f5; }
.plan-detail-row:last-child { border-bottom: none; }
.plan-detail-row span:first-child { color: var(--color-muted); }
.plan-detail-row span:last-child  { font-weight: 600; }
.plan-actions { display: flex; gap: 8px; margin-top: 8px; }

/* === STAT CARD === */
.stat-card {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon-orange { background: #fff4e5; color: #f39c12; }
.stat-icon-teal   { background: #e8f8f5; color: #27ae60; }
.stat-icon-red    { background: #fdf0ef; color: #e74c3c; }
.stat-icon-purple { background: #f0eeff; color: #8e44ad; }
.stat-icon-blue   { background: #e8f4fd; color: #3498db; }
.stat-body  {}
.stat-value { font-size: 22px; font-weight: 800; color: var(--admin-btn-dark); }
.stat-label { font-size: 12px; color: var(--color-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* === BREADCRUMB === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--user-accent); }
.breadcrumb-sep { color: var(--color-muted); }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3   { font-size: 16px; color: var(--color-muted); font-weight: 600; }
.empty-state p    { font-size: 13px; color: #aaa; margin-top: 6px; }

/* === SPINNER === */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === SKELETON LOADER === */
.skeleton {
  background: linear-gradient(90deg, #f0f2f5 25%, #e9ecef 50%, #f0f2f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === UTILITY === */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--color-muted); }
.text-success { color: var(--status-active); }
.text-danger  { color: var(--status-blocked); }
.text-warning { color: var(--status-pending); }
.text-amber   { color: var(--user-accent); }
.text-navy    { color: var(--admin-btn-dark); }
.fw-700  { font-weight: 700; }
.fw-600  { font-weight: 600; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.d-flex  { display: flex; }
.d-none  { display: none; }
.gap-8   { gap: 8px; }
.gap-16  { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100   { width: 100%; }

/* === RESPONSIVE GRID UTILITIES ===
   Reusable replacements for one-off inline `style="display:grid;grid-template-columns:..."`
   so every layout collapses sanely on mobile without per-page media queries. */
.grid-2      { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3      { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4      { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-2-1    { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }      /* wide-left, narrow-right */
.grid-1-1_4  { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; }    /* narrow-left, wide-right */
.grid-sidebar-fixed { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-1_4, .grid-sidebar-fixed {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* === THEME TOGGLE BUTTON (shared across public pages + user dashboard) === */
.theme-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(127,127,127,0.14);
  color: inherit; font-size: 15px;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.theme-toggle-btn:hover { background: rgba(127,127,127,0.24); transform: translateY(-1px); }
.theme-toggle-btn .fa-sun  { display: none; }
.theme-toggle-btn .fa-moon { display: inline-block; }
[data-theme="dark"] .theme-toggle-btn .fa-sun   { display: inline-block; }
[data-theme="dark"] .theme-toggle-btn .fa-moon  { display: none; }

/* === GOOGLE TRANSLATE WIDGET (consistent compact styling everywhere it's embedded) === */
#google_translate_element { display: inline-block; }
#google_translate_element .goog-te-gadget { font-family: inherit !important; font-size: 0 !important; }
#google_translate_element .goog-te-gadget-simple {
  background: rgba(127,127,127,0.12) !important;
  border: 1px solid rgba(127,127,127,0.2) !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  display: inline-flex !important; align-items: center !important;
}
#google_translate_element .goog-te-gadget-simple .goog-te-menu-value span { font-size: 12px !important; }
.goog-tooltip, .goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
body { top: 0 !important; } /* prevent Google Translate banner from pushing page down */

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .plan-price { font-size: 36px; }
  .stat-card  { padding: 16px; }
  .search-wrap input { width: 100%; min-width: 0; }
  .modal-dialog { padding: 20px; }
  .admin-page-actions, .page-header-right { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .btn-lg { padding: 10px 20px; font-size: 14px; }
  .modal-dialog { padding: 16px; }
}
