/* ============================================
   ROYLITH - Premium Crypto Investment Platform
   Luxury Dark Theme with Gold Accents
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  /* Core Colors */
  --background: #0B1120;
  --background-light: #111827;
  --background-card: #151d2e;
  --background-card-hover: #1a2438;
  
  /* Gold/Primary */
  --primary: #EAB308;
  --primary-dark: #a27f07;
  --primary-light: #fcd34d;
  --primary-glow: rgba(234, 179, 8, 0.3);
  
  /* Text */
  --foreground: #e8dcc8;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  /* Status */
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.2);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.2);
  --blue: #3b82f6;
  --purple: #8b5cf6;
  
  /* Borders */
  --border: rgba(234, 179, 8, 0.2);
  --border-light: rgba(255, 255, 255, 0.1);
  
  /* Shadows */
  --shadow-gold: 0 0 30px rgba(234, 179, 8, 0.15);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
  
  /* Typography */
  --font-display: 'Cinzel', serif;
  --font-body: 'Space Grotesk', sans-serif;
  
  /* Spacing */
  --header-height: 70px;
  --sidebar-width: 260px;
  --content-max-width: 1400px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.gold-text {
  color: var(--primary);
}

.green-text {
  color: var(--green);
}

.red-text {
  color: var(--red);
}

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

/* ============================================
   HEADER / NAVIGATION
   ============================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(11, 17, 32, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--background);
  box-shadow: var(--shadow-gold);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--foreground);
  background: var(--background-card);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(234, 179, 8, 0.1);
}

.nav-link .badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.nav-link .badge-gold {
  background: var(--primary);
  color: var(--background);
}

.nav-link .badge-hot {
  background: var(--red);
  color: white;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wallet-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.wallet-display .amount {
  color: var(--primary);
  font-weight: 600;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu:hover {
  border-color: var(--primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--background);
}

.user-name {
  font-size: 14px;
  font-weight: 500;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.main-wrapper {
  padding-top: var(--header-height);
  min-height: 100vh;
}

.page-content {
  padding: 32px 24px;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.page-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 1px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 12px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--background);
  border: none;
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(234, 179, 8, 0.3);
}

.btn-secondary {
  background: var(--background-card);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.btn-outline:hover {
  background: rgba(234, 179, 8, 0.1);
}

.btn-green {
  background: var(--green);
  color: white;
}

.btn-red {
  background: var(--red);
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: rgba(234, 179, 8, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon {
  color: var(--primary);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  font-size: 15px;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.form-select {
  width: 100%;
  padding: 14px 16px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  font-size: 15px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button .form-input {
  flex: 1;
}

.input-addon {
  position: relative;
}

.input-addon .form-input {
  padding-right: 80px;
}

.input-addon-text {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-addon-text .all-btn {
  padding: 4px 10px;
  background: var(--primary);
  color: var(--background);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.input-addon-text .currency {
  color: var(--text-muted);
  font-weight: 500;
}

/* Coin selector chips */
.coin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.coin-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s ease;
}

.coin-chip:hover {
  border-color: var(--primary);
  background: var(--background-card-hover);
  transform: translateY(-1px);
}

.coin-chip.active {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(234, 179, 8, 0.1));
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
}

.coin-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

/* ============================================
   TABLES
   ============================================ */

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: background 0.2s ease;
}

.table tbody tr:hover {
  background: var(--background-card-hover);
}

.table .coin-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table .coin-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.table .coin-name {
  font-weight: 600;
}

.table .coin-symbol {
  font-size: 13px;
  color: var(--text-muted);
}

.table .price {
  font-weight: 600;
  font-family: var(--font-body);
}

.table .change {
  font-weight: 600;
}

.table .change.positive {
  color: var(--green);
}

.table .change.negative {
  color: var(--red);
}

/* ============================================
   STATS / METRICS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: var(--green-dim);
  color: var(--green);
}

.badge-danger {
  background: var(--red-dim);
  color: var(--red);
}

.badge-warning {
  background: rgba(234, 179, 8, 0.2);
  color: var(--primary);
}

.badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: var(--blue);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ============================================
   TABS
   ============================================ */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--background);
  border-radius: 12px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--foreground);
}

.tab.active {
  background: var(--background-card);
  color: var(--primary);
  box-shadow: var(--shadow-card);
}

/* ============================================
   ALERTS / INFO BOXES
   ============================================ */

.alert {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  font-size: 14px;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-warning {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.alert-success {
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* ============================================
   SIDEBAR INFO PANEL
   ============================================ */

.info-panel {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.info-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-panel ul {
  list-style: none;
}

.info-panel li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.info-panel li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* ============================================
   DONUT CHART (Balance Allocation)
   ============================================ */

.donut-chart {
  position: relative;
  width: 160px;
  height: 160px;
}

.donut-chart svg {
  transform: rotate(-90deg);
}

.donut-chart .center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-chart .center-label {
  font-size: 12px;
  color: var(--text-muted);
}

.donut-chart .center-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .nav {
    display: none;
  }
  
  .header-right {
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .page-actions {
    width: 100%;
  }
  
  .page-actions .btn {
    flex: 1;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .wallet-display {
    display: none;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ============================================
   NAV DROPDOWNS
   ============================================ */

.nav-dropdown-trigger {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.nav-dropdown-trigger:hover .nav-dropdown,
.nav-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-dropdown a:hover {
  background: var(--background);
  color: var(--primary);
}

/* ============================================
   USER MENU DROPDOWN
   ============================================ */

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu:hover {
  border-color: var(--primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--background);
}

.user-name {
  font-size: 14px;
  font-weight: 500;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.user-menu.open .user-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-dropdown a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.user-menu-dropdown a:hover {
  background: var(--background);
  color: var(--foreground);
}

.user-menu-dropdown a.logout {
  color: var(--red);
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.user-menu-dropdown a.logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Logo Image */
.logo-img {
  height: 40px;
  width: auto;
}

/* Auth Logo */
.auth-logo-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}
