/* Main CSS for QSO Logger */

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

body.dark-mode {
    background-color: #0f1113;
    color: #f0f0f0;
    color-scheme: dark;
}

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

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

body.dark-mode .card {
    background-color: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

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

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

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

body.dark-mode .footer-dark {
    background-color: #0c0d0e;
    color: #ccc;
}

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

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

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

body.dark-mode #chat-manage-bar.bg-white {
    background-color: #1d2226 !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: #1a1e21;
    border-color: #333 !important;
}

body.dark-mode .page-link {
    background-color: #2b3035;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .page-link:hover {
    background-color: #383d41;
    color: #fff;
}

body.dark-mode .page-link.disabled, 
body.dark-mode .disabled > .page-link {
    background-color: #1e2125;
    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;
}

body.dark-mode .modal-content {
    background-color: #1e1e1e;
    color: #fff;
}

/* Tables in dark mode */
body.dark-mode .table {
    color: #e0e0e0;
    --bs-table-color: #e0e0e0;
}

body.dark-mode .table thead th {
    border-bottom-color: #444;
    color: #fff;
}

body.dark-mode .table td {
    border-bottom-color: #2b2b2b;
}

.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;
}

body.dark-mode #chat-widget .card {
    background: #1d2226; 
    border-color: #38434f;
    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: #1d2226;
    color: #fff;
    border-bottom-color: #38434f;
}

.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: #1d2226;
}

#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: #38434f;
}

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

.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: #38434f;
    color: #c9d1d9;
    border-color: #444;
}

.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: #14191e;
    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: #2b3137;
    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: #1d2226;
    border-top-color: #38434f;
}

#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: #14171a;
    border-color: #38434f;
    color: #999;
}

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

body.dark-mode .chat-search-container {
    background: #1d2226;
}

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: #1d2226;
    border-color: #484f58 !important;
    color: #fff;
}

body.dark-mode .dropdown-menu {
    background-color: #1e242b !important;
    border-color: #38434f !important;
}

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

body.dark-mode .dropdown-item:hover {
    background-color: #2b3137 !important;
    color: #fff !important;
}

body.dark-mode .dropdown-divider {
    border-color: #38434f !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: #1d2226;
}

/* Additional Dark Mode Fixes */
body.dark-mode .card-header {
    background-color: #2b3035 !important;
    border-bottom-color: #38434f;
    color: #fff !important;
}

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

body.dark-mode .form-control {
    background-color: #2b3035;
    border-color: #495057;
    color: #fff;
}

body.dark-mode .form-control:focus {
    background-color: #32383e;
    border-color: #0d6efd;
    color: #fff;
}

body.dark-mode .input-group-text {
    background-color: #343a40;
    border-color: #495057;
    color: #ccc;
}

body.dark-mode .dropdown-menu {
    border-color: #444;
}

body.dark-mode hr {
    background-color: #444;
    opacity: 0.5;
}

.emoji-item, .chat-item-text {
    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-color: #2b3035;
    border-color: #495057;
    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.1);
}


body.dark-mode #chat-manage-bar {
    background-color: #1d2226 !important;
    border-bottom-color: #38434f !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: #1e1e1e;
    border-color: #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: #fff;
}
body.dark-mode .flatpickr-day {
    color: #e0e0e0;
}
body.dark-mode .flatpickr-day.nextMonthDay,
body.dark-mode .flatpickr-day.prevMonthDay {
    color: #555;
}
body.dark-mode .flatpickr-day:hover {
    background: #333;
}
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: #1e1e1e;
}
body.dark-mode .flatpickr-time {
    border-top: 1px solid #333;
    background: #1e1e1e;
}
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: #333;
}
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: #444 !important;
}

.chat-manage-bg {
    background-color: #fff;
}
body.dark-mode .chat-manage-bg {
    background-color: #1a1e21 !important;
}

.chat-input-bg {
    background-color: #f8f9fa;
}
body.dark-mode .chat-input-bg {
    background-color: #2b3035 !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;
}
