/* src/web/styles.css */
*, *:before, *:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  color: #c9d1d9;
  overflow: hidden;
  background: #0d1117;
  height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

#app {
  height: 100vh;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-header {
  display: flex;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  flex-shrink: 0;
  align-items:  center;
  gap: 12px;
  padding: 8px 16px;
}

.app-title {
  color: #c9d1d9;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.app-stats {
  color: #484f58;
  margin-left: auto;
  font-size: 12px;
}

.search-bar {
  display: flex;
  background: #0d1117;
  border-bottom: 1px solid #21262d;
  gap: 8px;
  width: 100%;
  padding: 8px 16px 12px;
}

.search-bar input {
  color: #c9d1d9;
  outline: none;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  flex: 1;
  padding: 6px 12px;
  font-size: 13px;
}

.search-bar input:focus {
  border-color: #58a6ff;
}

.search-bar input::placeholder {
  color: #484f58;
}

.search-bar button {
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  background: #4896ef;
  border: 1px solid #58a6ff;
  border-radius: 6px;
  padding: 6px 16px;
  transition: background .1s, border-color .1s;
  font-size: 13px;
  font-weight: 500;
}

.search-bar button:hover {
  background: #58a6ff;
  border-color: #79c0ff;
}

.search-bar button:active {
  background: #4896ef;
}

.main-content {
  display: flex;
  overflow: hidden;
  flex: 1;
}

.symbol-list-panel {
  position: relative;
  display: flex;
  background: #0d1117;
  border-right: 1px solid #21262d;
  flex-direction: column;
  flex: 0 0 40%;
  min-width: 280px;
}

.symbol-list {
  overflow-y: auto;
  flex-grow: 1;
  min-height: 0;
}

.symbol-list-empty {
  display: flex;
  color: #484f58;
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items:  center;
  gap: 4px;
  height: 100%;
  padding: 24px;
  font-size: 13px;
}

.symbol-list-empty p {
  color: #30363d;
  font-size: 12px;
}

.symbol-card {
  display: flex;
  cursor: pointer;
  border-bottom: 1px solid #161b22;
  flex-direction: row-reverse;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  transition: background .1s;
  font-size: 13px;
}

.symbol-card:hover {
  background: #161b22;
}

.symbol-card.selected {
  background: #1c2333;
  border-left: 2px solid #58a6ff;
  padding-left: 10px;
}

.symbol-card-name-wrapper {
  color: #6e7681;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
  font-family: monospace;
}

.symbol-card-name {
  color: #79c0ff;
  font-size: 13px;
  font-weight: 600;
}

.exposition-only {
  font-style: italic;
}

.symbol-card-aux {
  display: flex;
  flex-shrink: 0;
  align-items:  center;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
}

.symbol-card-header {
  color: #484f58;
  white-space: nowrap;
  font-size: 10px;
}

.symbol-card-namespace {
  color: #6e7681;
  white-space: nowrap;
  font-size: 10px;
}

.symbol-card-params {
  color: #6e7681;
  white-space: nowrap;
  font-size: 12px;
}

.compact .symbol-card-params {
  font-size: 10px;
}

.badge {
  display: inline-block;
  white-space: nowrap;
  border-radius: 8px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
}

.badge-access {
  color: #9e8b9d;
  background: #816e8133;
}

.badge-class {
  color: #58a6ff;
  background: #1f6feb33;
}

.badge-union {
  color: #bc8cff;
  background: #8957e533;
}

.badge-enum {
  color: #f0883e;
  background: #da363333;
}

.badge-function {
  color: #d29922;
  background: #9e6a0333;
}

.badge-variable {
  color: #3fb950;
  background: #23863633;
}

.badge-typeAlias {
  color: #db61a2;
  background: #bf4b8a33;
}

.badge-concept {
  color: #58a6ff;
  background: #1f6feb33;
}

.badge-macro {
  color: #8b949e;
  background: #6e768133;
}

.badge-template {
  color: #bc8cff;
  background: #8957e533;
}

.badge-using, .badge-namespace {
  color: #8b949e;
  background: #6e768133;
}

