/* CSS Variables */
:root {
    --primary-bg: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --secondary-bg: rgba(30, 60, 114, 0.9);
    --accent-color: #4CAF50;
    --accent-hover: #45a049;
    --text-primary: #ffffff;
    --text-secondary: #B0BEC5;
    --card-bg: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.2);
    --sidebar-bg: rgba(46, 125, 50, 0.15);
}

/* Base Styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', monospace;
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    animation: fadeIn 0.8s ease-in;
}

.loading-icon {
    color: var(--accent-color);
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 20px auto 0;
}

.loading-progress {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #81C784);
    border-radius: 2px;
    animation: loadProgress 3s ease-out forwards;
}

@keyframes loadProgress {
    to { width: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Header/Navbar */
.navbar {
    background: var(--secondary-bg) !important;
    border-bottom: 2px solid var(--accent-color);
    padding: 10px 20px;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    color: var(--text-primary) !important;
    font-weight: bold;
    font-size: 1.4rem;
}

.navbar-brand i {
    color: var(--accent-color);
    margin-right: 10px;
}

.navbar-text {
    color: var(--text-primary) !important;
    margin: 0 10px;
}

/* Status Indicator */
.status-indicator {
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: bold;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status-indicator.connected {
    background: var(--accent-color);
    color: white;
    border-color: rgba(76, 175, 80, 0.3);
    animation: pulse-green 2s infinite;
}

.status-indicator.disconnected {
    background: #f44336;
    color: white;
    border-color: rgba(244, 67, 54, 0.3);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(244, 67, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}

/* Main Container */
.main-content {
    padding: 0 15px;
}

.main-content .row {
    margin: 0;
}

.content-area {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    min-height: calc(100vh - 140px);
}

.content-area h3 {
    color: white !important;
    font-weight: bold !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.content-area h3 i {
    color: var(--accent-color) !important;
    margin-right: 10px !important;
}

.content-area p.text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500 !important;
}

/* Stat Cards */
.stat-card {
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: rgba(76, 175, 80, 0.1) !important;
    border: 1px solid rgba(76, 175, 80, 0.3) !important;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.2);
    background: rgba(76, 175, 80, 0.15) !important;
}

.stat-card .card-title {
    color: white !important;
    font-weight: bold !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.stat-number {
    font-size: 2.8rem !important;
    font-weight: bold !important;
    color: #4CAF50 !important;
    line-height: 1.2 !important;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5) !important;
}

.stat-card .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500 !important;
}

/* Sidebar */
.sidebar {
    padding: 0 15px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* List Group Items (Navigation) */
.list-group-item {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-color) !important;
    color: white !important;
    transition: all 0.3s ease;
    font-weight: 500 !important;
}

.list-group-item:hover,
.list-group-item.active {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: white !important;
    transform: translateX(5px);
    font-weight: bold !important;
}

.list-group-item i {
    margin-right: 10px;
    width: 16px;
}

/* Status Colors */
.text-success {
    color: #4CAF50 !important;
}

.text-danger {
    color: #f44336 !important;
}

.text-warning {
    color: #FF9800 !important;
}

/* Sidebar Status */
.sidebar .card-body div {
    margin-bottom: 8px;
}

.sidebar .card-body strong {
    color: white !important;
    font-size: 0.9rem !important;
}

.sidebar .card-body span {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
}

/* Content Area */
.content-container {
    padding: 0;
    height: 100%;
}

.content-area {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-left: 2px solid var(--accent-color);
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.tab-content-area {
    height: 100%;
    width: 100%;
}

/* Dashboard specific improvements */
.dashboard .row {
    margin-bottom: 30px !important;
}

.dashboard .col-md-6 {
    margin-bottom: 20px !important;
}

.dashboard .card {
    height: 100% !important;
}

/* Recent spots card improvements */
#recentSpotsList {
    padding: 0 !important;
    margin: 0 !important;
}

/* Band activity chart container */
.dashboard .col-md-6:last-child .card {
    margin-left: 15px !important;
}

.dashboard .col-md-6:first-child .card {
    margin-right: 15px !important;
}

/* Loading Message */
.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-secondary);
    font-size: 16px;
}

.loading-message i {
    margin-right: 10px;
    color: var(--accent-color);
}

/* Buttons */
.btn-primary {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: white !important;
    font-weight: bold !important;
}

.btn-primary:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-success {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: white !important;
    font-weight: bold !important;
}

.btn-success:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

.btn-outline-success {
    color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    background: transparent !important;
}

.btn-outline-success:hover {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: white !important;
}

.btn-outline-light {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    background: transparent !important;
}

.btn-outline-light:hover {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: white !important;
}

