/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --text-color: #333;
  --bg-color: #f5f5f5;
  --content-bg: #ffffff;
  --watermark-color: rgba(0, 0, 0, 0.05);
  --footer-color: #666;
  --sidebar-width: 280px;
  --header-height: 60px;
}

/* Dark mode variables */
[data-theme="dark"] {
  --primary-color: #34495e;
  --secondary-color: #3498db;
  --text-color: #e0e0e0;
  --bg-color: #1a1a1a;
  --content-bg: #2d2d2d;
  --watermark-color: rgba(255, 255, 255, 0.03);
  --footer-color: #999;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  position: relative;
}

/* DRAFT Watermark */
body::before {
  content: 'DRAFT';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 150px;
  font-weight: 900;
  color: var(--watermark-color);
  z-index: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: 20px;
}

.container {
  position: relative;
  min-height: 100vh;
  z-index: 2;
}

/* Hamburger Button */
.hamburger {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1000;
  width: 45px;
  height: 45px;
  background-color: var(--primary-color);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 10px;
  transition: background-color 0.3s ease;
}

.hamburger:hover {
  background-color: var(--secondary-color);
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: white;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--primary-color);
  z-index: 999;
  transition: left 0.3s ease;
  overflow-y: auto;
  padding: 20px 0;
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  padding: 20px;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.sidebar-header h2 {
  font-size: 24px;
  font-weight: 600;
}

.nav-menu {
  list-style: none;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  display: block;
  padding: 15px 25px;
  color: white;
  text-decoration: none;
  font-size: 18px;
  transition: background-color 0.3s ease;
  border-left: 4px solid transparent;
}

.nav-menu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-left-color: var(--secondary-color);
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Main Content */
.main-content {
  padding: 80px 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 3px solid var(--secondary-color);
}

.page-header h1 {
  font-size: 32px;
  color: var(--primary-color);
  font-weight: 700;
}

.content {
  background-color: var(--content-bg);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 40px;
}

