/* Data Table Styles
   Extracted from wwtg.php and wwbridges.php
   ================================================== */

.data-table {
    vertical-align: middle;
    text-align: center;
    empty-cells: show;
    padding-left: 0px;
    padding-right: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
    border-collapse: collapse;
    border-color: #000000;
    border-style: solid;
    border-spacing: 4px;
    border-width: 2px;
    text-decoration: none;
    color: #ffffff;
    background: #000000;
    font-family: verdana, arial, sans-serif;
    width: 100%;
    white-space: nowrap;
}

.data-table th {
    font-family: "Lucidia Console", monospace;
    font-weight: bolder;
    text-shadow: 1px 1px #8b0000;
    text-decoration: none;
    background: #091b33;
    border: 1px solid #c0c0c0;
    transition: background-color 0.2s ease;
}

.data-table th:hover {
    background: #0d2447;
}

.data-table tr:nth-child(even) {
    background: #f7f7f7;
    transition: background-color 0.2s ease;
}

.data-table tr:nth-child(odd) {
    background: #d0d0d0;
    transition: background-color 0.2s ease;
}

.data-table tr:hover {
    background: #e8f4f8 !important;
}

.data-table td {
    color: #000000;
    font-family: "Lucidia Console", monospace;
    font-weight: bolder;
    text-decoration: none;
    border: 1px solid #000000;
}

.data-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
}

.data-table-toolbar .input-group {
    box-sizing: border-box;
    flex: 0 0 auto;
    max-width: 100%;
    width: var(--wwtg-id-col, auto);
}

.data-table-toolbar .input-group-text,
.dark-mode .data-table-toolbar .input-group-text,
.light-mode .data-table-toolbar .input-group-text {
    background-color: #091b33;
    border-color: #c0c0c0;
    color: #ffffff;
}

.data-table-toolbar .form-control,
.dark-mode .data-table-toolbar .form-control,
.light-mode .data-table-toolbar .form-control {
    background-color: #ffffff;
    border-color: #c0c0c0;
    color: #212529;
    font-family: verdana, arial, sans-serif;
    font-weight: bolder;
}

.data-table-toolbar .form-control::placeholder {
    color: #6c757d;
}

.data-table-toolbar .form-control:focus,
.dark-mode .data-table-toolbar .form-control:focus,
.light-mode .data-table-toolbar .form-control:focus {
    background-color: #ffffff;
    border-color: #091b33;
    color: #212529;
    box-shadow: 0 0 0 0.15rem rgba(9, 27, 51, 0.35);
}

.data-table-toolbar input:-webkit-autofill,
.data-table-toolbar input:-webkit-autofill:hover,
.data-table-toolbar input:-webkit-autofill:focus,
.data-table-toolbar input:-webkit-autofill:active,
.dark-mode .data-table-toolbar input:-webkit-autofill,
.light-mode .data-table-toolbar input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #212529 !important;
}

.data-table-empty {
    margin: 0.75rem 0 0;
    text-align: center;
    font-family: verdana, arial, sans-serif;
    font-weight: bolder;
}

.data-table-toolbar input[type="search"]::-webkit-search-cancel-button {
    cursor: pointer;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:focus {
    outline: none;
}

.data-table th.sortable:focus-visible {
    background: #0d2447;
    box-shadow: inset 0 0 0 2px #ffffff;
}

.data-table th.sortable::after {
    content: "\f0dc";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.75em;
    margin-left: 0.4em;
    opacity: 0.4;
}

.data-table th.sortable.sort-asc::after {
    content: "\f0de";
    opacity: 1;
}

.data-table th.sortable.sort-desc::after {
    content: "\f0dd";
    opacity: 1;
}

.data-table tbody tr[hidden],
.data-table tbody tr.is-hidden {
    display: none !important;
}

.data-table tbody tr.row-even {
    background: #f7f7f7;
}

.data-table tbody tr.row-odd {
    background: #d0d0d0;
}

.wwtg-table-scroll {
    -webkit-overflow-scrolling: touch;
}

#wwtg-table .wwtg-col-id {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    width: 1%;
}

#wwtg-table .wwtg-col-name {
    text-align: left;
    white-space: normal;
    word-break: break-word;
}

#wwtg-table .wwtg-col-country {
    white-space: normal;
}

#wwtg-table .wwtg-col-mcc {
    white-space: nowrap;
    width: 1%;
}

@media (max-width: 767.98px) {
    .wwtg-wrap {
        padding: 0.75rem !important;
    }

    #wwtg-table {
        font-size: 0.8rem;
        min-width: 100%;
        width: auto;
    }

    #wwtg-table th,
    #wwtg-table td {
        padding: 0.3rem 0.4rem;
    }

    #wwtg-table thead th.wwtg-col-id,
    #wwtg-table tbody td.wwtg-col-id {
        left: 0;
        position: sticky;
        z-index: 1;
    }

    #wwtg-table thead th.wwtg-col-id {
        background: #091b33;
        z-index: 2;
    }

    #wwtg-table tbody tr.row-odd td.wwtg-col-id {
        background: #d0d0d0;
    }

    #wwtg-table tbody tr.row-even td.wwtg-col-id {
        background: #f7f7f7;
    }

    #wwtg-table tbody tr:hover td.wwtg-col-id {
        background: #e8f4f8;
    }
}