/* Cards */
.card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: white !important;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background: rgba(76, 175, 80, 0.2) !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-weight: bold !important;
    color: white !important;
}

.card-header h6 {
    color: white !important;
    font-weight: bold !important;
    margin: 0 !important;
}

.card-title {
    color: white !important;
    font-weight: bold !important;
    margin-bottom: 0;
}

.card-text {
    color: rgba(255, 255, 255, 0.9) !important;
}

.card-body {
    color: white !important;
}

.card-body p,
.card-body div,
.card-body span {
    color: rgba(255, 255, 255, 0.9) !important;
}

.card-body strong {
    color: white !important;
    font-weight: bold !important;
}

.card-body .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Tables */
.table {
    color: white !important;
    width: 100% !important;
    table-layout: auto !important;
}

.table-dark {
    background: var(--secondary-bg) !important;
}

.table-dark th {
    background: var(--accent-color) !important;
    color: white !important;
    font-weight: bold !important;
    border-color: var(--border-color) !important;
    text-align: center !important;
    padding: 12px 8px !important;
    font-size: 0.9rem !important;
    white-space: nowrap !important;
}

.table td, .table th {
    border-color: var(--border-color) !important;
    padding: 10px 8px;
    vertical-align: middle;
    color: white !important;
}

.table tbody tr:hover {
    background-color: rgba(76, 175, 80, 0.15) !important;
    cursor: pointer;
}

.table tbody td {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    text-align: center !important;
}

/* Main spots table container - ensure full width utilization */
.card-body .table-responsive,
.card-body > div[style*="max-height"] {
    width: 100% !important;
}

.card-body .table-responsive .table,
.card-body > div[style*="max-height"] .table {
    min-width: 100% !important;
    margin-bottom: 0 !important;
}

/* Recent spots table styling */
.recent-spots-table {
    width: 100% !important;
    color: white !important;
    font-size: 0.8rem !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.recent-spots-table thead th {
    background: var(--accent-color) !important;
    color: white !important;
    font-weight: bold !important;
    border: 1px solid var(--border-color) !important;
    padding: 8px 6px !important;
    text-align: center !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.recent-spots-table tbody td {
    border: 1px solid var(--border-color) !important;
    padding: 6px 4px !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.05) !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
}

.recent-spots-table tbody tr:hover {
    background-color: rgba(76, 175, 80, 0.1) !important;
}

.recent-spots-table tbody td:first-child {
    font-weight: bold !important;
    color: var(--accent-color) !important;
}

/* Sticky table header */
.table thead.sticky-top th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background: var(--accent-color) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Table responsive improvements */
.table-responsive {
    border-radius: 8px !important;
}

/* Improve table hover effect */
.table-hover tbody tr:hover {
    background-color: rgba(76, 175, 80, 0.15) !important;
    transform: translateX(2px) !important;
    transition: all 0.2s ease !important;
}

/* All DX Spots table specific styling */
#allSpotsTable {
    table-layout: fixed !important;
    width: 100% !important;
    border-collapse: collapse !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Ensure table container prevents overflow */
.table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
    contain: layout style !important;
}

#allSpotsTable td,
#allSpotsTable th {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    padding: 8px 6px !important;
    vertical-align: middle !important;
}

/* Override nowrap for comment column to allow text wrapping */
#allSpotsTable td:nth-child(11) {
    white-space: normal !important;
}

/* Ensure table doesn't grow beyond container */
.table-responsive {
    overflow-x: auto !important;
    max-width: 100% !important;
}

/* Additional safety for long content */
#allSpotsTable {
    table-layout: fixed !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Specific column widths for all spots table */
#allSpotsTable th:nth-child(1), /* Time */
#allSpotsTable td:nth-child(1) {
    width: 7% !important;
    min-width: 60px !important;
}

#allSpotsTable th:nth-child(2), /* Band */
#allSpotsTable td:nth-child(2) {
    width: 6% !important;
    min-width: 50px !important;
    text-align: center !important;
    font-weight: bold !important;
    color: var(--accent-color) !important;
}

#allSpotsTable th:nth-child(3), /* Frequency */
#allSpotsTable td:nth-child(3) {
    width: 9% !important;
    min-width: 90px !important;
}

#allSpotsTable th:nth-child(4), /* Mode */
#allSpotsTable td:nth-child(4) {
    width: 6% !important;
    min-width: 50px !important;
    text-align: center !important;
    font-weight: bold !important;
    color: #81C784 !important;
}

#allSpotsTable th:nth-child(5), /* DX Callsign */
#allSpotsTable td:nth-child(5) {
    width: 9% !important;
    min-width: 80px !important;
    font-weight: bold !important;
    color: var(--accent-color) !important;
}

