/*
 * Base structure
 */

/* =============================================
   SIN URFD Dark Theme - Modern & Eye-Friendly
   ============================================= */

body {
    background-color: #0a0a0a !important;
    color: #e0e0e0 !important;
}

.sidebar {
    background-color: #161616 !important;
    border-right: 1px solid #333 !important;
}

.navbar {
    background-color: #1c1c1c !important;
    border-bottom: 1px solid #333 !important;
}

.nav-sidebar > .active > a,
.nav-sidebar > .active > a:hover,
.nav-sidebar > .active > a:focus {
    color: #ffffff !important;
    background-color: #c8102e !important;   /* Matches your fiery header */
}

.main {
    background-color: #111111 !important;
    padding: 20px;
}

.table, .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

.table > thead > tr > th {
    background-color: #282828 !important;
    color: #ffffff !important;
}

.table > tbody > tr:hover {
    background-color: #2a2a2a !important;
}

a {
    color: #00d4ff !important;
}

a:hover {
    color: #ff9500 !important;
}

.footer {
    background-color: #1c1c1c !important;
    color: #aaaaaa !important;
    border-top: 1px solid #333 !important;
}

/* Optional: nicer active TX rows */
tr.tx-active {
    background-color: #3a2000 !important;
    font-weight: bold;
}

html {
  position: relative;
  min-height: 100%;
}

/* Move down content because we have a fixed navbar that is 50px tall */
body {
  padding-top: 50px;
  margin-bottom: 60px;
}

a.tip {
  text-decoration: none;
}  

a.tip:hover {
  position             : relative;
}  

a.tip span {
  display              : none
}  

a.tip:hover span {
  background: #000000;
  opacity: 0.8;
  border: none;
  border-radius: 5px 5px 5px 5px;
  font-family: calibri, verdana, arial, comic sans;
  font-size: 12pt;
  text-decoration: none;
  white-space: nowrap;
  color: #FFFFFF;
  padding: 6px 6px 6px 6px;
  margin: 10px;
  display: block;
  z-index: 50; 
  position: absolute;
  top: 10px;
}  


/*
 * Global add-ons
 */

.sub-header {
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

/*
 * Top navigation
 * Hide default border to remove 1px line.
 */
.navbar-fixed-top {
  border: 0;
}

.navbar-info {
  padding: 25px;
  height: 65px;
  color: #9d9d9d;
}

/*
 * Sidebar
 */

/* Hide for mobile, show later */
.sidebar {
  display: none;
}
@media (min-width: 768px) {
  .sidebar {
    position: fixed;
    top: 51px;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: block;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
    background-color: #0f0f0f;
    border-right: 1px solid #eee;
  }
}

/* Sidebar navigation */
.nav-sidebar {
  margin-right: -21px; /* 20px padding + 1px border */
  margin-bottom: 20px;
  margin-left: -20px;
}
.nav-sidebar > li > a {
  padding-right: 20px;
  padding-left: 20px;
}
.nav-sidebar > .active > a,
.nav-sidebar > .active > a:hover,
.nav-sidebar > .active > a:focus {
  color: #fff;
  background-color: #428bca;
}


/*
 * Main content
 */

.main {
  padding: 20px;
}
@media (min-width: 768px) {
  .main {
    padding-right: 40px;
    padding-left: 40px;
  }
}
.main .page-header {
  margin-top: 0;
}


/*
 * Tables
 */

.table-flag {
  height: 15px;
}

.table-status {
  height: 25px;
}

.table-head {
  font-weight: bold;
}

.table-center * {
  text-align: center !important;
}

/*
 * Footer
 */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 61px;
  background-color: #0f0f0f;
  padding-left: 20%;
  border-top: 1px solid #eee;
}

.footer p {
  text-align: center;
  margin-top: 10px;
}

/* =============================================
   🔥 FIERY CUSTOM ANIMATIONS
   ============================================= */

