/* Main CSS for QSO Logger */

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Noto Color Emoji';
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth theme transition for all elements */
body *:not(.flatpickr-calendar *):not(i):not(svg):not(path) {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.15s ease;
}

/* === Dark Mode Premium === */

body.dark-mode {
    background: #0a0e1a;
    color: #e4e6eb;
    color-scheme: dark;
}

body.dark-mode .text-muted {
    color: #adb5bd !important;
}

.card {
    border-radius: 12px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

/* Glassmorphism cards */
body.dark-mode .card {
    background: rgba(30, 35, 55, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
}

/* Fix for footer being too dark */
footer {
    padding: 20px 0;
}

body.dark-mode footer.text-muted {
    color: rgba(255, 255, 255, 0.4) !important;
}
body.dark-mode footer a {
    color: rgba(255, 255, 255, 0.5);
}

.footer-dark {
    background-color: #1a1a1a;
    color: #aaa;
    border-top: 1px solid #333;
}

body.dark-mode .footer-dark {
    background-color: rgba(10, 14, 26, 0.9);
    color: #ccc;
    border-top-color: rgba(255, 255, 255, 0.06);
}

.table-dark {
    --bs-table-bg: #1e1e1e;
}

body.dark-mode .table-dark {
    --bs-table-bg: rgba(255, 255, 255, 0.06);
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
    color: #c8cdd8;
}

/* Wiki code blocks */
.wiki-code {
    background-color: #1e2030;
    color: #e4e6eb;
    font-family: monospace;
    font-size: 0.85rem;
}
body.dark-mode .wiki-code {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark mode alerts */
body.dark-mode .alert-info {
    background-color: rgba(13, 202, 240, 0.12);
    border-color: rgba(13, 202, 240, 0.25);
    color: #6ea8fe;
}
body.dark-mode .alert-success {
    background-color: rgba(25, 135, 84, 0.12);
    border-color: rgba(25, 135, 84, 0.25);
    color: #75b798;
}
body.dark-mode .alert-warning {
    background-color: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.25);
    color: #ffda6a;
}
body.dark-mode .alert-danger {
    background-color: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.25);
    color: #f8b0bd;
}

/* Dark mode tables */
body.dark-mode .table-bordered {
    --bs-table-border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .table-bordered td,
body.dark-mode .table-bordered th {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode accordion */
body.dark-mode .accordion-button {
    background-color: rgba(255, 255, 255, 0.04);
    color: #e4e6eb;
}
body.dark-mode .accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.15);
    color: #6ea8fe;
}
body.dark-mode .accordion-button::after {
    filter: invert(1) brightness(0.8);
}
body.dark-mode .accordion-body {
    background-color: rgba(255, 255, 255, 0.02);
    color: #c8cdd8;
}

.btn-primary {
    border-radius: 8px;
}

#chat-manage-bar.bg-white {
    background-color: #fff !important;
}

body.dark-mode #chat-manage-bar.bg-white {
    background-color: rgba(20, 25, 45, 0.95) !important;
}

#qsoMap {
    height: 485px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Custom colors for modes */
.badge-ft8 { background-color: #7d3cff; color: #fff; }
.badge-ssb { background-color: #ff3c3c; color: #fff; }
.badge-cw { background-color: #3cff7d; color: #000; }

/* Admin Panel Tabs Customization */
.nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    padding: 12px 20px;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    background: transparent !important;
    border-bottom: 3px solid #0d6efd;
}

body.dark-mode .nav-tabs .nav-link {
    color: #aaa;
}

body.dark-mode .nav-tabs .nav-link.active {
    color: #fff;
    border-bottom-color: #0d6efd;
}

.pagination-container {
    background-color: #f8f9fa;
    border-color: #dee2e6 !important;
}

body.dark-mode .pagination-container {
    background-color: rgba(30, 35, 55, 0.5);
    border-color: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .page-link {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
}

body.dark-mode .page-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .page-link.disabled,
body.dark-mode .disabled > .page-link {
    background-color: rgba(255, 255, 255, 0.02);
    color: #6c757d;
}

/* Modal styling */

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
}
body.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.15) !important;
}

.modal-content {
    border-radius: 16px;
}