.badge-deduction {
  color: #9d99c1;
  background: #252e33;
}

.badge-friend {
  color: #208d70;
  background: #46a66933;
}

.badge-static {
  color: #b2b426;
  background: #eef10733;
}

.badge-virtual {
  color: #f0703e;
  background: #da413333;
}

.badge-default {
  color: #8b949e;
  background: #21262d;
}

.badge-tag {
  color: #8b949e;
  background: #1c2333;
  font-family: monospace;
  font-size: 10px;
}

.symbol-detail-panel {
  overflow-y: auto;
  flex: 1;
  padding: 12px 24px;
}

.symbol-detail-empty {
  display: flex;
  color: #484f58;
  flex: 1;
  justify-content: center;
  align-items:  center;
  height: 100%;
  font-size: 13px;
}

.symbol-detail-header {
  margin-bottom: 20px;
}

.symbol-detail-prefix, .symbol-detail-postfix {
  color: #8b949e;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 12px;
}

.symbol-detail-name-container {
  display: inline-block;
  margin-top: 2px;
  line-height: .9;
}

.symbol-detail-prefix {
  margin-inline-end: 1px;
}

.symbol-detail-postfix {
  margin-inline-start: 2px;
}

.symbol-detail-name {
  color: #79c0ff;
  white-space: pre;
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
}

.symbol-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.symbol-detail-section {
  margin-bottom: 20px;
}

.symbol-detail-section-title {
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
}

.code-block {
  overflow-x: auto;
  color: #c9d1d9;
  white-space: pre;
  tab-size: 2;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 12px 16px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.data-table th {
  text-align: left;
  color: #8b949e;
  border-bottom: 1px solid #21262d;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
}

.data-table td {
  color: #c9d1d9;
  border-bottom: 1px solid #161b22;
  padding: 4px 8px;
  font-family: monospace;
}

.data-table td.name-col {
  color: #79c0ff;
}

.data-table td.dim {
  color: #6e7681;
}

.meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 12px;
}

.meta-label {
  color: #8b949e;
}

.meta-value {
  display: flex;
  color: #c9d1d9;
  gap: 6px;
  font-family: monospace;
}

.member-card {
  display: flex;
  cursor: pointer;
  border-bottom: 1px solid #161b22;
  align-items:  center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 12px;
}

.member-card:hover {
  background: #161b22;
}

.member-card-name {
  color: #79c0ff;
  font-family: monospace;
  font-weight: 600;
}

.member-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.member-list {
  display: grid;
  grid-template-columns: min-content 1fr;
}

.member-list .symbol-card {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}

.loading {
  display: flex;
  color: #8b949e;
  justify-content: center;
  align-items:  center;
  gap: 8px;
  height: 100vh;
  font-size: 13px;
}

.spinner {
  animation: spin .6s linear infinite;
  border: 2px solid #30363d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-view {
  display: flex;
  color: #f85149;
  flex-direction: column;
  justify-content: center;
  align-items:  center;
  gap: 6px;
  height: 100vh;
  font-size: 13px;
}

.error-view p {
  color: #8b949e;
  font-size: 12px;
}

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

::-webkit-scrollbar-track {
  background: none;
}

::-webkit-scrollbar-thumb {
  background: #21262d;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #30363d;
}

.detail-page {
  overflow-y: auto;
  flex: 1;
  padding: 12px 24px 20px;
}

.breadcrumb {
  display: flex;
  border-bottom: 1px solid #21262d;
  flex-wrap: wrap;
  align-items:  center;
  gap: 4px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  font-size: 13px;
}

.breadcrumb-link {
  color: #79c0ff;
  text-decoration: none;
  font-family: monospace;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #484f58;
  margin: 0 2px;
}

.breadcrumb-current {
  color: #c9d1d9;
  font-family: monospace;
  font-weight: 600;
}

.back-btn {
  display: inline-block;
  color: #8b949e;
  cursor: pointer;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 4px 10px;
  font-family: monospace;
  font-size: 12px;
}

.back-btn:hover {
  color: #c9d1d9;
  background: #1c2333;
  border-color: #30363d;
}
