:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: #e8ecef;
  background: #090b10;
  --bg: #0d1117;
  --surface: rgba(22, 28, 36, 0.92);
  --surface-strong: rgba(12, 23, 31, 0.98);
  --border: rgba(148, 163, 184, 0.14);
  --text-muted: #8b95a1;
  --accent: #6d8cff;
  --accent-soft: rgba(109, 140, 255, 0.18);
  --shadow: 0 32px 120px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

/* Apply consistent button styles globally */
button, .home-button, .load-button {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(109, 140, 255, 0.16);
  color: #e9f0ff;
  border: 1px solid rgba(109, 140, 255, 0.18);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 180ms ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}

button:hover, .home-button:hover, .load-button:hover {
  border-color: rgba(109, 140, 255, 0.45);
  background: rgba(109, 140, 255, 0.14);
  color: #f6f8ff;
  transform: translateY(-1px);
}

html, body {
  min-height: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top left, rgba(109, 140, 255, 0.14), transparent 28%),
              radial-gradient(circle at bottom right, rgba(151, 100, 255, 0.12), transparent 30%),
              linear-gradient(180deg, #070a0f 0%, #0c1017 100%);
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
  font-size: 16px;
  line-height: 1.6;
  padding: 15px;
  color: var(--text-muted);
  height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
}

.page {
  width: 100%;
  max-width: 84%;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}

header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  height: 56px; /* Updated standard header height to 56px */
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  gap: 15px;
}

/* Specific height for the dashboard header */
.dashboard-header {
  height: 80px;
}

.ticker-container {
  flex: 1;
  min-width: 0;
  height: 70px; /* Container height 70px */
  overflow: hidden;
  display: flex;
  align-items: center;
}

tv-ticker-tape {
  width: 100%;
  height: 100%;
}

.main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}

.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 32px;
  min-height: 0;
  flex: 1;
  color: #e8ecf3;
  text-align: center;
}

.welcome-inner {
  max-width: 900px;
  width: 100%;
}

.link-group {
  margin-bottom: 20px;
  text-align: center;
  width: 100%;
}

.link-group h2 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 10px;
}

.quick-links-list {
  list-style: none !important;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.quick-links-list li {
  list-style: none !important;
  padding: 0;
  margin: 0;
}

.quick-links-list li a {
  display: block;
  padding: 10px 20px;
  background: rgba(22, 28, 36, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #e8ecef;
  text-decoration: none;
  transition: all 0.3s ease;
  text-align: center;
  font-weight: 500;
  font-size: 13px;
}

.quick-links-list li a:hover {
  border-color: rgba(109, 140, 255, 0.45);
  background: rgba(109, 140, 255, 0.14);
  color: #f6f8ff;
  transform: translateY(-1px);
}

.tradingview-grid {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  position: relative;
  z-index: 5;
  gap: 5px;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.tradingview-grid.show {
  display: grid;
}

.tv-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(109, 140, 255, 0.15);
  border-radius: 20px;
  background: rgba(10, 14, 20, 0.96);
  height: 100%;
  position: relative;
  z-index: 6;
  overflow: hidden;
  transform: translateZ(0);
}

.tv-panel-header {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(109, 140, 255, 0.12);
  flex: 0 0 auto;
}

.tv-panel-header input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.2);
  color: #f5f8ff;
  outline: none;
  font-size: 14px;
}

.tv-widget {
  flex: 1;
  min-height: 280px;
  height: 100%;
  background: #081018;
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

.tradingview-widget-container {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  display: block !important;
  background-color: #0d1117 !important;
}

.tv-widget iframe {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  visibility: visible !important;
  opacity: 1 !important;
  border: 0 !important;
  background: transparent !important;
  z-index: 1 !important;
}

@media (max-width: 900px) {
  .tradingview-grid {
    grid-template-columns: 1fr;
  }
  .page {
    max-width: 95%;
  }
}

@media (max-width: 760px) {
  header {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }
}