/* Modal glassmorphism */
body.dark-mode .modal-content {
    background: rgba(25, 30, 50, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Tables in dark mode */
body.dark-mode .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e4e6eb;
    --bs-table-border-color: rgba(255, 255, 255, 0.06);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    color: #e4e6eb;
}

body.dark-mode .table thead th {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .table td {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

th[data-sort] {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    position: relative;
    padding-right: 20px !important;
}

th[data-sort]:hover {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

body.dark-mode th[data-sort]:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

th[data-sort] i {
    font-size: 0.75rem;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.stats-card {
    transition: transform 0.2s;
    border-left: 4px solid #0d6efd;
}

.stats-card:hover {
    transform: translateY(-5px);
}

/* Solar Image Fix */
.solar-img {
    max-width: 100%;
    height: 180px;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* CHAT WIDGET (LinkedIn Style Messaging Drawer) */
#chat-widget {
    position: fixed !important;
    bottom: 0 !important;
    right: 0px !important; /* Glue to right edge */
    width: 320px !important; 
    max-width: 95vw !important;
    z-index: 5000 !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 !important;
}

#chat-widget.minimized {
    transform: translateY(calc(100% - 48px));
}

#chat-widget .card {
    border-radius: 8px 8px 0 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.15);
    border-bottom: none;
    box-shadow: 0 0 16px rgba(0,0,0,0.12);
    overflow: hidden;
}

/* Chat widget glass */
body.dark-mode #chat-widget .card {
    background: rgba(20, 25, 45, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

#chat-header {
    cursor: pointer;
    background: #fff;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode #chat-header {
    background: rgba(20, 25, 45, 0.95);
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.chat-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-icon-btn {
    font-size: 1.1rem;
    color: #666;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    cursor: pointer;
}

.chat-icon-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #000;
}

body.dark-mode .chat-icon-btn {
    color: #c9d1d9;
}

body.dark-mode .chat-icon-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

#chat-body {
    height: 450px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

body.dark-mode #chat-body {
    background: rgba(20, 25, 45, 0.9);
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.chat-thread-item {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.2s;
    cursor: pointer;
}

.chat-thread-item:hover {
    background: rgba(0,0,0,0.03);
}

body.dark-mode .chat-thread-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .chat-thread-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-thread-item.selected {
    background: rgba(0, 0, 0, 0.08) !important;
}

body.dark-mode .chat-thread-item.selected {
    background: rgba(255, 255, 255, 0.15) !important;
}

.avatar-circle {
    width: 42px;
    height: 42px;
    background: #e1e9ee;
    color: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}

body.dark-mode .avatar-circle {
    background: rgba(255, 255, 255, 0.08);
    color: #c9d1d9;
    border-color: rgba(255, 255, 255, 0.1);
}

.chat-item-content {
    flex-grow: 1;
    min-width: 0;
}

.chat-item-user {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

body.dark-mode .chat-item-user {
    color: #fff;
}

.chat-item-time {
    font-size: 0.75rem;
    color: #666;
}

body.dark-mode .chat-item-time {
    color: #8b949e;
}

.chat-item-text {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

body.dark-mode .chat-item-text {
    color: #8b949e;
}

.chat-thread-item.active {
    background: #edf3f8;
    border-left: 4px solid #0a66c2;
}

body.dark-mode .chat-thread-item.active {
    background: rgba(10, 102, 194, 0.1);
    border-left-color: #0a66c2;
}

/* Chat Message Bubbles */
#chat-messages .chat-thread-item {
    border-bottom: none;
    cursor: default;
    padding: 8px 12px;
}

#chat-messages .chat-thread-item:hover {
    background: transparent;
}

#chat-messages .chat-item-text {
    white-space: normal;
    word-break: break-word;
    border-radius: 12px;
    padding: 6px 12px;
    display: inline-block;
}

#chat-messages .chat-thread-item.mine {
    flex-direction: row-reverse;
}

#chat-messages .chat-thread-item.mine .avatar-circle {
    margin-right: 0;
    margin-left: 8px;
}

#chat-messages .chat-thread-item.mine .chat-item-content {
    text-align: right;
}

#chat-messages .chat-thread-item.mine .chat-item-text {
    background: #0a66c2;
    color: #fff !important;
    border-radius: 12px 12px 2px 12px;
}

#chat-messages .chat-thread-item:not(.mine) .chat-item-text {
    background: #f3f6f8;
    color: #333 !important;
    border-radius: 12px 12px 12px 2px;
}

body.dark-mode #chat-messages .chat-thread-item:not(.mine) .chat-item-text {
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
}

#chat-input-container {
    padding: 12px;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.1);
}

body.dark-mode #chat-input-container {
    background: rgba(20, 25, 45, 0.95);
    border-top-color: rgba(255, 255, 255, 0.06);
}

#chat-field {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.9rem;
    color: #6c757d;
}

body.dark-mode #chat-field {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #c8cdd8;
}

.chat-search-container {
    padding: 8px 12px;
    background: #fff;
}

body.dark-mode .chat-search-container {
    background: rgba(20, 25, 45, 0.95);
}

body.dark-mode .chat-search-container input {
    color: #fff;
}

body.dark-mode .chat-search-box {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.1) !important;
}

#chat-compose-search {
    border: 1px solid rgba(0,0,0,0.15) !important;
    font-weight: 500;
}

body.dark-mode #chat-compose-search {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff;
}