.content h2 {
  font-size: 26px;
  margin-top: 25px;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.content h3 {
  font-size: 22px;
  margin-top: 20px;
  margin-bottom: 12px;
  color: var(--primary-color);
}

.content p {
  margin-bottom: 15px;
  font-size: 18px;
}

.content ul, .content ol {
  margin-left: 25px;
  margin-bottom: 15px;
}

.content li {
  margin-bottom: 8px;
  font-size: 18px;
}

/* Footer */
.page-footer {
  text-align: center;
  padding: 20px;
  color: var(--footer-color);
  font-size: 16px;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
  .main-content {
    padding: 100px 40px 60px;
  }

  .page-header h1 {
    font-size: 40px;
  }

  .content {
    padding: 40px;
  }

  .content h2 {
    font-size: 30px;
  }

  .content h3 {
    font-size: 24px;
  }

  .content p, .content li {
    font-size: 19px;
  }
}

@media (min-width: 1024px) {
  body {
    font-size: 19px;
  }

  .page-header h1 {
    font-size: 44px;
  }

  .content p, .content li {
    font-size: 20px;
  }
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 1000;
  width: 45px;
  height: 45px;
  background-color: var(--primary-color);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease, transform 0.3s ease;
  font-size: 20px;
}

.theme-toggle:hover {
  background-color: var(--secondary-color);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* Smooth transition for theme changes */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.content,
.hamburger,
.sidebar,
.page-header h1,
.content h2,
.content h3,
.page-footer {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Calendar Styles */
.loading {
  text-align: center;
  color: var(--text-color);
  font-style: italic;
  padding: 20px;
}

.calendar-error {
  background-color: #fee;
  border: 1px solid #fcc;
  color: #c33;
  padding: 15px;
  border-radius: 5px;
  margin: 20px 0;
}

[data-theme="dark"] .calendar-error {
  background-color: #4a2020;
  border-color: #6a3030;
  color: #ff9999;
}

.no-events {
  text-align: center;
  color: var(--text-color);
  font-style: italic;
  padding: 20px;
}

/* Upcoming Events List */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0;
}

.event-item {
  padding: 20px;
  border-left: 4px solid var(--secondary-color);
  background-color: var(--bg-color);
  border-radius: 5px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.event-date {
  font-size: 14px;
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 8px;
}

.event-location {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 8px;
  opacity: 0.8;
}

.event-description {
  font-size: 16px;
  color: var(--text-color);
  line-height: 1.6;
  margin-top: 10px;
  opacity: 0.9;
}

/* Monthly Calendar View */
#monthly-calendar {
  margin: 30px 0;
}

.calendar-month {
  margin-bottom: 40px;
}

.month-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  background-color: var(--bg-color);
  padding: 10px;
  border-radius: 8px;
}

.calendar-day-header {
  text-align: center;
  font-weight: 700;
  color: var(--primary-color);
  padding: 10px 5px;
  font-size: 14px;
  background-color: var(--content-bg);
  border-radius: 5px;
}

.calendar-day {
  min-height: 60px;
  padding: 8px;
  background-color: var(--content-bg);
  border-radius: 5px;
  position: relative;
  transition: background-color 0.2s ease, transform 0.2s ease;
  cursor: default;
}

.calendar-day:not(.empty):hover {
  background-color: var(--bg-color);
  transform: scale(1.05);
}

.calendar-day.empty {
  background-color: transparent;
}

.calendar-day.today {
  background-color: var(--secondary-color);
  color: white;
  font-weight: 700;
}

.calendar-day.today .day-number {
  color: white;
}

.calendar-day.has-events {
  border: 2px solid var(--secondary-color);
}

.day-number {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

.event-indicator {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.calendar-day.today .event-indicator {
  background-color: white;
  color: var(--secondary-color);
}

/* Responsive Calendar */
@media (max-width: 768px) {
  .calendar-grid {
    gap: 3px;
    padding: 5px;
  }

  .calendar-day {
    min-height: 50px;
    padding: 5px;
  }

  .day-number {
    font-size: 14px;
  }

  .calendar-day-header {
    font-size: 12px;
    padding: 8px 3px;
  }

  .event-indicator {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .event-title {
    font-size: 18px;
  }

  .event-date {
    font-size: 13px;
  }
}

/* Nets Styles */
.nets-error {
  background-color: #fee;
  border: 1px solid #fcc;
  color: #c33;
  padding: 15px;
  border-radius: 5px;
  margin: 20px 0;
}

[data-theme="dark"] .nets-error {
  background-color: #4a2020;
  border-color: #6a3030;
  color: #ff9999;
}

.nets-schedule {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin: 20px 0;
}

.day-section {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 20px;
  background-color: var(--bg-color);
  transition: all 0.3s ease;
}

[data-theme="dark"] .day-section {
  border-color: rgba(255, 255, 255, 0.1);
}

.day-section.current-day {
  border-color: var(--secondary-color);
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.day-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--secondary-color);
}

.day-section.current-day .day-title {
  color: var(--secondary-color);
}

.no-nets {
  font-style: italic;
  color: var(--text-color);
  opacity: 0.6;
  padding: 15px 0;
}

.nets-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.net-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 15px;
  padding: 15px;
  background-color: var(--content-bg);
  border-radius: 5px;
  border-left: 3px solid var(--secondary-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.net-item:hover {
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.net-time {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary-color);
  display: flex;
  align-items: center;
}

.net-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.net-frequency {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}

.net-type {
  font-size: 14px;
  color: var(--text-color);
  opacity: 0.8;
  font-style: italic;
}

.net-org {
  font-size: 15px;
  color: var(--text-color);
  opacity: 0.9;
}

.net-callsign {
  font-size: 14px;
  color: var(--secondary-color);
  font-weight: 500;
}

/* Responsive Nets Layout */
@media (max-width: 768px) {
  .net-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .net-time {
    font-size: 14px;
  }

  .net-frequency {
    font-size: 16px;
  }

  .day-section {
    padding: 15px;
  }

  .day-title {
    font-size: 20px;
  }
}

/* Repeaters Styles */
.repeaters-error {
  background-color: #fee;
  border: 1px solid #fcc;
  color: #c33;
  padding: 15px;
  border-radius: 5px;
  margin: 20px 0;
}

[data-theme="dark"] .repeaters-error {
  background-color: #4a2020;
  border-color: #6a3030;
  color: #ff9999;
}

.repeaters-summary {
  background-color: var(--secondary-color);
  color: white;
  padding: 12px 20px;
  border-radius: 5px;
  font-weight: 600;
  margin-bottom: 25px;
  text-align: center;
}

.repeaters-by-band {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin: 20px 0;
}

.band-section {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 20px;
  background-color: var(--bg-color);
}

[data-theme="dark"] .band-section {
  border-color: rgba(255, 255, 255, 0.1);
}

.band-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--secondary-color);
}

.repeaters-table-container {
  overflow-x: auto;
  margin-top: 15px;
}

.repeaters-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--content-bg);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .repeaters-table {
  border-color: rgba(255, 255, 255, 0.2);
}

.repeaters-table thead {
  background-color: var(--primary-color);
  color: white;
}

.repeaters-table th {
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.repeaters-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 25px;
  transition: background-color 0.2s ease;
}

.repeaters-table th.sortable:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.repeaters-table th.sortable .sort-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.3;
  font-size: 12px;
}

