:root {
  --bg-color: #000000;
  --panel-bg: rgba(28, 28, 30, 0.55);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);
  --accent-blue: #0a84ff;
  --accent-green: #30d158;
  --accent-red: #ff453a;
  --accent-yellow: #ffd60a;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  font-family: var(--font-sans);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Premium dark background with colorful ambient lights */
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(10, 132, 255, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(48, 209, 88, 0.1) 0%, transparent 45%);
}

.hidden {
  display: none !important;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-blue);
  animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Login Container */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}
.login-card {
  background: var(--panel-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
  animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-logo-container {
  margin-bottom: 24px;
  display: inline-block;
}

.anime-logo {
  width: 110px;
  height: 110px;
  border-radius: 24px;
  object-fit: cover;
  border: 2px solid var(--accent-blue);
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.3);
  transition: all 0.3s ease;
  animation: floatLogo 4s ease-in-out infinite;
}
.anime-logo:hover {
  transform: scale(1.05) rotate(2deg);
  border-color: var(--accent-green);
  box-shadow: 0 12px 32px rgba(48, 209, 88, 0.4);
}
@keyframes floatLogo {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.login-card h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.login-card .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
  font-weight: 400;
}

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.error-alert {
  background: rgba(255, 69, 58, 0.15);
  border: 1px solid rgba(255, 69, 58, 0.3);
  color: #ff9f0a;
}

.apple-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.discord-btn {
  background-color: #5865F2;
  color: white;
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.35);
}
.discord-btn:hover {
  background-color: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
}
.discord-btn:active {
  transform: translateY(0);
}

.discord-logo-svg {
  width: 20px;
  height: 20px;
}

.footer-note {
  margin-top: 36px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Dashboard Container */
.dashboard-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

/* Header */
.app-header {
  height: 60px;
  border-bottom: 1px solid var(--panel-border);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(20, 20, 22, 0.7);
  z-index: 100;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mini-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.app-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.separator {
  color: var(--text-muted);
  font-weight: 300;
}
.server-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}
.status-dot.offline {
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 12px 4px 6px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
}
.user-profile .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.user-profile .username {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Dashboard Content Grid */
.dashboard-content {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  padding: 24px;
  gap: 24px;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* Sidebar Metrics */
.metrics-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}
.glass-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glass-card h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 600;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}
.info-row:last-child {
  border-bottom: none;
}
.info-label {
  color: var(--text-secondary);
}
.info-value {
  font-weight: 500;
}

/* Circular Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  justify-items: center;
}
.metric-circle-box {
  position: relative;
  width: 90px;
  height: 90px;
}
.metric-circle-box svg {
  width: 90px;
  height: 90px;
  transform: rotate(-90deg);
}
.metric-circle-box circle {
  fill: none;
  stroke-width: 7;
}
.metric-circle-box .bg-circle {
  stroke: rgba(255, 255, 255, 0.05);
}
.metric-circle-box .progress-circle {
  stroke-linecap: round;
  stroke-dasharray: 251.2; /* 2 * pi * r = 2 * 3.14 * 40 = 251.2 */
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
#tps-circle {
  stroke: var(--accent-green);
  filter: drop-shadow(0 0 4px rgba(48, 209, 88, 0.5));
}
#ram-circle {
  stroke: var(--accent-blue);
  filter: drop-shadow(0 0 4px rgba(10, 132, 255, 0.5));
}
.circle-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.circle-label .number {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.circle-label .label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 1px;
}

.metrics-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-row {
  display: flex;
  align-items: center;
  font-size: 13px;
}
.dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
}
.dot-indicator.green { background-color: var(--accent-green); }
.dot-indicator.blue { background-color: var(--accent-blue); }
.detail-label {
  color: var(--text-secondary);
  flex: 1;
}
.detail-value {
  font-weight: 500;
}

.status-banner-card {
  flex: 1;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.08) 0%, rgba(28, 28, 30, 0.4) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.banner-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 6px;
}
.status-banner-card p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}
.api-code {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: block;
  word-break: break-all;
  color: var(--text-secondary);
}