#allSpotsTable th:nth-child(6), /* Flag */
#allSpotsTable td:nth-child(6) {
    width: 4% !important;
    min-width: 40px !important;
    text-align: center !important;
}

#allSpotsTable th:nth-child(7), /* Country */
#allSpotsTable td:nth-child(7) {
    width: 10% !important;
    min-width: 100px !important;
}

#allSpotsTable th:nth-child(8), /* CQ Zone */
#allSpotsTable td:nth-child(8) {
    width: 6% !important;
    min-width: 60px !important;
    text-align: center !important;
}

#allSpotsTable th:nth-child(9), /* Spotter */
#allSpotsTable td:nth-child(9) {
    width: 7% !important;
    min-width: 70px !important;
}

#allSpotsTable th:nth-child(10), /* Special */
#allSpotsTable td:nth-child(10) {
    width: 6% !important;
    min-width: 60px !important;
    text-align: center !important;
    font-weight: bold !important;
    color: #FFB74D !important;
    font-size: 0.8rem !important;
}

#allSpotsTable th:nth-child(11), /* Comment */
#allSpotsTable td:nth-child(11) {
    width: 28% !important;
    min-width: 180px !important;
    max-width: 250px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important;
    line-height: 1.2 !important;
    text-align: left !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    position: relative !important;
    vertical-align: top !important;
    max-height: 4.8em !important; /* Limit to ~4 lines max */
    display: table-cell !important;
}

#allSpotsTable th:nth-child(11) {
    text-align: left !important;
}

/* Additional comment column overflow protection */
#allSpotsTable td:nth-child(11) {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;
    contain: layout !important;
}

/* Ensure comment text doesn't break table layout */
#allSpotsTable td:nth-child(11) * {
    max-width: 100% !important;
    word-break: break-all !important;
}

/* Force comment content to stay within bounds */
#allSpotsTable .comment-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    line-height: 1.2 !important;
    max-height: 4.8em !important;
    hyphens: auto !important;
    white-space: normal !important;
}

/* Emergency overflow protection for table cells */
#allSpotsTable td {
    max-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Restore specific widths for non-comment columns */
#allSpotsTable td:not(:nth-child(11)) {
    white-space: nowrap !important;
}

/* Filter interface styling */
.badge-container {
    min-height: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.25rem;
}

.badge-container .badge {
    font-size: 0.75rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Filter status styling */
#filterStatus {
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Multi-select styling improvements */
.form-select[multiple] {
    min-height: 120px;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

.form-select[multiple]:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Filter button styling */
#applyFiltersBtn {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#applyFiltersBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Quick action buttons */
.btn-group .btn-sm {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
}

/* Spots limit controls */
.form-range {
    cursor: pointer;
}

.form-range:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Filter row spacing */
.row.mb-3 {
    background: rgba(255, 255, 255, 0.05);
    margin: 0 -0.5rem;
    padding: 1rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Checkbox group styling */
.checkbox-group {
    background: #495057;
    border: 1px solid #6c757d;
    border-radius: 0.375rem;
    max-height: 170px;
    overflow: hidden;
}

.checkbox-header {
    padding: 0.375rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.checkbox-header .btn-xs {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 0.25rem;
}

.checkbox-header .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.checkbox-header .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.checkbox-scroll {
    max-height: 108px;
    overflow-y: auto;
    padding: 0.5rem;
}

.checkbox-scroll::-webkit-scrollbar {
    width: 6px;
}

.checkbox-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.checkbox-scroll::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 3px;
}

.checkbox-scroll::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}

.checkbox-group .form-check {
    margin-bottom: 0.25rem;
    padding-left: 1.25rem;
}

.checkbox-group .form-check:last-child {
    margin-bottom: 0;
}

.checkbox-group .form-check-input {
    margin-top: 0.125rem;
}

.checkbox-group .form-check-label {
    font-size: 0.875rem;
    color: #f8f9fa;
    cursor: pointer;
    user-select: none;
}

.checkbox-group .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.checkbox-group .form-check-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Checkbox group layout fixes */
.checkbox-group .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.125rem 0.5rem; /* stable padding */
    margin: 0 0 0.25rem 0;    /* stable margin */
}

/* Hover effects for checkbox groups - no layout change */
.checkbox-group .form-check:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
    padding: 0.125rem 0.5rem; /* same as base */
    margin: 0 0 0.25rem 0;    /* same as base */
    transition: background 0.2s ease;
}