/* 1. Pulsing Active Transmission Row */
@keyframes txPulse {
    0%   { background-color: #3a2000; box-shadow: 0 0 8px #ff5500; }
    50%  { background-color: #5c2a00; box-shadow: 0 0 20px #ff8800; }
    100% { background-color: #3a2000; box-shadow: 0 0 8px #ff5500; }
}

tr.tx-active {
    animation: txPulse 1.8s ease-in-out infinite;
    font-weight: bold;
    color: #ffdd88 !important;
}

/* 2. Fiery Hover Glow on Table Rows */
.table > tbody > tr:hover {
    animation: fieryHover 0.4s ease forwards;
    background-color: #442200 !important;
}

@keyframes fieryHover {
    0%   { box-shadow: inset 0 0 0 rgba(255, 85, 0, 0); }
    100% { box-shadow: inset 0 0 25px rgba(255, 140, 0, 0.6); }
}

/* 3. Glowing Links */
a {
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: #ffaa00 !important;
    text-shadow: 0 0 12px #ff5500,
                 0 0 20px #ff8800;
    transform: translateY(-1px);
}

/* 4. Subtle Pulse for Online/Active Indicators */
.online-dot {
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* 5. Loading / Refresh Spinner (if you have one) */
.refresh-spinner {
    animation: spin 1s linear infinite;
}

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

/* 6. Fiery Active Menu Item Pulse */
.nav-sidebar > .active > a {
    animation: menuGlow 3s ease-in-out infinite;
}

@keyframes menuGlow {
    0%, 100% { box-shadow: 0 0 8px #ff5500; }
    50%      { box-shadow: 0 0 20px #ffaa00; }
}
/* =============================================
   MODULES LIST PAGE - STRONG DARK FIX
   ============================================= */

#modules, 
.module-list,
#module-list,
.content,
.main {
    background-color: #111111 !important;
}

/* Force dark on the entire modules table */
table.table,
.listingtable,
#modules table {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

/* Darken all rows */
#modules tr,
#modules tbody tr,
table tr {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

/* Remove light row backgrounds */
#modules tr:nth-child(even),
#modules tr:nth-child(odd),
table tr:nth-child(even) {
    background-color: #252525 !important;
}

/* Highlight Module C (the brown one) */
#modules tr:last-child,
#modules tr:nth-child(3),
tr[style*="background-color"] {
    background: linear-gradient(#2a2a2a, #1e1e1e) !important;
    color: #00d4ff !important;
}

/* Table Headers */
#modules th,
.table thead th,
th {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
}

/* Sidebar active tab */
.nav-sidebar > li.active > a,
.nav-sidebar li.active a {
    background-color: #0066cc !important;
    color: #fff !important;
    border-left: 5px solid #00d4ff !important;
}

/* Module Usage Bars */
.usage-bar-container {
    margin-top: 6px;
}

.usage-bar {
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}


/* === SQ5AC custom: rounded liquid-glass tables + orange accent === */
.table {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(20,20,20,0.55) !important;
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid rgba(255,159,67,0.15);
}
.table > thead > tr > th {
    background: rgba(30,30,30,0.7) !important;
    border-bottom: 2px solid rgba(255,159,67,0.3) !important;
}
.table > tbody > tr > td, .table > tbody > tr > th {
    background: transparent !important;
    border-top: 1px solid rgba(255,255,255,0.05) !important;
}
a.pl, a.pl:hover, a.pl:focus {
    color: #ff9f43 !important;
}
a.pl:hover { text-decoration: underline; }


/* === SQ5AC fix: usuniecie bialych krawedzi, prawdziwe zaokraglenie === */
.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
}
.table > thead > tr > th,
.table > tbody > tr > td,
.table > tbody > tr > th,
.table-bordered,
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
    border-color: rgba(255,159,67,0.18) !important;
}
.table-bordered {
    border: 1px solid rgba(255,159,67,0.25) !important;
}
.table > thead > tr:first-child > th:first-child { border-top-left-radius: 14px; }
.table > thead > tr:first-child > th:last-child { border-top-right-radius: 14px; }
.table > tbody > tr:last-child > td:first-child { border-bottom-left-radius: 14px; }
.table > tbody > tr:last-child > td:last-child { border-bottom-right-radius: 14px; }


/* === SQ5AC: mobile card view (merged, no conflict) === */

/* === SQ5AC: unified TX animation (desktop + mobile) === */
@keyframes txPulse {
    0%, 100% {
        background-color: #3a2000;
        box-shadow: 0 0 8px #ff5500;
    }
    50% {
        background-color: #5c2a00;
        box-shadow: 0 0 18px #ff8800;
    }
}
tr.tx-active {
    animation: txPulse 1.6s ease-in-out infinite !important;
    font-weight: bold;
    color: #ffdd88 !important;
}

/* === SQ5AC: mobile – zwykła tabela, bez kafelków === */
@media (max-width: 767px) {
    .container-fluid {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    h3 {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    /* Tabela zostaje tabelą – tylko kompaktowa + poziomy scroll */
    .main table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 12px !important;
        border-radius: 10px;
    }
    .main table thead {
        display: table-header-group !important; /* przywracamy nagłówki */
    }
    .main table tbody,
    .main table tr,
    .main table th,
    .main table td {
        display: table-cell !important; /* wracamy do normalnej tabeli */
        width: auto !important;
    }
    .main table th,
    .main table td {
        padding: 6px 8px !important;
        white-space: nowrap;
        font-size: 12px !important;
        vertical-align: middle;
    }
    .main table th {
        font-size: 11px !important;
        background: rgba(30,30,30,0.9) !important;
    }

    /* Usuwamy wszelkie pozostałości kart */
    .main table td[data-label]::before {
        content: none !important;
        display: none !important;
    }
    .main table tr {
        background: inherit;
        border: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
        display: table-row !important;
    }

    .table { font-size: 12px !important; }
    #sq5ac-liquidbg + div .row,
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Pulsujaca kropka TX (zamiast tx.gif) */
.tx-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 4px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, #ffd400 0%, #ffb400 40%, #e74c3c 75%);
    box-shadow: 0 0 6px #e74c3c;
    animation: breathe 1.5s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(0.7);
        opacity: 0.35;
        box-shadow: 0 0 2px #e74c3c;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
        box-shadow: 0 0 12px #ff8c00;
    }
}

/* ===================== MOBILE ===================== */
@media (max-width: 768px) {

    /* Tabele: przewijanie poziome zamiast rozjezdzania strony */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        table-layout: auto;
    }

    /* Kompaktowe wiersze - mniejsze paddingi i fonty */
    table td, table th {
        padding: 4px 6px !important;
        font-size: 13px !important;
    }

    /* Naglowek strony - mniejszy, bez zawijania */
    h1, h2, h3 {
        font-size: 1.3rem !important;
    }
    .page-header h3 {
        font-size: 1.1rem;
    }

    /* Panel/boxy bez zbędnych marginesow */
    .panel {
        margin-bottom: 10px;
    }
    .panel-body {
        padding: 8px !important;
    }

    /* Zawijanie dlugich tekstow (callsigny z nagloskiem itp.) */
    td, th {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Kropka TX nieco mniejsza na male ekranach */
    .tx-dot {
        width: 9px;
        height: 9px;
    }
}

/* Bardzo waskie ekrany (telefony < 400px) */
@media (max-width: 400px) {
    table td, table th {
        font-size: 12px !important;
        padding: 3px 4px !important;
    }
    /* Ukrywanie mniej istotnych kolumn - odlacz komentarz jesli chcesz
    table td:nth-child(n), table th:nth-child(n) { display: none; }
    */
}

/* ===================== MOBILE ===================== */
@media (max-width: 768px) {

    /* Tabele: przewijanie poziome zamiast rozjezdzania strony */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        table-layout: auto;
    }

    /* Kompaktowe wiersze - mniejsze paddingi i fonty */
    table td, table th {
        padding: 4px 6px !important;
        font-size: 13px !important;
    }

    /* Naglowek strony - mniejszy, bez zawijania */
    h1, h2, h3 {
        font-size: 1.3rem !important;
    }
    .page-header h3 {
        font-size: 1.1rem;
    }

    /* Panel/boxy bez zbędnych marginesow */
    .panel {
        margin-bottom: 10px;
    }
    .panel-body {
        padding: 8px !important;
    }

    /* Zawijanie dlugich tekstow (callsigny z nagloskiem itp.) */
    td, th {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Kropka TX nieco mniejsza na male ekranach */
    .tx-dot {
        width: 9px;
        height: 9px;
    }
}

/* Bardzo waskie ekrany (telefony < 400px) */
@media (max-width: 400px) {
    table td, table th {
        font-size: 12px !important;
        padding: 3px 4px !important;
    }
    /* Ukrywanie mniej istotnych kolumn - odlacz komentarz jesli chcesz
    table td:nth-child(n), table th:nth-child(n) { display: none; }
    */
}

/* === SQ5AC fix: mobile tables (przywrocenie prawdziwego display:table) === */
@media (max-width: 767px) {
    .main table,
    .main table.table {
        display: table !important;
        width: 100% !important;
        max-width: none !important;
        overflow: visible !important;
    }
    .main table thead { display: table-header-group !important; }
    .main table tbody { display: table-row-group !important; }
    .main table tr    { display: table-row !important; }
    .main table th,
    .main table td   { display: table-cell !important; width: auto !important; }

    /* przewijanie poziome na kontenerze tabeli, nie na samej tabeli */
    .main div:has(> table) {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* === SQ5AC fix: mobile - tabele mieszcza sie w ekranie (zawijanie zamiast ucinania) === */
@media (max-width: 767px) {
    .main table,
    .main table.table {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: auto !important;
    }
    .main table th,
    .main table td {
        white-space: normal !important;
        word-break: normal;
        overflow-wrap: anywhere;
        padding: 4px 3px !important;
        font-size: 11px !important;
        line-height: 1.25;
    }
    .main table th {
        font-size: 10px !important;
    }
    /* kolumna # i flaga maja byc waskie */
    .main table th:first-child,
    .main table td:first-child {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    /* zabezpieczenie: nic nie wystaje poza widoczny obszar */
    .main, .main .container-fluid {
        max-width: 100% !important;
        overflow-x: hidden;
    }
}

/* === SQ5AC: ukrycie kolumny Module (7.) w Connected Devices === */
.main table th:nth-child(7),
.main table td:nth-child(7) {
    display: none !important;
}

/* === SQ5AC: ukrycie kolumny Band (3.) tylko w Connected Devices (tabela z 8 kolumnami) === */
.main table:has(tr > th:nth-child(8)) th:nth-child(3),
.main table:has(tr > th:nth-child(8)) td:nth-child(3) {
    display: none !important;
}

/* === SQ5AC: wieksza przezroczystosc tabel - animacja tla lepiej prześwituje === */
/* Regulacja: mniejsza liczba alfa = bardziej przezroczyste (0 = calkiem, 1 = pelne tlo) */
.main,
.main .content,
.main .container-fluid {
    background: transparent !important;
}
.main table.table {
    background: rgba(15,15,15,0.3) !important;
    backdrop-filter: blur(3px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(3px) saturate(130%) !important;
}
.main table.table tr,
.main table.table > tbody > tr,
.main table.table > tbody > tr:nth-child(even),
.main table.table > tbody > tr:nth-child(odd) {
    background: transparent !important;
}
.main table.table > tbody > tr:nth-child(even) {
    background: rgba(255,255,255,0.03) !important;
}
.main table.table > thead > tr > th,
.main table.table th {
    background: rgba(20,20,20,0.4) !important;
}
.main table.table > tbody > tr:hover {
    background: rgba(255,140,0,0.15) !important;
}

/* === SQ5AC: tabele spojne z belka (to samo tlo i rozmycie co #sq5ac-banner) === */
.main table.table {
    background: rgba(22,22,22,0.55) !important;
    backdrop-filter: blur(14px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(150%) !important;
}
.main table.table > thead > tr > th,
.main table.table th {
    background: rgba(255,255,255,0.04) !important;
}
.main table.table > tbody > tr,
.main table.table > tbody > tr:nth-child(odd),
.main table.table > tbody > tr:nth-child(even) {
    background: transparent !important;
}

/* === SQ5AC: kafelki statusu (tylko desktop) === */
.sq5ac-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 20px 24px 28px;
}
.sq5ac-stat {
    flex: 0 1 340px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 24px;
    border-radius: 16px;
    background: rgba(22,22,22,0.55);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border: 1px solid rgba(255,159,67,0.25);
}
.sq5ac-stat-lbl { font-size: 12px; letter-spacing: 1px; color: #b8b8b8; margin-bottom: 4px; }
.sq5ac-stat-val { font-size: 32px; font-weight: 700; line-height: 1.1; color: #fff; }
.sq5ac-stat-sub { font-size: 13px; color: #b8b8b8; margin-top: 6px; }
.sq5ac-stat-ico {
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: rgba(255,159,67,0.15);
    color: #ff9f43;
}
@media (max-width: 767px) {
    .sq5ac-stats { display: none !important; }
}

/* === SQ5AC: LINK to nie znak - bez przekierowania do QRZ === */
a.pl[href$="/db/LINK"],
a.pl[href$="/db/LINK"]:hover,
a.pl[href$="/db/LINK"]:focus {
    pointer-events: none !important;
    cursor: default !important;
    color: #e0e0e0 !important;
    text-decoration: none !important;
    text-shadow: none !important;
    transform: none !important;
}