/* Console / Terminal */
.console-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.mac-window {
  flex: 1;
  background-color: rgba(10, 10, 12, 0.85);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* macOS Window Header */
.mac-window-header {
  height: 38px;
  background-color: rgba(22, 22, 24, 0.9);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: relative;
}
.window-buttons {
  display: flex;
  gap: 8px;
}
.window-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.btn-close { background-color: #ff5f56; }
.btn-minimize { background-color: #ffbd2e; }
.btn-maximize { background-color: #27c93f; }

.window-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: var(--font-sans);
}
.window-actions {
  margin-left: auto;
}
.window-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.1s;
}
.window-action-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.window-action-btn svg {
  width: 14px;
  height: 14px;
}

/* Terminal Body */
.terminal-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #f1f1f1;
}

.terminal-line {
  margin-bottom: 4px;
  white-space: pre-wrap;
  word-break: break-all;
}

.system-line {
  color: var(--text-muted);
  font-style: italic;
}
.input-echo-line {
  color: var(--accent-blue);
  font-weight: 500;
}
.error-line {
  color: var(--accent-red);
}

/* Custom terminal colors based on Minecraft section sign § */
.color-0 { color: #000000; } /* Black */
.color-1 { color: #0000AA; } /* Dark Blue */
.color-2 { color: #00AA00; } /* Dark Green */
.color-3 { color: #00AAAA; } /* Dark Aqua */
.color-4 { color: #AA0000; } /* Dark Red */
.color-5 { color: #AA00AA; } /* Dark Purple */
.color-6 { color: #FFAA00; } /* Gold */
.color-7 { color: #AAAAAA; } /* Gray */
.color-8 { color: #555555; } /* Dark Gray */
.color-9 { color: #5555FF; } /* Blue */
.color-a { color: #55FF55; } /* Green */
.color-b { color: #55FFFF; } /* Aqua */
.color-c { color: #FF5555; } /* Red */
.color-d { color: #FF55FF; } /* Light Purple */
.color-e { color: #FFFF55; } /* Yellow */
.color-f { color: #FFFFFF; } /* White */

/* Scrollbar */
.terminal-body::-webkit-scrollbar {
  width: 8px;
}
.terminal-body::-webkit-scrollbar-track {
  background: transparent;
}
.terminal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.terminal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Input Bar */
.terminal-input-bar {
  height: 52px;
  background-color: rgba(18, 18, 20, 0.95);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.prompt-symbol {
  font-family: var(--font-mono);
  color: var(--accent-blue);
  font-weight: bold;
  font-size: 15px;
  user-select: none;
}
.terminal-input-bar input {
  flex: 1;
  background: none;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  height: 100%;
}
.terminal-input-bar input::placeholder {
  color: var(--text-muted);
}
.send-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}
.send-btn:not(:disabled) {
  color: var(--accent-blue);
}
.send-btn:not(:disabled):hover {
  background: rgba(10, 132, 255, 0.1);
  transform: scale(1.05);
}
.send-btn:active {
  transform: scale(0.95);
}
.send-btn svg {
  width: 18px;
  height: 18px;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-content {
    grid-template-columns: 1fr;
    overflow-y: auto;
    height: auto;
  }
  .terminal-body {
    height: 400px;
    flex: none;
  }
  .mac-window {
    height: 500px;
  }
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stats Page Additions */
.stats-dashboard-content {
  display: flex !important;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto !important;
  padding: 10px;
}

.trades-summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
}

.stat-metric-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}

.stat-metric-card h4 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  font-feature-settings: "tnum";
}

.trades-log-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.trades-list-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 20px;
  overflow: hidden;
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.card-header-bar h3 {
  font-size: 18px;
  font-weight: 600;
}

.search-box input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  width: 260px;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.08);
}

.trades-list-wrapper {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.trade-log-card {
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  animation: fadeInDown 0.3s ease-out;
}

.trade-log-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.trade-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.trade-time {
  font-size: 12px;
  color: var(--text-muted);
}

.trade-flow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.player-offer-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-offer-col.text-right {
  align-items: flex-end;
}

.trader-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-blue);
}

.offer-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.offer-details.text-right {
  align-items: flex-end;
}

.offer-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-primary);
}

.no-items-label {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.coins-badge {
  display: inline-block;
  background: rgba(255, 214, 10, 0.12);
  border: 1px solid rgba(255, 214, 10, 0.2);
  color: var(--accent-yellow);
  font-weight: 600;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  width: fit-content;
}

.trade-arrow-col {
  display: flex;
  justify-content: center;
  align-items: center;
}

.swap-arrow {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  animation: pulseArrow 2s infinite ease-in-out;
}

@keyframes pulseArrow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.no-trades-msg {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-style: italic;
}

.error-msg {
  text-align: center;
  padding: 40px;
  color: var(--accent-red);
}