/* Dropdown glassmorphism */
body.dark-mode .dropdown-menu {
    background: rgba(25, 30, 50, 0.95) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .dropdown-item {
    color: #c8cdd8 !important;
}

body.dark-mode .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

body.dark-mode .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.dropdown-item {
    transition: background 0.2s;
}

.chat-tabs {
    gap: 20px;
}

.chat-tab {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    padding: 8px 0;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.chat-tab:hover {
    color: #000;
}

.chat-tab.active {
    color: #057642; /* Nasz zielony */
}

.chat-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #057642;
}

body.dark-mode .chat-tab {
    color: #8b949e;
}

body.dark-mode .chat-tab:hover {
    color: #fff;
}

body.dark-mode .chat-tab.active {
    color: #057642;
}

/* Weather Card Specifics */
.weather-card-gradient {
    background: linear-gradient(135deg, #0d6efd 0%, #00428d 100%);
    border: none !important;
}

body.dark-mode .weather-card-gradient {
    background: linear-gradient(135deg, #052c65 0%, #031633 100%);
}

.border-white-25 {
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* User Status Indicator */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #057642; /* Online green */
    border: 1px solid #fff;
    position: absolute;
    bottom: 1px;
    right: 1px;
}

body.dark-mode .status-indicator {
    border-color: rgba(20, 25, 45, 0.9);
}

/* Additional Dark Mode Fixes */
body.dark-mode .card-header {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    color: #fff !important;
}

body.dark-mode .form-label {
    color: #ccc;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e4e6eb;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 130, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 130, 255, 0.15);
    color: #fff;
}

body.dark-mode .form-select {
    color-scheme: dark;
}
body.dark-mode .form-select option,
body.dark-mode .form-select optgroup {
    background: #1a1f35;
    color: #e4e6eb;
}

body.dark-mode .input-group-text {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

/* (dropdown border now handled by glassmorphism rule above) */

body.dark-mode hr {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 0.5;
}

.emoji-item {
    font-family: 'Noto Color Emoji', sans-serif !important;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #212529;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 4000;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.mobile-bottom-nav a {
    color: #adb5bd;
    text-decoration: none;
    text-align: center;
    font-size: 0.65rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-bottom-nav a.active {
    color: #0d6efd;
}

.mobile-bottom-nav i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

@media (max-width: 991px) {
    body {
        padding-bottom: 70px !important;
    }
    
    #chat-widget {
        bottom: 75px !important; /* Nad dolną nawigacją */
        right: 15px !important;
        width: 60px !important;
        height: 60px !important;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    #chat-widget.minimized {
        display: none !important;
    }

    /* Fullscreen state on mobile when opened from nav */
    #chat-widget:not(.minimized) {
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
        transform: none !important;
        z-index: 9999 !important;
    }
    
    #chat-widget:not(.minimized) .card {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
    }
    
    #chat-widget:not(.minimized) #chat-body {
        height: calc(100% - 50px) !important;
    }

    /* Hide some columns in tables on mobile */
    .table th:nth-child(4), .table td:nth-child(4),
    .table th:nth-child(5), .table td:nth-child(5),
    .table th:nth-child(9), .table td:nth-child(9),
    .table th:nth-child(10), .table td:nth-child(10) {
        display: none;
    }
}

/* Standalone App Tweak */
@media (display-mode: standalone) {
    .navbar-custom {
        padding-top: env(safe-area-inset-top);
    }
}

/* Chat Settings Modal Styles */
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

body.dark-mode .settings-row {
    border-bottom-color: rgba(255,255,255,0.06);
}

.settings-row:last-child {
    border-bottom: none;
}

.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: #057642;
    border-color: #057642;
}

.settings-row label {
    font-weight: 500;
    color: #333;
}

body.dark-mode .settings-row label {
    color: #e0e0e0;
}

.settings-link {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.settings-link:hover {
    text-decoration: underline;
}

/* Manage Mode Styling */
.chat-thread-item .form-check {
    display: none;
    align-items: center;
    margin-right: 12px;
}

.manage-mode .chat-thread-item .form-check {
    display: flex;
}

.manage-mode .chat-thread-item .avatar-circle {
    display: none;
}

.selection-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
}

/* Dark Mode Modal Enhancements */
body.dark-mode .modal-body .bg-light {
    background-color: rgba(255,255,255,0.05) !important;
    color: #fff !important;
}