/* Responsive Styles */

.responsive {
    width: 100%;
    height: auto;
}


/* Fix browser autofill yellow background with unreadable white text
   Adapts to both light and dark modes
   ================================================== */

/* Light mode - white background with dark text */
.light-mode input:-webkit-autofill,
.light-mode input:-webkit-autofill:hover,
.light-mode input:-webkit-autofill:focus,
.light-mode input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #495057 !important;
}

/* Dark mode - dark background with light text */
.dark-mode input:-webkit-autofill,
.dark-mode input:-webkit-autofill:hover,
.dark-mode input:-webkit-autofill:focus,
.dark-mode input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #343a40 inset !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Fix bulletin board colored row backgrounds - force readable text
   Override Bootstrap table-* classes from monitor container
   ================================================== */

/* Blue backgrounds - need DARK text */
#bulletin table tbody tr.table-info,
#bulletin table tbody tr.table-info td,
#bulletin table tbody tr.table-info th {
    background-color: #17a2b8 !important;
    color: #000000 !important;
}

/* Green backgrounds - need DARK text */
#bulletin table tbody tr.table-success,
#bulletin table tbody tr.table-success td,
#bulletin table tbody tr.table-success th {
    background-color: #28a745 !important;
    color: #000000 !important;
}

/* Red backgrounds - need DARK text */
#bulletin table tbody tr.table-danger,
#bulletin table tbody tr.table-danger td,
#bulletin table tbody tr.table-danger th {
    background-color: #dc3545 !important;
    color: #000000 !important;
}

/* Yellow backgrounds - need DARK text */
#bulletin table tbody tr.table-warning,
#bulletin table tbody tr.table-warning td,
#bulletin table tbody tr.table-warning th {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

/* Gray backgrounds - need DARK text */
#bulletin table tbody tr.table-secondary,
#bulletin table tbody tr.table-secondary td,
#bulletin table tbody tr.table-secondary th {
    background-color: #6c757d !important;
    color: #000000 !important;
}

/* Badges - dark text on all colored backgrounds */
#bulletin .badge.bg-info {
    background-color: #17a2b8 !important;
    color: #000000 !important;
}

#bulletin .badge.bg-success {
    background-color: #28a745 !important;
    color: #000000 !important;
}

#bulletin .badge.bg-danger {
    background-color: #dc3545 !important;
    color: #000000 !important;
}

#bulletin .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

#bulletin .badge.bg-secondary {
    background-color: #6c757d !important;
    color: #000000 !important;
}

/* Motorola IPSC repeaters — distinct from green MMDVM pills */
.badge-ipsc {
    background-color: #ff6600;
    color: #fff;
}

a.badge-ipsc:hover,
a.badge-ipsc:focus {
    color: #fff;
    opacity: 0.92;
}

.dark-mode .main-footer a {
    color: #c2c7d0;
}

.dark-mode .main-footer a:hover,
.dark-mode .main-footer a:focus {
    color: #fff;
}

.light-mode .main-footer a {
    color: #6c757d;
}

.light-mode .main-footer a:hover,
.light-mode .main-footer a:focus {
    color: #343a40;
}

/* Selfcare account page — breathing room above footer */
.selfcare-account-page .content {
    padding-bottom: 2rem;
}

/* Selfcare main page — keep title on one line on narrow viewports */
.selfcare-page-heading,
.login-logo a {
    white-space: nowrap;
}

.selfcare-login-instructions {
    white-space: pre-line;
    margin-bottom: 0;
}

.ss-password-toggle {
    cursor: pointer;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.ss-password-toggle:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(0, 123, 255, 0.45);
}

.ss-password-toggle-icon {
    position: relative;
    display: inline-block;
    width: 1em;
}

.ss-password-toggle--visible .ss-password-toggle-icon::after {
    content: '';
    position: absolute;
    left: -0.1em;
    right: -0.1em;
    top: 50%;
    height: 2px;
    margin-top: -1px;
    background: currentColor;
    transform: rotate(-35deg);
    pointer-events: none;
}

.selfcare-action-row {
    gap: 0.75rem;
}

.selfcare-disconnect-btn {
    font-weight: 400;
    opacity: 0.85;
    border-color: rgba(108, 117, 125, 0.55);
}

.selfcare-disconnect-btn:hover:not(:disabled) {
    opacity: 1;
}

.dark-mode .selfcare-disconnect-btn {
    color: #adb5bd;
    border-color: rgba(173, 181, 189, 0.35);
}

.dark-mode .selfcare-disconnect-btn:hover:not(:disabled) {
    color: #dee2e6;
    background-color: rgba(255, 255, 255, 0.05);
}