/* Ensure checkbox stays visible and clickable */
.checkbox-group .form-check-input {
    position: static;        /* override Bootstrap offset positioning */
    margin: 0 0.5rem 0 0;    /* simple spacing before label */
}

.checkbox-group .form-check:hover .form-check-label {
    color: #fff;
}

/* Filter label styling */
.form-label {
    font-weight: 600;
    color: #f8f9fa;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Responsive adjustments for checkbox groups */
@media (max-width: 768px) {
    .checkbox-group {
        max-height: 150px;
    }
    
    .checkbox-scroll {
        max-height: 88px;
    }
    
    .checkbox-group .form-check-label {
        font-size: 0.8rem;
    }
    
    .checkbox-header .btn-xs {
        padding: 0.1rem 0.25rem;
        font-size: 0.7rem;
    }
}

/* Clickable callsign styling */
#allSpotsTable .callsign {
    cursor: pointer !important;
    transition: color 0.2s ease !important;
}

#allSpotsTable .callsign:hover {
    color: #81C784 !important;
    text-decoration: underline !important;
}

/* Frequency formatting */
#allSpotsTable .frequency {
    font-family: 'Courier New', monospace !important;
    font-weight: 500 !important;
}

/* Band formatting */
#allSpotsTable .band {
    font-size: 0.85rem !important;
    font-weight: bold !important;
}

/* Mode formatting */
#allSpotsTable .mode {
    font-size: 0.8rem !important;
    font-weight: bold !important;
}

/* Special activity formatting */
#allSpotsTable .special {
    font-size: 0.75rem !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Time ago formatting */
#allSpotsTable .time-ago {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Flag column styling */
#allSpotsTable .flag {
    font-size: 1.2rem !important;
}

/* Comment styling for better readability */
#allSpotsTable .comment {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
    padding: 6px 4px !important;
}

/* CQ Zone tooltip enhancement */
#allSpotsTable .cq-zone[title]:hover {
    cursor: help !important;
    color: var(--accent-color) !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .dashboard .col-md-6:last-child .card {
        margin-left: 0 !important;
    }
    
    .dashboard .col-md-6:first-child .card {
        margin-right: 0 !important;
    }
    
    .table thead th {
        font-size: 0.8rem !important;
        padding: 8px 4px !important;
    }
    
    .table tbody td {
        font-size: 0.75rem !important;
        padding: 6px 4px !important;
    }
    
    .recent-spots-table {
        font-size: 0.7rem !important;
    }
    
    /* Mobile-specific all spots table adjustments */
    #allSpotsTable th,
    #allSpotsTable td {
        padding: 4px 2px !important;
        font-size: 0.7rem !important;
    }
    
    #allSpotsTable th:nth-child(11), /* Comment */
    #allSpotsTable td:nth-child(11) {
        width: 32% !important;
        min-width: 120px !important;
        max-width: 160px !important;
        word-break: break-all !important;
        overflow-wrap: anywhere !important;
        max-height: 3.6em !important;
        line-height: 1.2 !important;
    }
    
    #allSpotsTable th:nth-child(7), /* Country */
    #allSpotsTable td:nth-child(7) {
        width: 7% !important;
        min-width: 60px !important;
    }
    
    #allSpotsTable th:nth-child(2), /* Band */
    #allSpotsTable td:nth-child(2) {
        width: 5% !important;
        min-width: 35px !important;
    }
    
    #allSpotsTable th:nth-child(4), /* Mode */
    #allSpotsTable td:nth-child(4) {
        width: 5% !important;
        min-width: 35px !important;
    }
    
    #allSpotsTable th:nth-child(10), /* Special */
    #allSpotsTable td:nth-child(10) {
        width: 5% !important;
        min-width: 35px !important;
    }
}

@media (min-width: 1400px) {
    .table thead th {
        padding: 14px 12px !important;
        font-size: 1rem !important;
    }
    
    .table tbody td {
        padding: 12px 10px !important;
        font-size: 0.9rem !important;
    }
}

/* Forms */
.form-control,
.form-select {
    background: rgba(30, 60, 114, 0.8) !important;
    border: 2px solid var(--accent-color) !important;
    color: white !important;
}

.form-select option {
    background-color: #1e3c72 !important;
    color: white !important;
    padding: 8px !important;
}

.form-control::placeholder {
    color: var(--text-secondary) !important;
}

.form-control:focus,
.form-select:focus {
    background: rgba(30, 60, 114, 0.9) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25) !important;
    color: white !important;
}

/* Form Labels */
.form-label {
    color: white !important;
    font-weight: 600 !important;
}