body.dark-mode .modal-body .form-control,
body.dark-mode .modal-body .form-select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-mode .settings-row {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode #chat-manage-bar {
    background-color: rgba(20, 25, 45, 0.95) !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

.x-small {
    font-size: 0.75rem;
}

.border-bottom-dashed {
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}

body.dark-mode .border-bottom-dashed {
    border-bottom-color: rgba(255,255,255,0.1);
}
/* Dark Mode for Flatpickr (Custom Overrides) */
body.dark-mode .flatpickr-calendar {
    background: rgba(25, 30, 50, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #fff;
}
body.dark-mode .flatpickr-day {
    color: #e4e6eb;
}
body.dark-mode .flatpickr-day.nextMonthDay,
body.dark-mode .flatpickr-day.prevMonthDay {
    color: rgba(255, 255, 255, 0.25);
}
body.dark-mode .flatpickr-day:hover {
    background: rgba(255, 255, 255, 0.1);
}
body.dark-mode .flatpickr-day.selected {
    background: #0d6efd;
    border-color: #0d6efd;
}
body.dark-mode .flatpickr-current-month,
body.dark-mode .flatpickr-month {
    color: #fff;
    fill: #fff;
}
body.dark-mode .flatpickr-innerContainer,
body.dark-mode .flatpickr-rContainer,
body.dark-mode .flatpickr-days {
    background: rgba(25, 30, 50, 0.95);
}
body.dark-mode .flatpickr-time {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(25, 30, 50, 0.95);
}
body.dark-mode .flatpickr-time input,
body.dark-mode .flatpickr-time .flatpickr-am-pm {
    color: #fff;
}
body.dark-mode .flatpickr-time input:hover,
body.dark-mode .flatpickr-time .flatpickr-am-pm:hover {
    background: rgba(255, 255, 255, 0.1);
}
body.dark-mode .flatpickr-months .flatpickr-prev-month,
body.dark-mode .flatpickr-months .flatpickr-next-month {
    color: #fff;
    fill: #fff;
}
/* Dark Mode Utility Classes for Chat and Status */
.profile-status-container {
    background-color: rgba(0, 0, 0, 0.05);
}
body.dark-mode .profile-status-container {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.chat-manage-bg {
    background-color: #fff;
}
body.dark-mode .chat-manage-bg {
    background-color: rgba(20, 25, 45, 0.95) !important;
}

.chat-input-bg {
    background-color: #f8f9fa;
}
body.dark-mode .chat-input-bg {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}

/* Bandplan nav styling */
.band-nav-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.band-nav-btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}
.band-nav-btn:hover {
    transform: translateY(-2px);
}

/* AGGRESSIVE GOOGLE TRANSLATE HIDE */
.goog-te-banner-frame.skiptranslate, 
.goog-te-banner-frame, 
#goog-gt-tt, 
.goog-te-balloon-frame {
    display: none !important;
}

body {
    top: 0 !important;
    position: static !important;
}

iframe.goog-te-banner-frame {
    display: none !important;
}

/* === Dark Mode Premium: Glass Navbar === */
body.dark-mode .navbar {
    background: rgba(15, 20, 35, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-mode .navbar-custom {
    background: rgba(15, 20, 35, 0.85) !important;
}

/* === Dark Mode Premium: Buttons === */
body.dark-mode .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.15);
    color: #b0b8c8;
}
body.dark-mode .btn-outline-secondary:hover,
body.dark-mode .btn-outline-secondary.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Subtle glow on primary buttons */
body.dark-mode .btn-primary {
    box-shadow: 0 2px 10px rgba(13, 110, 253, 0.3);
}
body.dark-mode .btn-primary:hover {
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
}

/* === Dark Mode Premium: Scrollbar === */
body.dark-mode ::-webkit-scrollbar {
    width: 6px;
}
body.dark-mode ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}
body.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* === Dark Mode Premium: Badge adjustments === */
body.dark-mode .badge.bg-light {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #c8cdd8 !important;
}

/* === Dark Mode Premium: Mobile bottom nav glass === */
body.dark-mode .mobile-bottom-nav {
    background: rgba(15, 20, 35, 0.9) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* === Dark Mode Premium: Placeholder text === */
body.dark-mode ::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* === Dark Mode Premium: Toast glass === */
body.dark-mode .toast {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* === Dark Mode Premium: Misc refinements === */
body.dark-mode .bg-light {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .border {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .list-group-item {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    color: #e4e6eb;
}

body.dark-mode .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .offcanvas {
    background: rgba(20, 25, 45, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(255, 255, 255, 0.08);
    color: #e4e6eb;
}

body.dark-mode .accordion-item {
    background-color: rgba(30, 35, 55, 0.5);
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .accordion-button {
    background-color: rgba(255, 255, 255, 0.03);
    color: #e4e6eb;
}

body.dark-mode .accordion-button:not(.collapsed) {
    background-color: rgba(99, 130, 255, 0.1);
    color: #c8cdd8;
}

/* ===== Dashboard Tiles Enhancement ===== */
.dashboard-tile {
    border-radius: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    position: relative;
}
.dashboard-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}
.dashboard-tile .tile-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}
.dashboard-tile .tile-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}
.dashboard-tile .tile-icon {
    font-size: 2.5rem;
    opacity: 0.15;
    position: absolute;
    right: 15px;
    top: 15px;
}

/* Tile gradient backgrounds */
.tile-qso-today { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); color: white; }
.tile-qso-today .tile-header { color: rgba(255,255,255,0.85); }
.tile-qso-today .huge-number { color: white !important; }
.tile-qso-today .small-text { color: rgba(255,255,255,0.8); }

.tile-qrz { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); color: white; }
.tile-qrz .tile-header { color: rgba(255,255,255,0.85); }
.tile-qrz .tile-header i { color: white !important; }
.tile-qrz #qrz-status-text { color: white !important; }
.tile-qrz .small-text { color: rgba(255,255,255,0.8); }

.tile-weather { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; }
.tile-weather .tile-header { color: rgba(255,255,255,0.85); }
.tile-weather .tile-header i { color: white !important; }

.tile-database { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.tile-database .tile-header { color: rgba(255,255,255,0.85); }
.tile-database .tile-header i { color: white !important; }
.tile-database .fw-bold.fs-3 { color: white; }
.tile-database .small-text { color: rgba(255,255,255,0.8); }
.tile-database .vr { border-color: rgba(255,255,255,0.3) !important; background-color: rgba(255,255,255,0.3); }

.tile-psk { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; }
.tile-psk .tile-header { color: rgba(255,255,255,0.85); }
.tile-psk .tile-header i { color: white !important; }

.tile-recent { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); color: white; }
.tile-recent .tile-header { color: rgba(255,255,255,0.85); }
.tile-recent .tile-header i { color: white !important; }

.tile-propagation { background: linear-gradient(135deg, #0c3483 0%, #a2b6df 50%, #6b8dd6 100%); color: white; }
.tile-propagation .tile-header { color: rgba(255,255,255,0.85); }
.tile-propagation .tile-header i { color: white !important; }
.tile-propagation .small-text { color: rgba(255,255,255,0.7); }

/* Pulse animation for live data */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.live-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    animation: pulse-dot 2s ease-in-out infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* Light mode: override Bootstrap utilities inside gradient tiles */
.tile-qso-today .text-muted,
.tile-qrz .text-muted,
.tile-weather .text-muted,
.tile-database .text-muted,
.tile-psk .text-muted,
.tile-recent .text-muted,
.tile-propagation .text-muted { color: rgba(255,255,255,0.65) !important; }

.tile-propagation .text-primary { color: rgba(255,255,255,0.95) !important; }
.tile-propagation .text-success { color: rgba(200,255,200,0.9) !important; }

.tile-psk .text-primary { color: rgba(255,255,255,0.95) !important; }
.tile-psk .text-muted span,
.tile-recent .text-muted { color: rgba(255,255,255,0.6) !important; }

/* Select dropdowns inside gradient tiles */
.dashboard-tile .form-select {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.3);
}
.dashboard-tile .form-select option {
    background: #fff;
    color: #333;
}

/* Dark mode tile adjustments */
body.dark-mode .dashboard-tile .text-muted { color: #8b949e !important; }
body.dark-mode .dashboard-tile .text-primary { color: #6ea8fe !important; }
body.dark-mode .dashboard-tile .text-success { color: #75b798 !important; }
body.dark-mode .dashboard-tile .form-select {
    background-color: rgba(255,255,255,0.08);
    color: #e4e6eb;
    border-color: rgba(255,255,255,0.15);
}
body.dark-mode .dashboard-tile .form-select option {
    background: #1a1f35;
    color: #e4e6eb;
}
body.dark-mode .dashboard-tile {
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
}
body.dark-mode .dashboard-tile:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
}
body.dark-mode .tile-qso-today,
body.dark-mode .tile-qrz,
body.dark-mode .tile-weather,
body.dark-mode .tile-database,
body.dark-mode .tile-psk,
body.dark-mode .tile-recent,
body.dark-mode .tile-propagation {
    background: rgba(30, 35, 55, 0.7) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e4e6eb;
}
body.dark-mode .tile-qso-today .tile-header,
body.dark-mode .tile-qrz .tile-header,
body.dark-mode .tile-weather .tile-header,
body.dark-mode .tile-database .tile-header,
body.dark-mode .tile-psk .tile-header,
body.dark-mode .tile-recent .tile-header,
body.dark-mode .tile-propagation .tile-header { color: #adb5bd; }
body.dark-mode .tile-qso-today .huge-number,
body.dark-mode .tile-database .fw-bold.fs-3 { color: #e4e6eb !important; }
body.dark-mode .tile-qso-today .small-text,
body.dark-mode .tile-qrz .small-text,
body.dark-mode .tile-database .small-text,
body.dark-mode .tile-propagation .small-text,
body.dark-mode .tile-recent .small-text,
body.dark-mode .tile-psk .small-text { color: #8b949e; }
body.dark-mode .tile-database .vr { border-color: rgba(255,255,255,0.1) !important; background-color: rgba(255,255,255,0.1); }

/* === DXCC Awards Tracker === */

.awards-tile .card-body {
    border-left: 4px solid transparent;
}
.awards-tile:nth-child(1) .card-body { border-left-color: var(--bs-primary); }
.awards-tile:nth-child(2) .card-body { border-left-color: var(--bs-success); }
.awards-tile:nth-child(3) .card-body { border-left-color: var(--bs-warning); }

.awards-progress {
    border-radius: 12px;
    background-color: rgba(0,0,0,0.08);
    overflow: hidden;
}
body.dark-mode .awards-progress {
    background-color: rgba(255,255,255,0.08);
}

.awards-progress .progress-bar {
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 24px;
}

.awards-progress-sm {
    border-radius: 8px;
    background-color: rgba(0,0,0,0.06);
    overflow: hidden;
}
body.dark-mode .awards-progress-sm {
    background-color: rgba(255,255,255,0.06);
}

.awards-progress-sm .progress-bar {
    border-radius: 8px;
    font-size: 0.7rem;
    line-height: 18px;
}

.awards-badge-worked {
    background-color: #28a745;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.3em 0.7em;
    border-radius: 6px;
}

.awards-badge-needed {
    background-color: #6c757d;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.3em 0.7em;
    border-radius: 6px;
}

body.dark-mode .awards-badge-worked {
    background-color: #1fa33e;
}
body.dark-mode .awards-badge-needed {
    background-color: #495057;
}

#entity-table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}
body.dark-mode #entity-table thead th {
    color: #adb5bd;
    border-bottom-color: rgba(255,255,255,0.1);
}

#dxcc-world-map {
    border-radius: 0 0 12px 12px;
}

#band-breakdown-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
}
body.dark-mode #band-breakdown-table th {
    color: #adb5bd;
}

/* DX Cluster Spots */
.dx-spot-item {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dx-spot-item:hover {
    background: rgba(13, 110, 253, 0.05);
}
body.dark-mode .dx-spot-item {
    border-bottom-color: rgba(255,255,255,0.05);
}
body.dark-mode .dx-spot-item:hover {
    background: rgba(255,255,255,0.05);
}
.dx-freq {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    min-width: 75px;
}
.dx-call {
    font-weight: 700;
    color: #0d6efd;
    text-decoration: none;
}
.dx-call:hover {
    text-decoration: underline;
}
.dx-time {
    color: #6c757d;
    font-size: 0.7rem;
    min-width: 40px;
}

/* Contest Mode */
#contest-controls .badge {
    font-size: 0.85rem;
    padding: 6px 10px;
    font-family: 'Courier New', monospace;
}
.contest-active #qsoForm {
    border-left: 3px solid #ffc107;
    padding-left: 12px;
}
body.dark-mode .contest-active #qsoForm {
    border-left-color: #ffca2c;
}

/* === Profile Page === */

.profile-header .card-body {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(13, 110, 253, 0.02) 100%);
}
body.dark-mode .profile-header .card-body {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12) 0%, rgba(30, 35, 55, 0.5) 100%);
}

