/* ==========================================================
   THE DIVE 155 — Modern Amateur Radio Dashboard
   Replacement stylesheet for the existing XLXD dashboard.
   Keeps the original PHP markup, image paths and class names.
   ========================================================== */

:root {
    color-scheme: dark;
    --dive-bg: #081321;
    --dive-panel: #101f30;
    --dive-panel-raised: #162a3e;
    --dive-border: #29445c;
    --dive-text: #e7f0f8;
    --dive-muted: #9db0c2;
    --dive-cyan: #36c5e8;
    --dive-blue: #2487c7;
    --dive-green: #39d98a;
    --dive-red: #ff6675;
    --dive-radius: 10px;
    --dive-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--dive-bg);
}

body {
    margin: 0;
    padding: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--dive-text);
    background:
        radial-gradient(ellipse at 50% -20%, rgba(35, 115, 157, .22), transparent 58%),
        linear-gradient(180deg, #0b1928 0%, #081321 55%, #07101b 100%);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

h1 {
    margin: 18px 0;
    color: var(--dive-text);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    letter-spacing: .02em;
}

a {
    color: var(--dive-cyan);
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

a:hover {
    color: #9cecff;
}

a img {
    border: 0;
}

a.tip {
    text-decoration: none;
}

a.tip:hover {
    position: relative;
}

a.tip span {
    display: none;
}

a.tip:hover span {
    position: absolute;
    top: 10px;
    z-index: 50;
    display: block;
    margin: 10px;
    padding: 8px 11px;
    border: 1px solid var(--dive-border);
    border-radius: 7px;
    color: #fff;
    background: #07111d;
    box-shadow: var(--dive-shadow);
    font-family: inherit;
    font-size: 12px;
    white-space: nowrap;
}

/* Integrated The Dive 155 masthead artwork: logo and radio image are
   composited into one PNG at ./img/the-dive-155-blended-header.png. */
#top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 115px;
    min-width: 0;
    overflow: hidden;
    padding: 0 18px 8px;
    color: #536575;
    background-color: #ffffff;
    background-image: url('../img/the-dive-155-blended-header.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 115px;
    border-bottom: 1px solid #28445b;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
    font-size: 0;
    letter-spacing: .025em;
}

/* Branding is already composited into the seamless header artwork. */
#top > img {
    display: none;
}

#top br {
    display: none;
}

#top #suptime,
#suptime {
    color: var(--dive-green);
    font-weight: 700;
}

/* Main navigation */
#menubar {
    position: absolute;
    top: 115px;
    left: 0;
    z-index: 5;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    height: auto;
    padding: 7px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #10263a;
    border-bottom: 1px solid #294a63;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}

#menu {
    float: none;
    width: max-content;
    min-width: 100%;
    height: auto;
    margin: 0;
}

#menu table {
    width: auto;
    margin: 0 auto;
    border: 0;
    border-collapse: separate;
    border-spacing: 5px 0;
}

#menu td {
    padding: 0;
    white-space: nowrap;
}

.menulink,
.menulinkactive {
    display: inline-flex;
    min-height: 33px;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 1px solid #31516b;
    border-radius: 7px;
    color: #c7d8e7;
    background: #172f45;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.menulink:hover {
    color: #fff;
    background: #20445f;
    border-color: #3986a9;
}

.menulinkactive {
    color: #061522;
    background: linear-gradient(180deg, #64def4, #27acd4);
    border-color: #65dff5;
    box-shadow: 0 0 0 1px rgba(54, 197, 232, .12), 0 3px 12px rgba(26, 171, 211, .18);
}

/* Page content and the original XLXD page tables */
#content {
    position: absolute;
    top: 180px;
    left: 0;
    width: 100%;
    padding: 0 18px 34px;
    text-align: center;
}

#content > table,
#content table.listingtable {
    max-width: 1200px;
}

.listingtable {
    width: auto;
    max-width: 100%;
    margin: 14px auto 22px;
    overflow: hidden;
    border: 1px solid var(--dive-border);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--dive-radius);
    color: var(--dive-text);
    background: var(--dive-panel);
    box-shadow: var(--dive-shadow);
    font-size: 14px;
}

.listingtable th {
    height: 40px;
    padding: 9px 12px;
    color: #dff8ff;
    background: linear-gradient(180deg, #1d4059, #17334a);
    border-bottom: 1px solid #35617b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .055em;
    text-align: center;
    text-transform: uppercase;
}

.listingtable td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(67, 99, 125, .30);
    color: #d7e3ed;
    text-align: left;
}

.listingtable tr:last-child td {
    border-bottom: 0;
}

.listingtable tr:nth-child(even) td {
    background: rgba(255, 255, 255, .025);
}

.listingtable tr:hover td {
    background: rgba(54, 197, 232, .075);
}