.repeaters-table th.sortable .sort-arrow::before {
  content: "⇅";
}

.repeaters-table th.sortable.sort-asc .sort-arrow {
  opacity: 1;
}

.repeaters-table th.sortable.sort-asc .sort-arrow::before {
  content: "↑";
}

.repeaters-table th.sortable.sort-desc .sort-arrow {
  opacity: 1;
}

.repeaters-table th.sortable.sort-desc .sort-arrow::before {
  content: "↓";
}

.repeaters-table td {
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-color);
  font-size: 14px;
}

[data-theme="dark"] .repeaters-table td {
  border-color: rgba(255, 255, 255, 0.1);
}

.repeaters-table tbody tr:hover {
  background-color: var(--bg-color);
}

.repeaters-table .freq-output {
  font-weight: 700;
  color: var(--secondary-color);
  white-space: nowrap;
}

.repeaters-table .freq-input {
  white-space: nowrap;
}

.repeaters-table .offset {
  text-align: center;
  font-weight: 600;
}

.repeaters-table .tones {
  white-space: nowrap;
}

.repeaters-table .callsign {
  font-weight: 600;
  font-family: monospace;
  color: var(--primary-color);
}

.repeaters-table .location {
  max-width: 200px;
}

.repeaters-table .modes {
  font-size: 13px;
}

/* Responsive Repeaters Table */
@media (max-width: 768px) {
  .repeaters-table {
    font-size: 12px;
  }

  .repeaters-table th,
  .repeaters-table td {
    padding: 8px 5px;
  }

  .repeaters-table th {
    font-size: 12px;
  }

  .band-section {
    padding: 15px;
  }

  .band-title {
    font-size: 18px;
  }
}

/* Very small screens - stack table differently */
@media (max-width: 600px) {
  .repeaters-table thead {
    display: none;
  }

  .repeaters-table,
  .repeaters-table tbody,
  .repeaters-table tr,
  .repeaters-table td {
    display: block;
    width: 100%;
  }

  .repeaters-table tr {
    margin-bottom: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 10px;
  }

  [data-theme="dark"] .repeaters-table tr {
    border-color: rgba(255, 255, 255, 0.1);
  }

  .repeaters-table td {
    text-align: left;
    padding: 5px 0;
    border: none;
  }

  .repeaters-table td:before {
    content: attr(class) ": ";
    font-weight: 600;
    text-transform: capitalize;
  }

  .repeaters-table .freq-output:before { content: "Output: "; }
  .repeaters-table .freq-input:before { content: "Input: "; }
  .repeaters-table .offset:before { content: "Offset: "; }
  .repeaters-table .tones:before { content: "Tones: "; }
  .repeaters-table .callsign:before { content: "Callsign: "; }
  .repeaters-table .location:before { content: "Location: "; }
  .repeaters-table .modes:before { content: "Modes: "; }
}