.profile-avatar-wrapper {
    flex-shrink: 0;
}
.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #0d6efd;
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.25);
}
.profile-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
}

.profile-status-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #fff;
}
body.dark-mode .profile-status-dot {
    border-color: #1e2337;
}
.profile-status-online {
    background-color: #057642;
}
.profile-status-offline {
    background-color: #dc3545;
}

/* Speech bubble status comment — small empty by default, full text on hover */
.profile-status-bubble {
    position: absolute;
    top: 6px;
    left: calc(100% - 8px);
    right: auto;
    background: #dde9ff;
    border: 1.5px solid #7aaeff;
    border-radius: 12px 12px 12px 2px;
    padding: 0;
    width: 14px;
    height: 14px;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.4;
    color: transparent;
    font-size: 0;
    z-index: 20;
    cursor: default;
    transition: width 0.25s ease, height 0.25s ease, padding 0.2s ease,
                font-size 0.15s ease, color 0.2s ease, background 0.2s ease;
}
.profile-status-bubble::before {
    content: '';
    position: absolute;
    left: -7px;
    right: auto;
    top: 4px;
    border-width: 4px 7px 4px 0;
    border-style: solid;
    border-color: transparent #7aaeff transparent transparent;
    transition: top 0.2s ease;
}
/* Expand on avatar wrapper hover */
.profile-avatar-wrapper:hover .profile-status-bubble {
    width: auto;
    height: auto;
    padding: 5px 10px;
    font-size: 0.75rem;
    color: #1a3a6e;
    background: #dde9ff;
    overflow: visible;
    z-index: 100;
    left: calc(100% - 8px);
    right: auto;
}
.profile-avatar-wrapper:hover .profile-status-bubble::before {
    top: 50%;
    transform: translateY(-50%);
}
body.dark-mode .profile-status-bubble {
    background: #1a2a45;
    border-color: #3a6bc4;
}
body.dark-mode .profile-status-bubble::before {
    border-color: transparent #3a6bc4 transparent transparent;
}
body.dark-mode .profile-avatar-wrapper:hover .profile-status-bubble {
    background: #1a2a45;
    color: #c8d6f0;
}