.listinglink {
    color: var(--dive-cyan);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.listinglink:hover {
    color: #a5efff;
    text-decoration: underline;
}

.pl {
    color: var(--dive-text);
    font-size: 13px;
    text-decoration: none;
}

.error {
    width: min(92%, 1000px);
    margin: 12px auto;
    padding: 13px 16px;
    border: 1px solid rgba(255, 102, 117, .55);
    border-left: 4px solid var(--dive-red);
    border-radius: 8px;
    color: #ffdce0;
    background: rgba(130, 35, 49, .24);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}

.FilterField,
.FilterSubmit {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #355873;
    border-radius: 6px;
    color: var(--dive-text);
    background: #0d1d2c;
    font-family: inherit;
    font-size: 13px;
}

.FilterField {
    width: 170px;
}

.FilterField:focus {
    outline: 2px solid rgba(54, 197, 232, .35);
    border-color: var(--dive-cyan);
}

.FilterSubmit {
    padding: 6px 15px;
    color: #071522;
    background: var(--dive-cyan);
    border-color: var(--dive-cyan);
    font-weight: 700;
    cursor: pointer;
}

.FilterSubmit:hover {
    background: #83e8fa;
    border-color: #83e8fa;
}

.smalllink {
    color: var(--dive-cyan);
    font-size: 13px;
    text-decoration: none;
}

.smalllink:hover {
    color: #a5efff;
    text-decoration: underline;
}

#content > div[style*="text-align:center"] {
    margin-top: 35px !important;
    padding: 16px 0;
    border-top: 1px solid rgba(65, 102, 130, .25);
}

#content > div[style*="text-align:center"] a {
    color: var(--dive-muted) !important;
    font-size: 12px !important;
}

/* Smaller screens */
@media (max-width: 760px) {
    #top {
        height: 115px;
        padding-left: 10px;
        background-position: center center;
        background-size: auto 115px;
        font-size: 0;
    }

    #top > img {
        max-width: min(440px, 76vw);
        max-height: 54px;
        margin-top: 8px !important;
    }

    #menubar {
        top: 115px;
        padding: 6px 5px;
    }

    #menu table {
        margin-left: 0;
    }

    .menulink,
    .menulinkactive {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 12px;
    }

    #content {
        top: 180px;
        padding: 0 8px 24px;
    }

    .listingtable {
        font-size: 12px;
    }

    .listingtable th,
    .listingtable td {
        padding: 7px 8px;
    }
}

@media (max-width: 480px) {
    #content {
        padding-right: 5px;
        padding-left: 5px;
    }

    .FilterField {
        max-width: 52vw;
    }
}

/* ==========================================================
   THE DIVE 155 — Dark user and module listing rows
   Override original XLXD white bgcolor attributes.
   ========================================================== */

.listingtable td {
    color: #e7f0f8 !important;
    background: #14283b !important;
    border-bottom: 1px solid #29445c !important;
}

.listingtable tr:nth-child(even) > td {
    background: #1b344a !important;
}

.listingtable tr:hover > td {
    background: #244b65 !important;
}

/* Keep nested module-list tables dark as well. */
.listingtable .listingtable td {
    background: #14283b !important;
}

.listingtable .listingtable tr:nth-child(even) > td {
    background: #1b344a !important;
}

.listingtable .listingtable tr:hover > td {
    background: #244b65 !important;
}


/* ==========================================================
   THE DIVE 155 — New 160px wave header
   ========================================================== */

#top {
    box-sizing: border-box;
    height: 160px;
    background-size: 100% 160px;
    background-position: center center;
}

#menubar {
    top: 160px;
}

#content {
    top: 225px;
}

@media (max-width: 760px) {
    #top {
        height: 160px;
        background-size: 100% 160px;
        background-position: center center;
    }

    #menubar {
        top: 160px;
    }

    #content {
        top: 225px;
    }
}


/* THE DIVE 155 — New proportional header and live status strip */
#top {
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: visible;
    background: none;
    border: 0;
    font-size: 14px;
    letter-spacing: normal;
}

#top > img {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0 !important;
}

#top br {
    display: none;
}

#dive-status {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 28px;
    min-height: 38px;
    padding: 8px 12px;
    color: #dceaf5;
    background: #10263a;
    border-top: 1px solid #294a63;
    border-bottom: 1px solid #294a63;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-align: center;
}

#dive-status #suptime {
    color: var(--dive-green);
}

#menubar {
    top: calc(33.333333vw + 38px);
}

#content {
    top: calc(33.333333vw + 103px);
}

@media (max-width: 760px) {
    #top {
        height: auto;
        padding: 0;
    }

    #top > img {
        display: block;
        width: 100%;
        height: auto;
        max-width: none;
        max-height: none;
    }

    #dive-status {
        gap: 6px 14px;
        padding: 8px 6px;
        font-size: 10px;
    }

    #menubar {
        top: calc(33.333333vw + 38px);
    }

    #content {
        top: calc(33.333333vw + 103px);
    }
}

/* THE DIVE 155 — Remove unused navy area below banner artwork */
#top > img {
    display: block;
    width: 100%;
    height: 23.2965vw;
    object-fit: cover;
    object-position: top center;
    max-width: none;
    max-height: none;
    margin: 0 !important;
}

#menubar {
    top: calc(23.2965vw + 38px);
}

#content {
    top: calc(23.2965vw + 103px);
}

@media (max-width: 760px) {
    #top > img {
        height: 23.2965vw;
    }

    #menubar {
        top: calc(23.2965vw + 38px);
    }

    #content {
        top: calc(23.2965vw + 103px);
    }
}

/* THE DIVE 155 — Display complete modern ham-radio banner */
#top > img {
    display: block;
    width: 100%;
    height: auto !important;
    object-fit: contain !important;
    object-position: center center;
    max-width: none;
    max-height: none;
    margin: 0 !important;
}

#menubar {
    top: calc(33.333333vw + 38px);
}

#content {
    top: calc(33.333333vw + 103px);
}

@media (max-width: 760px) {
    #top > img {
        height: auto !important;
    }

    #menubar {
        top: calc(33.333333vw + 38px);
    }

    #content {
        top: calc(33.333333vw + 103px);
    }
}
