
:root {
  --primary-color: #3498db;
  --secondary-color: #2980b9;
  --accent-color: #e74c3c;
  --text-color: #333333;
  --light-text: #ffffff;
  --background-color: #f5f7fa;
  --card-bg: #ffffff;
  --border-color: #e1e8ed;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 0;
  padding: 0;
  background: var(--background-color);
  line-height: 1.6;
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  width: 100%;
  max-width: 1200px;
  padding: 20px;
  box-sizing: border-box;
}

h2 {
  text-align: center;
  color: var(--primary-color);
  margin: 20px 0;
  font-size: 28px;
  font-weight: 600;
}

/* Header and Navigation */
.nav-container {
  width: 100%;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 15px;
  margin-bottom: 20px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Buttons */
.button {
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  color: var(--light-text) !important;
  border: none;
  padding: 10px 16px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  margin: 5px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  background: linear-gradient(to bottom, var(--secondary-color), var(--primary-color));
  color: var(--light-text) !important;
  text-decoration: none;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
  margin: 5px;
}

.dropbtn {
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  color: var(--light-text);
  border: none;
  padding: 10px 16px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--card-bg);
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 1000;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.dropdown-content a {
  color: var(--text-color) !important;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
  transition: var(--transition);
  font-size: 14px !important;
  font-weight: normal !important;
}

.dropdown-content a:hover {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--primary-color) !important;
}

.dropdown:hover .dropdown-content {
  display: block;
  animation: fadeIn 0.3s;
}

.dropdown:hover .dropbtn {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  background: linear-gradient(to bottom, var(--secondary-color), var(--primary-color));
}

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

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 15px 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background-color: var(--card-bg);
}