.profile-callsign {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #0d6efd;
    margin: 0;
    line-height: 1.1;
}
body.dark-mode .profile-callsign {
    color: #5ea4ff;
}

.profile-stat-tile {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}
.profile-stat-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12) !important;
}
body.dark-mode .profile-stat-tile:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.4) !important;
}
.profile-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}
.profile-stat-label {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Dark mode progress bars */
body.dark-mode .progress {
    background-color: rgba(255, 255, 255, 0.08);
}

/* === In-App Notifications === */
.notif-item { cursor: pointer; border-bottom: 1px solid rgba(0,0,0,0.05); transition: background 0.15s; }
.notif-item:hover { background: rgba(13,110,253,0.05); }
.notif-item.unread { background: rgba(13,110,253,0.03); }
body.dark-mode .notif-item { border-bottom-color: rgba(255,255,255,0.05); }
body.dark-mode .notif-item:hover { background: rgba(255,255,255,0.05); }
body.dark-mode .notif-item.unread { background: rgba(99,130,255,0.08); }
body.dark-mode #notif-dropdown { background: rgba(25,30,50,0.95); backdrop-filter: blur(16px); }
body.dark-mode #notif-dropdown .border-bottom { border-bottom-color: rgba(255,255,255,0.08) !important; }
body.dark-mode #notif-dropdown .fw-bold { color: #e4e6eb; }
#notif-bell:focus { box-shadow: none; }

/* === Online Users Button (Admin/Mod navbar) === */
#online-users-btn:focus { box-shadow: none; }

/* ===================================================================
   DARK MODE BUG FIXES (2026-04-05)
   =================================================================== */

/* --- Fix #1: eQSL card designer — keep design preview area light --- */
body.dark-mode .design-option img {
    background: #fff;
}
body.dark-mode .design-card-box img {
    background: #fff;
}

/* --- Fix #2: Navbar station profile switcher dropdown --- */
body.dark-mode .profile-switcher-menu {
    background: #1a1f35;
    border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .profile-switcher-menu .dropdown-item {
    color: #e4e6eb;
}
body.dark-mode .profile-switcher-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
body.dark-mode .profile-switcher-menu .dropdown-header {
    color: #adb5bd;
}
body.dark-mode .profile-switcher-menu .text-muted,
body.dark-mode .profile-switcher-menu .x-small {
    color: #adb5bd !important;
}
body.dark-mode .profile-switcher-menu .dropdown-item.active {
    background: rgba(13, 110, 253, 0.25);
    color: #fff !important;
}
body.dark-mode .profile-switcher-menu .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .profile-switcher-menu .fw-bold {
    color: #e4e6eb;
}

/* --- Fix #2b: Settings pref dropdowns (date format, timezone) --- */
.pref-dropdown {
    border-radius: 10px;
}
body.dark-mode .pref-dropdown {
    background-color: #2b3035;
    color: #fff;
    border-color: #495057;
}

/* --- Fix #3: Admin global settings dropdowns --- */
body.dark-mode #nav-settings .card {
    background: rgba(30, 35, 55, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e4e6eb;
}
body.dark-mode #nav-settings .card h6 {
    color: #e4e6eb !important;
}
body.dark-mode #nav-settings .card .form-select {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #e4e6eb !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
body.dark-mode #nav-settings .card .form-select option,
body.dark-mode #nav-settings .card .form-select optgroup {
    background: #1a1f35;
    color: #e4e6eb;
}
body.dark-mode #nav-settings .card .form-check-label {
    color: #ccc;
}
body.dark-mode #nav-settings .card .text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* --- Fix #4: Profile card avatar shadow artifact in dark mode --- */
body.dark-mode .profile-header.card {
    box-shadow: none !important;
}
body.dark-mode .profile-avatar-wrapper {
    background: transparent !important;
    box-shadow: none !important;
}
body.dark-mode .profile-avatar {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(94, 164, 255, 0.5);
}

