/* DX Cluster Widget - stili isolati con prefisso .dxcw- - Tema chiaro */

.dxcw-widget {
  --dxcw-bg: #ffffff;
  --dxcw-bg-row: #f6f8fa;
  --dxcw-bg-row-alt: #eef1f4;
  --dxcw-border: #d8dee4;
  --dxcw-text: #24292f;
  --dxcw-text-dim: #57606a;
  --dxcw-accent: #0969da;
  --dxcw-accent-freq: #b35900;
  --dxcw-accent-new: #1a7f37;

  display: flex;
  flex-direction: column;
  background: var(--dxcw-bg) !important;
  color: var(--dxcw-text) !important;
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--dxcw-border);
  box-sizing: border-box;
}

.dxcw-widget * {
  box-sizing: border-box;
}

.dxcw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #1c2b3a !important;
  border-bottom: 1px solid var(--dxcw-border);
  flex-shrink: 0;
}

.dxcw-title {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff !important;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.dxcw-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #c9d1d9 !important;
}

.dxcw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f85149;
  transition: background 0.3s;
}

.dxcw-dot.dxcw-connected {
  background: #3fb950;
  box-shadow: 0 0 5px #3fb950;
}

.dxcw-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  background: var(--dxcw-bg-row) !important;
  border-bottom: 1px solid var(--dxcw-border);
  flex-shrink: 0;
}

.dxcw-filter-btn {
  background: #ffffff !important;
  color: var(--dxcw-text-dim) !important;
  border: 1px solid var(--dxcw-border);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.dxcw-filter-btn:hover {
  color: var(--dxcw-text) !important;
  border-color: var(--dxcw-accent);
}

.dxcw-filter-btn.dxcw-filter-active {
  background: var(--dxcw-accent) !important;
  color: #ffffff !important;
  border-color: var(--dxcw-accent);
}

.dxcw-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--dxcw-bg) !important;
}

.dxcw-table-wrap::-webkit-scrollbar {
  width: 8px;
}
.dxcw-table-wrap::-webkit-scrollbar-track {
  background: var(--dxcw-bg);
}
.dxcw-table-wrap::-webkit-scrollbar-thumb {
  background: var(--dxcw-border);
  border-radius: 4px;
}

.dxcw-widget table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin: 0;
  table-layout: fixed;
  background: var(--dxcw-bg) !important;
}

.dxcw-widget .dxcw-col-time { width: 50px; }
.dxcw-widget .dxcw-col-freq { width: 60px; }
.dxcw-widget .dxcw-col-flag { width: 24px; }
.dxcw-widget .dxcw-col-mode { width: 54px; text-align: center; }

.dxcw-widget td.dxcw-col-mode {
  font-family: 'Segoe UI', Roboto, sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: var(--dxcw-text-dim) !important;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  padding-left: 2px !important;
  padding-right: 2px !important;
}
.dxcw-widget .dxcw-col-spotterflag { width: 22px; }

/* Container query: nasconde Spotter e Commento quando il widget è stretto (es. sidebar) */
.dxcw-widget {
  container-type: inline-size;
  container-name: dxcw;
}

@container dxcw (max-width: 360px) {
  .dxcw-col-spotter,
  .dxcw-col-comment {
    display: none;
  }
}

.dxcw-widget thead th {
  position: sticky;
  top: 0;
  background: var(--dxcw-bg-row) !important;
  color: var(--dxcw-text-dim) !important;
  text-align: left;
  padding: 5px 6px;
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--dxcw-border);
  z-index: 1;
}

.dxcw-widget tbody tr {
  border-bottom: 1px solid var(--dxcw-border);
  background: var(--dxcw-bg) !important;
}

.dxcw-widget tbody tr:nth-child(even) {
  background: var(--dxcw-bg-row-alt) !important;
}

.dxcw-widget tbody tr.dxcw-new {
  animation: dxcw-flash 1.5s ease-out;
}

.dxcw-clickable {
  cursor: pointer;
}

.dxcw-clickable:hover {
  background: #e7f0fe !important;
}

@keyframes dxcw-flash {
  0%   { background-color: rgba(26, 127, 55, 0.18); }
  100% { background-color: transparent; }
}

.dxcw-widget td {
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--dxcw-text) !important;
}

.dxcw-time {
  color: var(--dxcw-text-dim) !important;
  font-family: 'Consolas', monospace;
  font-size: 10px;
  padding-left: 5px !important;
  padding-right: 2px !important;
}

.dxcw-freq {
  color: var(--dxcw-accent-freq) !important;
  font-family: 'Consolas', monospace;
  font-weight: 700;
  font-size: 10px;
  text-align: right;
  padding-left: 2px !important;
  padding-right: 4px !important;
  line-height: 1.15;
}

.dxcw-freq-value {
  white-space: nowrap;
}

.dxcw-mode {
  display: block;
  font-family: 'Segoe UI', Roboto, sans-serif;
  font-size: 8px;
  font-weight: 700;
  color: var(--dxcw-text-dim) !important;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dxcw-flag {
  width: 24px;
  text-align: center;
  padding-left: 2px !important;
  padding-right: 2px !important;
}

.dxcw-flag-img {
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: middle;
  border: 1px solid var(--dxcw-border);
}

.dxcw-flag-unknown {
  color: var(--dxcw-text-dim) !important;
  font-size: 10px;
}

.dxcw-call {
  color: #0d1117 !important;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2px;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.dxcw-spotter {
  color: var(--dxcw-accent) !important;
  font-size: 10px;
}

.dxcw-comment {
  color: var(--dxcw-text-dim) !important;
  font-size: 10px;
  max-width: 220px;
}

.dxcw-empty {
  padding: 16px;
  text-align: center;
  color: var(--dxcw-text-dim) !important;
  font-size: 11px;
}

.dxcw-footer-link {
  display: block;
  text-align: center;
  padding: 6px 8px;
  background: var(--dxcw-bg-row) !important;
  border-top: 1px solid var(--dxcw-border);
  color: var(--dxcw-accent) !important;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}

.dxcw-footer-link:hover {
  text-decoration: underline;
}