/* Additional Text Visibility Improvements */
.content-area h1, .content-area h2, .content-area h3, 
.content-area h4, .content-area h5, .content-area h6 {
    color: white !important;
    font-weight: bold !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

.content-area p, .content-area div:not(.card), .content-area span {
    color: rgba(255, 255, 255, 0.92) !important;
}

/* Loading and Center Messages */
.loading-message, .text-center.text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500 !important;
}

/* Button Improvements */
.btn {
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* Chart and Data Visualization Text */
.chart-container * {
    color: white !important;
}

/* Ensure all text in stat cards is visible */
.stat-card * {
    color: white !important;
}

.stat-card .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Terminal and Code blocks */
.terminal-output, .code-block {
    color: #4CAF50 !important;
    font-family: 'Courier New', monospace !important;
}

/* Enhanced Terminal Styles */
.terminal-line {
    margin: 2px 0;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

.terminal-prompt {
    color: #00ff00 !important;
    font-weight: bold;
}

.terminal-command {
    color: #ffffff !important;
    font-weight: 500;
}

.terminal-response {
    color: #00ffff !important;
}

.terminal-error {
    color: #ff4444 !important;
    font-weight: bold;
}

.terminal-spot {
    color: #ffff00 !important;
    font-weight: bold;
    animation: highlight 0.5s ease-in-out;
}

.terminal-text {
    color: #00ff00 !important;
}

@keyframes highlight {
    0% { background-color: rgba(255, 255, 0, 0.3); }
    100% { background-color: transparent; }
}

#terminalOutput {
    scrollbar-width: thin;
    scrollbar-color: #00ff00 #000000;
    font-size: 14px;
    line-height: 1.4;
}

#terminalOutput::-webkit-scrollbar {
    width: 8px;
}

#terminalOutput::-webkit-scrollbar-track {
    background: #000000;
}

#terminalOutput::-webkit-scrollbar-thumb {
    background-color: #00ff00;
    border-radius: 4px;
}

#terminalInput {
    background: #000 !important;
    color: #00ff00 !important;
    border: 1px solid #00ff00 !important;
    font-family: 'Courier New', monospace !important;
}

#terminalInput:focus {
    background: #000 !important;
    color: #00ff00 !important;
    border-color: #00ff00 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 255, 0, 0.25) !important;
}

/* Any remaining text elements */
.content-area .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.sidebar .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Force all paragraph and div text to be visible */
p, div, span, label {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Override any system defaults */
* {
    text-rendering: optimizeLegibility !important;
}

/* Utility Classes */
.text-success {
    color: var(--accent-color) !important;
}

.text-danger {
    color: #f44336 !important;
}

.text-warning {
    color: #ff9800 !important;
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .content-container {
        margin-left: 0;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-nav {
        flex-direction: column;
    }
    
    .nav-item {
        margin: 2px 0;
    }
}

/* Animation for smooth transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Hover effects */
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.nav-item:hover {
    transform: translateX(5px);
    transition: all 0.3s ease;
}

/* Admin Panel Styling */
#admin .card {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#admin .table-dark {
    background: rgba(0, 0, 0, 0.8);
}

#admin .table-dark th {
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

#admin .table-dark td {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Admin form styling */
#admin .form-control {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

#admin .form-control:focus {
    background: rgba(0, 0, 0, 0.7);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(255, 215, 0, 0.25);
}

#admin .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Admin stats cards */
#admin .card-body p {
    margin-bottom: 0.5rem;
}

/* Activity keyword styling */
#admin code {
    background: rgba(255, 215, 0, 0.2);
    color: var(--accent-color);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* Loading states */
#admin .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* 🎛️ Compact Professional Filtering System Styles */
.btn-xs {
    padding: 0.1rem 0.3rem;
    font-size: 0.7rem;
    line-height: 1.2;
    border-radius: 0.2rem;
}

.form-check-sm .form-check-input {
    width: 0.8rem;
    height: 0.8rem;
    margin-top: 0.1rem;
}

.form-check-sm .form-check-label {
    font-size: 0.75rem;
    margin-bottom: 0.1rem;
}

.dropdown-menu {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-sm {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
}

/* Multi-select styling for compact UI */
#dxContinentSelect {
    background-image: none;
    overflow-y: auto;
}

#dxContinentSelect:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    border-color: #86b7fe;
}

/* Compact button group styling */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Professional dropdown styling */
.dropdown-toggle::after {
    margin-left: 0.3rem;
}

/* Improved spacing for compact design */
.gap-1 {
    gap: 0.25rem !important;
}

/* Custom styling for filter status indicators */
.text-success, .text-info, .text-warning, .text-danger {
    font-weight: 500;
}

/* Emoji and icon spacing in dropdowns */
.dropdown-menu .form-check-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}