/* --- Fix #4b: View modal info card bg-light-subtle in dark mode --- */
body.dark-mode .card.bg-light-subtle {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: #e4e6eb;
}

/* --- Fix #5: Headings (h1-h6) text color in dark mode --- */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: #e4e6eb;
}
body.dark-mode .card-header.bg-warning-subtle,
body.dark-mode .card-header.bg-info-subtle,
body.dark-mode .card-header.bg-primary-subtle,
body.dark-mode .card-header.bg-danger-subtle {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #e4e6eb !important;
}
body.dark-mode .modal-header.bg-success,
body.dark-mode .modal-header.bg-primary,
body.dark-mode .modal-header.bg-info {
    color: #fff !important;
}
body.dark-mode .modal-header.bg-success .modal-title,
body.dark-mode .modal-header.bg-primary .modal-title,
body.dark-mode .modal-header.bg-info .modal-title {
    color: #fff !important;
}

/* --- Fix #6: Station profile edit modal in dark mode --- */
body.dark-mode #profileModal .modal-content {
    background: rgba(25, 30, 50, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e4e6eb;
}
body.dark-mode #profileModal .form-label {
    color: #ccc;
}
body.dark-mode #profileModal .form-control,
body.dark-mode #profileModal .form-select {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e4e6eb !important;
}
body.dark-mode #profileModal .form-select option,
body.dark-mode #profileModal .form-select optgroup {
    background: #1a1f35;
    color: #e4e6eb;
}
body.dark-mode #profileModal .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
body.dark-mode #profileModal .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}
body.dark-mode #profileModal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* --- Fix #6b: Settings avatar badge border --- */
body.dark-mode .avatar-edit-badge {
    border-color: #1a1f35 !important;
}

/* ===================================================================
   MOBILE RESPONSIVENESS — Comprehensive fixes
   =================================================================== */

/* --- 768px: Tablet portrait --- */
@media (max-width: 768px) {
    /* QSO table: compact */
    #qsoTable table { font-size: 0.78rem; }
    #qsoTable td, #qsoTable th { padding: 4px 6px !important; white-space: nowrap; }
    #qsoTable img[alt=""] { width: 18px !important; height: 14px !important; } /* flagi mniejsze */
    /* Notification & online dropdown: responsive width */
    #notif-dropdown { width: 90vw !important; max-width: 350px; }

    /* DX spots: reduce height to avoid double-scroll */
    #dx-spots-container { max-height: 250px !important; }

    /* Profile avatar smaller */
    .profile-avatar { width: 85px !important; height: 85px !important; }

    /* Awards entity table: hide less important columns */
    #entity-table th:nth-child(4), #entity-table td:nth-child(4),
    #entity-table th:nth-child(5), #entity-table td:nth-child(5),
    #entity-table th:nth-child(6), #entity-table td:nth-child(6) { display: none; }
}

