/* =====================================================================
   O.H.R shared stylesheet (#38)
   ===================================================================== */

*{
    box-sizing:border-box;
    margin:0;
    padding:0;
    font-family:"JetBrains Mono", monospace;
}

body{
    min-height:100vh;
    background:#070b14;
    color:#fff;
}

/* Card pages: Home, Requirements, Registration, Downloads, Login */
body.page-card{
    padding:150px 20px 20px;
}

/* Centered pages: Callsign Lookup, Status Pages */
body.page-center{
    padding:90px 0 30px;
    text-align:center;
    color:#e5e7eb;
}

/* ================= TOP MENU ================= */

.topnav{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:60px;
    display:flex;
    align-items:stretch;
    background:#111827;
    border-bottom:2px solid #1F51FF;
    z-index:1000;
}

.topnav a{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 14px;
    height:100%;
    color:#f2f2f2;
    text-decoration:none;
    font-size:18px;
    border-right:2px solid #1F51FF;
    white-space:nowrap;
}

.topnav a:hover{
    background:#1f2937;
    color:lime;
}

.topnav a.active{
    background:#0454aa;
}

.topnav a.home{
    padding:0 24px;
}

.topnav a.logout{
    background:red;
}

.topnav a.logout:hover{
    background:#b91c1c;
    color:#fff;
}

.menu-btn{
    display:none;
    width:60px;
    height:60px;
    background:none;
    border:none;
    cursor:pointer;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:6px;
}

.menu-btn span{
    width:25px;
    height:3px;
    background:#fff;
    border-radius:2px;
}

/* ================= LOGO ================= */

.logo{
    position:absolute;
    top:100px;
    left:40px;
    height:260px;
    width:auto;
    z-index:1;
    filter:drop-shadow(0 0 10px rgba(0,0,0,.7));
}

/* ================= CARDS ================= */

.card{
    position:relative;
    width:100%;
    max-width:800px;
    margin:0 auto;
    background:rgba(17,24,39,.92);
    border:2px solid #1F51FF;
    border-radius:22px;
    padding:40px;
    box-shadow:0 20px 60px rgba(0,0,0,.6);
}

.card.wide{ max-width:900px; }
.card.narrow{ max-width:650px; }

.card h1{
    text-align:center;
    color:#60a5fa;
    margin-bottom:10px;
}

.subtitle{
    text-align:center;
    color:#94a3b8;
    margin-bottom:25px;
    font-size:18px;
}

/* ================= HOME ================= */

.content{
    line-height:1.8;
    color:#cbd5e1;
    text-align:center;
    margin-bottom:35px;
}

.news{
    background:#0f172a;
    border:1px solid #334155;
    border-radius:16px;
    padding:25px;
}

.news h2{
    color:#60a5fa;
    margin-bottom:15px;
    text-align:center;
}

.news-item{
    padding:12px;
    border-bottom:1px solid #334155;
    color:#cbd5e1;
}

.news-item:last-child{
    border-bottom:none;
}

.date{
    color:lime;
    font-weight:bold;
    margin-right:10px;
}

/* ================= REQUIREMENTS ================= */

.req-list{
    margin-left:30px;
    line-height:2;
}

.req-list ol{
    margin-left:10px;
    list-style-position:inside;
}

/* ================= PAGE HEADINGS (lookup / status) ================= */

.page-title{
    font-size:38px;
    margin-bottom:40px;
    color:#93c5fd;
    -webkit-text-stroke:1px #000;
    text-shadow:
        0 0 8px rgba(147,197,253,0.35),
        2px 2px 2px #000;
    padding-top:35px;
    font-weight:bold;
}

/* ================= CALLSIGN LOOKUP ================= */

.searchbox{
    margin-bottom:40px;
    padding:0 10px;
}

.searchbox input[type=text]{
    padding:12px;
    font-size:16px;
    width:280px;
    max-width:100%;
    border-radius:8px;
    border:1px solid #475569;
    background:#111827;
    color:#fff;
}

.searchbox button{
    padding:12px 18px;
    font-size:16px;
    border-radius:8px;
    border:none;
    cursor:pointer;
    margin-left:10px;
    background:#f59e0b;
    color:#111827;
    font-weight:bold;
}