th {
  background-image: linear-gradient(to bottom, #000080 0%, #193dff 100%);color:#fff519;
  padding: 12px;
  text-align: center;
  font-weight: 600;
}

td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Server Activity table */
table.active-qso {
  border: 0;
  text-align: center;
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  margin: 15px 0;
}

.active-qso th {
  background-image: linear-gradient(to bottom, #000080 0%, #193dff 100%);color:#fff519;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
}

.active-qso td {
  line-height: 1.4;
  height: 45px;
  border: none;
  background-color: var(--card-bg);
  font-size: 14px;
  font-weight: 500;
  padding: 12px;
}

.active-qso tr:last-child td {
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Static TG table */
table.stctg {
  table-layout: fixed;
  width: 100%;
  margin: 15px 0;
  background-color: var(--card-bg);
}

.ts1-bkgnd {
  background-color: rgba(0, 0, 0, 0.03);
}

.stctg .connted-bkgnd {
  background-color: rgba(46, 204, 113, 0.15);
}

.stctg .location {
  font-size: 92%;
  color: #b5651d;
  font-weight: 600;
}

/* Master peer table */
table.lnksys {
  table-layout: fixed;
  width: 100%;
  margin: 15px 0;
  background-color: var(--card-bg);
}

.lnksys .connted-bkgnd {
  background-color: rgba(46, 204, 113, 0.15);
}

.lnksys .location {
  font-size: 92%;
  color: #b5651d;
  font-weight: 600;
}

.lnksys .peer-conn {
  font-size: 14px;
  background-color: rgba(46, 204, 113, 0.15);
}

.lnksys .peer-disc {
  font-size: 14px;
  background-color: rgba(231, 76, 60, 0.15);
}

/* Last heard table */
table.log {
  background-color: var(--card-bg);
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  text-align: center;
  margin: 15px 0;
}

.log th {
  padding: 12px;
}

.log tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Log display */
#log {
  height: 40em;
  text-align: left;
  overflow-y: scroll;
  font-size: 14px;
  background-color: #1e1e1e;
  color: #4caf50;
  border-radius: var(--border-radius);
  padding: 15px;
  font-family: 'Courier New', monospace;
  box-shadow: var(--shadow);
}

/* Connection to server */
.conn2srv {
  font-size: 14px;
  font-weight: 500;
  margin: 15px 0;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 15px;
}

.conn2srv .tittle {
  margin-bottom: 10px;
  color: var(--primary-color);
  font-weight: 600;
  line-height: 1.5;
}

.conn2srv .hs-peers {
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  margin: 10px 0;
  line-height: 1.6;
}

/* Links */
a:link {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-color);
  transition: var(--transition);
}

a:visited {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

a:active {
  color: var(--primary-color);
  text-decoration: none;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted var(--border-color);
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 280px;
  background-color: #555;
  color: var(--light-text);
  text-align: left;
  border-radius: var(--border-radius);
  padding: 12px;
  position: absolute;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.5;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

div.tooltiptext.c2s-pos1 {
  left: 115%;
  top: -10px;
  font-size: 14px;
  padding-left: 15px;
}

span.tooltiptext.c2s-pos2 {
  font-size: 14px;
  top: 120%;
  left: 50%;
  margin-left: -70%;
  width: 100px;
  padding: 8px;
  text-align: center;
}

/* Fieldset styling */
fieldset {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  margin: 15px auto;
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow);
}

fieldset.big {
  width: 100%;
  max-width: 1160px;
}

fieldset.med {
  width: 100%;
  max-width: 900px;
}

fieldset.small {
  width: 70%;
}

legend {
  margin-left: 20px;
  text-align: left;
  padding: 0 10px;
  font-weight: 600;
  color: var(--primary-color);
}

/* Waiting for server data table */
.w4data {
  width: 100%;
  background-color: var(--card-bg);
  font-size: 16px;
  margin: 15px 0;
  border: none;
  height: 60px;
  text-align: center;
  color: var(--accent-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

/* OPB table */
table.opb {
  background-color: var(--card-bg);
  table-layout: fixed;
  width: 100%;
  margin: 15px 0;
}

.opb .col1 {
  text-align: left;
  padding-left: 20px;
}

.opb .col2 {
  font-size: 14px;
}

.opb .col3 {
  font-size: 14px;
  font-weight: 600;
  color: #464646;
}

/* Status colors */
.TX {
  background-color: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

.RX {
  background-color: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Footer */
footer {
  margin-top: auto;
  width: 100%;
  background-color: var(--card-bg);
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: #777;
  border-top: 1px solid var(--border-color);
}

footer p {
  margin: 5px 0;
}

footer a {
  color: var(--primary-color);
}

/* Responsive design */
@media (max-width: 1200px) {
  .container {
    width: 95%;
  }
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 10px;
  }
  
  .nav-container {
    justify-content: center;
  }
  
  fieldset.small {
    width: 90%;
  }
  
  .button, .dropbtn {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Image styling */
.img-top {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

/* Server title */
.srv-tittle {
  color: var(--primary-color);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  padding: 15px;
  margin: 10px 0;
}

/* Preserve original color classes */
.bkgnd-1d1 { background: #1d1; }
.bkgnd-8ecfb4 { background-color: #8ecfb4; }
.bkgnd-cefdce { background-color: rgba(46, 204, 113, 0.2); }
.bkgnd-ff0000 { background-color: rgba(231, 76, 60, 0.7); }

.txt-yellow { color: #f1c40f; }
.txt-b70101 { color: #b70101; }
.txt-green { color: #2ecc71; }
.txt-red { color: #e74c3c; }
.txt-white { color: #ffffff; }
.txt-blue { color: #3498db; }
.txt-008000 { color: #008000; }
.txt-0065ff { color: #0065ff; }
.txt-b5651d { color: #b5651d; }
.txt-464646 { color: #464646; }
.txt-002d62 { color: #002d62; }
.txt-3a4aa6 { color: #3a4aa6; }

.fnt-7pt { font-size: 12px; }
.fnt-8pt { font-size: 13px; }