/* --- 576px: Mobile --- */
@media (max-width: 576px) {
    /* Global: prevent iOS zoom on input focus */
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="tel"], select, textarea {
        font-size: 16px !important;
    }

    /* Dashboard grid: single col, smaller gaps */
    .dashboard-grid { grid-gap: 8px !important; }
    .dashboard-tile { min-height: 120px; }

    /* PSK/DX band filter dropdowns: bigger touch target */
    #psk-band-filter, #dx-band-filter {
        height: 32px !important;
        font-size: 0.8rem !important;
        padding: 4px 8px !important;
    }

    /* DX spots container */
    #dx-spots-container { max-height: 200px !important; }

    /* Chat: bigger touch targets */
    #chat-emoji-btn, #chat-attach-btn {
        padding: 8px 10px !important;
        min-width: 40px;
        min-height: 40px;
    }
    #chat-send-btn { width: 40px; height: 40px; }
    #chat-file-name { max-width: 100px !important; }

    /* Essentials: tab pills wrap */
    #essentialsTab {
        flex-wrap: wrap !important;
        gap: 4px;
    }
    #essentialsTab .nav-link {
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
    }
    #essentialsTab .nav-link i { margin-right: 4px !important; }

    /* Bandplan: compact nav buttons */
    .band-nav-group {
        gap: 4px !important;
    }
    .band-nav-btn {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }

    /* QSO form: band buttons bigger touch target */
    .band-btn {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
        min-height: 36px;
    }

    /* Contest mode input: full width */
    #contest-name { width: 100% !important; }

    /* Awards filters: full-width stack */
    #filter-band, #filter-mode { min-width: 0 !important; width: 48% !important; }
    #entity-search { width: 100% !important; }

    /* Pagination: stack on mobile */
    .pagination-container {
        flex-direction: column !important;
        gap: 8px;
        text-align: center;
    }

    /* Settings avatar smaller */
    .avatar-preview img { width: 140px !important; height: 140px !important; }

    /* Profile page: smaller avatar, callsign */
    .profile-avatar { width: 70px !important; height: 70px !important; }
    .profile-callsign { font-size: 1.6rem; }
    .profile-stat-value { font-size: 1.3rem; }

    /* Mobile bottom nav: ensure touch targets */
    .mobile-bottom-nav { padding: 10px 0; }
    .mobile-bottom-nav a { min-height: 44px; }

    /* Notification dropdown: fit mobile */
    #notif-dropdown { width: 95vw !important; max-width: 350px !important; }

    /* Bandplan: table fixed width override */
    #bandplan-content th[style*="250px"] { width: auto !important; min-width: 140px !important; }
    #bandplan-content th[style*="100px"] { width: 60px !important; }

    /* QSO log table: hide columns matching thead d-none classes */
    #qsoTable td:nth-child(2) { display: none !important; } /* time - d-none d-sm */
    #qsoTable td:nth-child(4) { display: none !important; } /* freq - d-none d-lg */
    #qsoTable td:nth-child(7) { display: none !important; } /* RST - d-none d-md */
    #qsoTable td:nth-child(8) { display: none !important; } /* kraj - d-none d-sm */
    #qsoTable td:nth-child(9),
    #qsoTable td:nth-child(10),
    #qsoTable td:nth-child(11) { display: none !important; } /* qth,dxcc,operator - d-none d-xl */

    /* Stats page: button group stacks */
    .btn-group-stats { flex-direction: column !important; }
    .btn-group-stats .btn { width: 100% !important; border-radius: 0.375rem !important; margin-bottom: 2px; }

    /* Profile map: smaller on mobile */
    #profile-qso-map { height: 250px !important; }

    /* Settings avatar: smaller */
    .avatar-preview img { width: 100px !important; height: 100px !important; }

    /* Grid menu: center on mobile */
    .grid-menu-dropdown {
        min-width: 0 !important;
        width: 92vw !important;
        max-width: 320px !important;
        position: fixed !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        top: 56px !important;
    }

    /* Admin online panel: ensure table doesn't overflow */
    #nav-online .table th,
    #nav-online .table td { padding: 6px 4px; font-size: 0.8rem; }
    #nav-online .table th:nth-child(3),
    #nav-online .table td:nth-child(3) { display: none; }
    #nav-online .table th:nth-child(4),
    #nav-online .table td:nth-child(4) { width: auto !important; }
}

/* QSO table: restore columns at breakpoints */
@media (min-width: 577px) {
    #qsoTable td:nth-child(2),
    #qsoTable td:nth-child(8) { display: table-cell !important; } /* time, kraj */
}
@media (min-width: 769px) {
    #qsoTable td:nth-child(7) { display: table-cell !important; } /* RST */
}
@media (min-width: 993px) {
    #qsoTable td:nth-child(4) { display: table-cell !important; } /* freq */
}
@media (min-width: 1200px) {
    #qsoTable td:nth-child(9),
    #qsoTable td:nth-child(10),
    #qsoTable td:nth-child(11) { display: table-cell !important; } /* qth,dxcc,operator */
}

/* Mobile-only nav items in avatar dropdown: hidden on >=480px */
.d-nav-mobile { display: none !important; }

/* --- 480px: Phones — navbar minimized --- */
@media (max-width: 480px) {
    /* Chowaj zegar, grid menu, dzwonek — zostaje avatar */
    .navbar .bg-dark.bg-opacity-50.rounded-pill { display: none !important; } /* zegar */
    #gridMenuBtn { display: none !important; } /* grid menu */
    #notif-bell { display: none !important; } /* dzwonek */
    .navbar-brand span:not(#operatorSign) { font-size: 0.85rem; }
    #operatorSign { display: none !important; }

    /* Pokaż nawigację w dropdown avatara */
    .d-nav-mobile { display: block !important; }
}

/* --- 360px: Very small phones --- */
@media (max-width: 360px) {
    .btn-sm { padding: 0.2rem 0.35rem !important; font-size: 0.65rem !important; }
    .container { --bs-gutter-x: 0.5rem; }
    .band-nav-btn { padding: 3px 5px !important; font-size: 0.65rem !important; }
}

/* ───── Chat Lightbox ───── */
#chat-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
#chat-lightbox.lb-active {
    display: flex;
    opacity: 1;
}
#lb-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    transform-origin: center center;
    cursor: grab;
    user-select: none;
    transition: transform 0.1s ease;
    display: block;
}
#lb-img.lb-dragging {
    cursor: grabbing;
    transition: none;
}
#lb-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    padding: 0;
    z-index: 1;
}
#lb-close:hover { opacity: 1; }
#lb-prev,
#lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: background 0.15s;
    z-index: 1;
}
#lb-prev { left: 16px; }
#lb-next { right: 16px; }
#lb-prev:hover,
#lb-next:hover { background: rgba(255,255,255,0.3); opacity: 1; }
#lb-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    pointer-events: none;
}
#lb-download {
    position: absolute;
    top: 16px;
    right: 64px;
    color: #fff;
    opacity: 0.8;
    font-size: 1.4rem;
    text-decoration: none;
    line-height: 1;
}
#lb-download:hover { opacity: 1; color: #fff; }