.searchbox button:hover{ background:#fbbf24; }

.searchbox .listbtn{ background:#339900; color:black; }
.searchbox .listbtn:hover{ background:#44cc00; }

.noresult{
    color:#f87171;
    margin-top:20px;
    font-size:18px;
}

/* ================= DATA TABLES ================= */

.tablewrap{
    max-width:100%;
    overflow-x:auto;
    padding:0 10px 20px;
}

.datatable{
    margin:auto;
    border-collapse:separate;
    border-spacing:0;
    background:#0f172a;
    border:2px solid #3b82f6;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 0 20px rgba(0,0,0,0.7);
}

.datatable th{
    background:#1e293b;
    color:#93c5fd;
    padding:14px 28px;
    border-right:1px solid #3b82f6;
    border-bottom:1px solid #3b82f6;
}

.datatable td{
    padding:14px 28px;
    background:#111c2e;
    color:#f8fafc;
    border-right:1px solid #3b82f6;
    border-bottom:1px solid #3b82f6;
}

.datatable tr th:last-child,
.datatable tr td:last-child{ border-right:none; }

.datatable > tbody > tr:last-child > td{ border-bottom:none; }

.datatable > tbody > tr:hover > td{
    background:#1f2937;
    color:white;
}

/* ================= STATUS PAGE (#32) ================= */

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

a.statuslink{
    color:#60a5fa;
    text-decoration:none;
    font-weight:bold;
}

a.statuslink:hover{ color:lime; }

.datatable td.online,   .online{   color:#22c55e; font-weight:bold; }
.datatable td.offline,  .offline{  color:#ef4444; font-weight:bold; }
.datatable td.problems, .problems{ color:orange;  font-weight:bold; }
.datatable td.na,       .na{       color:#64748b; }

.expand-btn{
    cursor:pointer;
    color:#60a5fa;
    font-weight:bold;
    user-select:none;
}

.expand-btn:hover{ color:lime; }

.hidden-row{ display:none; }
.hidden-row.show{ display:table-row; }

.statustable td.subcell{
    padding:0;
    background:#0f172a;
}

.subtable{
    width:90%;
    margin:10px auto;
    border:2px solid #3b82f6;
    border-radius:10px;
    background:#0b1220;
    border-collapse:separate;
    border-spacing:0;
    overflow:hidden;
}

.subtable th{
    background:#111827;
    color:#93c5fd;
    padding:10px;
    border:1px solid #3b82f6;
}

.subtable td{
    padding:10px;
    border:1px solid #3b82f6;
    color:#f8fafc;
}

.subtable tr:nth-child(even) td{ background:#0f1a2e; }
.subtable tr:nth-child(odd) td{  background:#0b1220; }
.subtable tr:hover td{ background:#1f2937; }

.checked{
    margin-top:15px;
    color:#64748b;
    font-size:13px;
}

/* ================= FORMS (login / registration) ================= */

.box{
    width:100%;
    max-width:350px;
    margin:0 auto;
    background:#111827;
    padding:30px;
    border:2px solid #1F51FF;
    border-radius:16px;
    text-align:center;
    box-shadow:0 20px 60px rgba(0,0,0,.6);
}

.box h2{
    color:#60a5fa;
    margin-bottom:20px;
}

.box .for{
    color:#94a3b8;
    margin-bottom:10px;
}

.box input{
    width:100%;
    padding:12px;
    margin:10px 0;
    background:#0f172a;
    border:1px solid #334155;
    color:white;
    border-radius:10px;
}

.btn{
    display:block;
    width:100%;
    padding:12px;
    margin-top:10px;
    background:#2563eb;
    color:white;
    font-size:16px;
    font-weight:bold;
    border:none;
    border-radius:10px;
    cursor:pointer;
    text-align:center;
    text-decoration:none;
}

.btn:hover{ background:#1d4ed8; }

.btn:disabled{
    opacity:0.6;
    cursor:not-allowed;
}

.btn.secondary{
    background:#334155;
}

.btn.secondary:hover{ background:#475569; }

.error{
    color:red;
    margin-bottom:15px;
}

.regform label{
    display:block;
    margin:12px 0 6px;
    color:#cbd5e1;
    font-weight:bold;
}

.regform input,
.regform select{
    width:100%;
    padding:14px;
    border-radius:12px;
    border:1px solid #334155;
    background:#0f172a;
    color:#fff;
    font-size:15px;
}

.regform .hint{
    color:#94a3b8;
    font-weight:normal;
}

.regform input::placeholder{
    color:#475569;
}

.regform input.bad,
.regform select.bad{
    border-color:#ef4444;
}

.regform .form-error{
    margin:0 0 15px;
}

.regform .btn{
    margin-top:18px;
    padding:15px;
    border-radius:12px;
}

.form-error{
    margin-top:15px;
    padding:12px;
    border:1px solid #7f1d1d;
    background:#2a0d0d;
    color:#fca5a5;
    border-radius:10px;
    text-align:center;
}

.hidden{ display:none !important; }

.result{
    margin-top:20px;
    padding:20px;
    background:#052e16;
    border:1px solid #14532d;
    border-radius:14px;
    text-align:center;
    line-height:1.8;
}

.result h3{
    color:#4ade80;
    margin-bottom:10px;
}

.loader-overlay{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,0.65);
    display:none;
    justify-content:center;
    align-items:center;
    flex-direction:column;
    border-radius:22px;
}

.loader-overlay.show{ display:flex; }

.spinner{
    width:60px;
    height:60px;
    border:6px solid #334155;
    border-top:6px solid #3b82f6;
    border-radius:50%;
    animation:spin 1s linear infinite;
    margin-bottom:15px;
}

@keyframes spin{
    0%{ transform:rotate(0deg); }
    100%{ transform:rotate(360deg); }
}

/* ================= DOWNLOADS ================= */

.download-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:20px;
}

.item{
    background:#0f172a;
    border:1px solid #334155;
    border-radius:16px;
    padding:25px;
    text-align:center;
    display:flex;
    flex-direction:column;
    align-items:center;
}

.item:hover{ border-color:lime; }

.item p{ flex:1; margin-top:8px; color:#cbd5e1; }

.item a,
.item button{
    display:inline-block;
    margin-top:15px;
    padding:10px 20px;
    background:#2563eb;
    color:white;
    text-decoration:none;
    border:none;
    border-radius:10px;
    font-size:16px;
    cursor:pointer;
}

.item a:hover,
.item button:hover{ background:#1d4ed8; }

.item button.copied{
    background:#16a34a;
}

/* Info popup (#27, #28) */

.modal-backdrop{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.7);
    z-index:9998;
    justify-content:center;
    align-items:center;
    padding:20px;
}

.modal-backdrop.show{ display:flex; }

.modal{
    width:100%;
    max-width:600px;
    background:#0f172a;
    border:2px solid lime;
    border-radius:16px;
    padding:25px;
    max-height:90vh;
    overflow:auto;
}

.modal h2{
    color:#60a5fa;
    margin-bottom:15px;
}

.modal table{
    width:100%;
    border-collapse:collapse;
    color:#cbd5e1;
}

.modal th{
    text-align:left;
    color:#93c5fd;
    padding:10px;
    border-bottom:1px solid #334155;
}

.modal td{
    padding:10px;
    border-bottom:1px solid #334155;
    word-break:break-word;
}

.modal .btn{
    display:inline-block;
    width:auto;
    padding:10px 20px;
    margin-top:15px;
}

/* Wide pages (Status, Downloads): logo moves above the content
   before it can overlap it */
@media (max-width:1500px){

    body.wide .logo{
        position:relative;
        display:block;
        margin:0 auto 20px;
        top:auto;
        left:auto;
        height:160px;
    }

    body.wide.page-card{
        padding-top:90px;
    }

    body.wide .page-title{
        padding-top:0;
    }
}


/* ================= ADMIN ================= */

.card.admin{
    max-width:1200px;
}

/* Admin page is wide: logo always sits above it */
body.adminpage .logo{
    position:relative;
    display:block;
    margin:0 auto 20px;
    top:auto;
    left:auto;
    height:120px;
}

body.adminpage.page-card{
    padding-top:90px;
}

.tabs{
    display:flex;
    gap:6px;
    border-bottom:2px solid #1F51FF;
    margin:10px 0 20px;
}

.tabs a{
    padding:10px 18px;
    color:#cbd5e1;
    text-decoration:none;
    border:1px solid #334155;
    border-bottom:none;
    border-radius:10px 10px 0 0;
    background:#0f172a;
}

.tabs a:hover{ color:lime; }

.tabs a.on{
    background:#0454aa;
    border-color:#1F51FF;
    color:#fff;
}

.flash{
    padding:10px 14px;
    border-radius:10px;
    margin-bottom:10px;
}

.flash.ok{  background:#052e16; border:1px solid #14532d; color:#86efac; }
.flash.err{ background:#2a0d0d; border:1px solid #7f1d1d; color:#fca5a5; }

.toolbar{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:10px;
    margin:10px 0;
}

.toolbar input[type=text]{
    flex:1;
    min-width:200px;
    padding:10px 12px;
    border-radius:10px;
    border:1px solid #334155;
    background:#0f172a;
    color:#fff;
    font-size:15px;
}

.btn.small{
    display:inline-block;
    width:auto;
    margin:0;
    padding:9px 16px;
    font-size:14px;
}

.btn.warn{ background:#b45309; }
.btn.warn:hover{ background:#92400e; }

.muted{
    color:#94a3b8;
    font-size:13px;
    margin:6px 0;
}

.legend{ margin-top:10px; }

.filename{
    color:#60a5fa;
    font-weight:bold;
}

.datatable.admintable{
    width:100%;
    font-size:14px;
}

.datatable.admintable th,
.datatable.admintable td{
    padding:8px 10px;
    text-align:center;
}

.datatable.admintable td.left{ text-align:left; }

.admintable td.actions{
    white-space:nowrap;
}

.admintable td.actions form{
    display:inline;
}

.mini{
    display:inline-block;
    padding:5px 10px;
    margin:1px 2px;
    font-size:13px;
    border:none;
    border-radius:7px;
    background:#2563eb;
    color:#fff;
    text-decoration:none;
    cursor:pointer;
}

.mini:hover{ background:#1d4ed8; }
.mini.danger{ background:#b91c1c; }
.mini.secondary{ background:#334155; }
.mini.secondary:hover{ background:#475569; }

.filetools{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin:10px 0 15px;
    padding:14px;
    background:#0f172a;
    border:1px solid #334155;
    border-radius:12px;
}

.inline-form{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
    font-size:14px;
    color:#cbd5e1;
}

.inline-form b{
    color:#60a5fa;
    min-width:75px;
}

.inline-form select,
.inline-form input[type=text]{
    padding:7px 10px;
    border-radius:8px;
    border:1px solid #334155;
    background:#0b1220;
    color:#fff;
    font-size:14px;
}

.inline-form input[type=file]{
    color:#cbd5e1;
    font-size:13px;
    max-width:100%;
}

.inline-form .check{
    display:flex;
    align-items:center;
    gap:5px;
    font-size:13px;
}
.mini.danger:hover{ background:#991b1b; }

.dots{ white-space:nowrap; }

.dot{
    display:inline-block;
    width:10px;
    height:10px;
    border-radius:50%;
    margin:0 2px;
}

.dot.in{  background:#22c55e; }
.dot.out{ background:#ef4444; }

.editor{
    width:100%;
    min-height:60vh;
    padding:12px;
    background:#0b1220;
    color:#e5e7eb;
    border:1px solid #334155;
    border-radius:10px;
    font-size:13px;
    line-height:1.5;
    tab-size:8;
    resize:vertical;
    white-space:pre;
    overflow:auto;
}

.adminform label{
    display:block;
    margin:10px 0 4px;
    color:#cbd5e1;
    font-weight:bold;
    font-size:14px;
}

.adminform input{
    width:100%;
    padding:10px;
    border-radius:10px;
    border:1px solid #334155;
    background:#0b1220;
    color:#fff;
    font-size:15px;
}

.adminform input[readonly]{
    color:#94a3b8;
    background:#111827;
}

.row2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

.row2 .btn{
    width:100%;
}

/* ================= TABLET ================= */

@media (max-width:1024px){

    .logo{
        position:relative;
        display:block;
        margin:20px auto;
        top:auto;
        left:auto;
        height:160px;
    }

    body.page-card{
        padding:70px 10px 20px;
    }

    body.page-center{
        padding-top:70px;
    }

    .page-title{
        padding-top:0;
        font-size:30px;
        margin-bottom:30px;
    }

    .card{
        margin-top:10px;
        padding:30px 20px;
    }
}

/* ================= PHONES: MENU (#29 #33 #35 #37) ================= */

@media (max-width:768px){

    .menu-btn{
        display:flex;
    }

    .topnav{
        flex-wrap:wrap;
        height:auto;
    }

    .topnav a{
        display:none;
        width:100%;
        height:auto;
        justify-content:flex-start;
        padding:15px;
        border-right:none;
        border-top:1px solid #1F51FF;
    }

    .topnav.open a{
        display:flex;
    }

    .logo{
        height:140px;
    }

    .searchbox button{
        margin:10px 5px 0;
    }

    .datatable th,
    .datatable td{
        padding:10px 12px;
    }

    .subtable{
        width:96%;
    }

    /* "O.H.R" column is the same on every row, drop it on phones */
    .statustable .col-system{
        display:none;
    }

    .subtable th,
    .subtable td{
        padding:8px 6px;
        font-size:13px;
    }
}

/* ================= SMALL PHONES ================= */

@media (max-width:480px){

    .logo{
        height:100px;
    }

    .card{
        padding:25px 15px;
    }

    .datatable th,
    .datatable td{
        padding:8px 8px;
        font-size:13px;
    }
}
