/* TravelTracks.org v2.0.251127 - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-content h1 {
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#username-display {
    font-weight: 500;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-container h2 {
    margin-bottom: 1.5rem;
    color: #667eea;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Navigation Tabs */
.tab-navigation {
    background: white;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* Parent Tab Styling */
.parent-tab {
    cursor: pointer;
}

.parent-tab.active-category {
    background-color: #f0f0f0;
    border-bottom: 3px solid #667eea;
}

/* Sub-Tab Navigation */
.sub-tab-navigation {
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.4rem 1.5rem;
}

.subtab-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-height: 36px;
}

.subtab-left {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
    min-height: 28px;
}

.sub-tab-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.sub-tab-btn:hover {
    background-color: #f0f0f0;
    border-color: #667eea;
}

.sub-tab-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
}

.tab-header h2 {
    color: #333;
    font-size: 1.3rem;
    margin: 0;
}

.tab-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Tables */
.data-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.3rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    user-select: none;
}

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

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr.expanded {
    background: #e3f2fd;
}

.data-table tbody tr.segment-row {
    background: #fafafa;
}

/* Segment type background shading */
.data-table tbody tr.segment-air {
    background: #f8f9fa; /* Very light gray-white for air */
}

.data-table tbody tr.segment-sea {
    background: #e3f2fd; /* Very light blue for sea */
}

.data-table tbody tr.segment-land {
    background: #faf3e0; /* Very light brown/tan for land */
}

.data-table tbody tr.segment-row td {
    padding: 0.3rem 0.5rem !important; /* Compact padding, override default */
    font-size: 0.95em; /* Slightly smaller text */
}

/* Data Management */
.data-management-container {
    padding: 1rem;
}

.data-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ddd;
}

.data-management-header h3 {
    margin: 0;
    color: #333;
}

.data-management-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 250px;
}

.data-stats {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.data-table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.pagination-info {
    margin-top: 1rem;
    padding: 0.5rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    text-align: center;
}

/* Icons */
.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.icon-airplane::before {
    content: "✈️";
}

.icon-ship::before {
    content: "🚢";
}

.icon-expand::before {
    content: "▶";
}

.icon-collapse::before {
    content: "▼";
}

.icon-edit::before {
    content: "✏️";
}

.icon-visualize::before {
    content: "📊";
}

.icon-favorite::before {
    content: "⭐";
}

.icon-favorite-empty::before {
    content: "☆";
}

.icon-check::before {
    content: "✓";
    color: #28a745;
}

/* Visualization Controls (legacy - kept for compatibility) */
.visualization-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.visualization-controls select,
.visualization-controls input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#visualization-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    min-height: 500px;
}

/* Data Section */
.data-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.data-section h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.data-section select,
.data-section input {
    margin-right: 1rem;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Profile Container */
#profile-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
}

.profile-section {
    margin-bottom: 2rem;
}

.profile-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #667eea;
}

/* Documentation */
#docs-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
}

#docs-container h3 {
    color: #667eea;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

#docs-container p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

#docs-container code {
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.admin-only {
    display: none;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .tab-navigation {
        padding: 0 1rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .data-table {
        overflow-x: auto;
    }
}



/* Filter Indicator */
.filter-indicator {
    background: #e3f2fd;
    border: 1px solid #667eea;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-indicator span {
    color: #667eea;
    font-weight: 500;
    font-size: 14px;
}

.filter-indicator .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}



/* Display Mode Selector */
.display-mode-selector {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* When inside subtab-group, make it more compact */
.subtab-group .display-mode-selector {
    margin-bottom: 0;
    padding: 4px;
}

.mode-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* When inside subtab-group, make it even more compact */
.subtab-group .mode-btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Maps unified controls - single compact row */
.maps-unified-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.control-divider {
    width: 1px;
    height: 30px;
    background: #ddd;
    margin: 0 0.25rem;
}

/* Segment type filters */
.segment-type-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.segment-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    user-select: none;
    white-space: nowrap;
}

.segment-filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.segment-filter-checkbox .filter-icon {
    font-size: 16px;
    line-height: 1;
}

.segment-filter-checkbox:hover {
    color: #667eea;
}

/* Date filters */
.date-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.date-filters input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
}

.mode-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f0f4ff;
}

.mode-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.mode-btn:active {
    transform: scale(0.98);
}

/* Favorite Button in Tables */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    transition: transform 0.1s ease;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.btn-icon:active {
    transform: scale(0.9);
}




/* Tooltip Styles */
.info-tooltip {
    position: absolute;
    z-index: 10000;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 0;
    max-width: 300px;
    font-size: 13px;
    pointer-events: none;
}

.tooltip-header {
    background: #f5f5f5;
    padding: 8px 12px;
    font-weight: bold;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 4px 4px 0 0;
}

.tooltip-body {
    padding: 8px 12px;
}

.tooltip-row {
    padding: 3px 0;
    line-height: 1.4;
}

.tooltip-row strong {
    display: inline-block;
    width: 90px;
    color: #666;
}

.tooltip-loading,
.tooltip-error {
    padding: 8px 12px;
    color: #666;
    font-style: italic;
}

.tooltip-error {
    color: #d32f2f;
}

/* Tooltip sections */
.tooltip-section {
    margin-bottom: 12px;
}

.tooltip-section:last-child {
    margin-bottom: 0;
}

.tooltip-section-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tooltip-list {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
}

.tooltip-list li {
    padding: 3px 0;
    line-height: 1.4;
    color: #444;
}

.tooltip-list li:before {
    content: "• ";
    color: #999;
    margin-right: 4px;
}

.tooltip-actions {
    border-top: 1px solid #e0e0e0;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 0 0 4px 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tooltip-btn {
    padding: 6px 10px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    text-align: left;
}

.tooltip-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

/* Hoverable elements */
.hoverable-code {
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: #999;
}

.hoverable-code:hover {
    text-decoration-color: #333;
    color: #0066cc;
}




/* ============================================================================
   Admin Panel Styles
   ============================================================================ */

.admin-panel {
    padding: 20px;
}

.stats-section,
.api-keys-section {
    margin-bottom: 20px;
}

.stats-section h4 {
    margin: 8px 0;
    font-size: 16px;
    color: #495057;
}

.stats-table-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.stats-row-label {
    width: 150px;
    min-width: 150px;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    padding-right: 20px;
}

.stats-row-data {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.stat-card-tooltip {
    position: relative;
    cursor: help;
}

.stat-card-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 10px 14px;
    background-color: #2c3e50;
    color: white;
    font-size: 12px;
    white-space: pre-line;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
    max-width: 250px;
    text-align: left;
    line-height: 1.6;
}

.stat-card-tooltip:hover::after {
    opacity: 1;
}

/* Clickable stat card */
.stat-card-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-card-clickable:hover {
    background: #e3f2fd;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.2);
}

/* User list popup */
.user-list-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.user-list-popup-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.user-list-popup-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-list-popup-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.user-list-popup-header .close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.2s;
}

.user-list-popup-header .close-btn:hover {
    color: #333;
}

.user-list-popup-body {
    padding: 1rem;
    overflow-y: auto;
}

.user-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-list-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.user-list-item:hover {
    background: #f8f9fa;
    color: #007bff;
}

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

/* Selected user row */
.stats-selected-user-row {
    background: #e3f2fd;
    border: 2px solid #007bff;
    border-radius: 6px;
    padding: 8px;
    margin: 8px 0;
}

.stats-selected-user-row .stats-row-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #007bff;
}

.btn-clear-user {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.btn-clear-user:hover {
    background: #c82333;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.stat-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 6px;
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 10px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.api-keys-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.api-keys-table th,
.api-keys-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.api-keys-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.api-keys-table tbody tr:hover {
    background: #f8f9fa;
}

.api-keys-table code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.api-keys-table .permissions {
    font-size: 12px;
    color: #6c757d;
}

.api-keys-table .status-active {
    color: #28a745;
    font-weight: 600;
}

.api-keys-table .status-inactive {
    color: #dc3545;
    font-weight: 600;
}

.api-keys-table .actions {
    white-space: nowrap;
}

.btn-small {
    padding: 4px 8px;
    font-size: 14px;
    border: none;
    background: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 4px;
}

.btn-small:hover {
    background: #0056b3;
}

.btn-small.btn-info {
    background: #17a2b8;
}

.btn-small.btn-info:hover {
    background: #117a8b;
}

.btn-small.btn-danger {
    background: #dc3545;
}

.btn-small.btn-danger:hover {
    background: #c82333;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.warning-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 20px;
}

.key-display {
    margin: 20px 0;
}

.key-value {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.key-value code {
    flex: 1;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
}

.key-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.key-info p {
    margin: 8px 0;
}

.usage-example {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.usage-example h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.usage-example pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 13px;
}

.key-details p {
    margin: 12px 0;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.key-details p:last-child {
    border-bottom: none;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.btn-cancel {
    padding: 0.75rem 1.5rem;
    border: 1px solid #6c757d;
    background: white;
    color: #6c757d;
    border-radius: 4px;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #f8f9fa;
}




/* ============================================================================
   Favorites Tab Styles
   ============================================================================ */

.favorites-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.favorites-tab-btn {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.favorites-tab-btn:hover {
    background-color: #e0e0e0;
}

.favorites-tab-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.favorites-tab-content {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 5px;
    min-height: 300px;
    border: 1px solid #e0e0e0;
}

.favorites-tab-content h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.favorites-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.favorites-list li {
    padding: 12px;
    margin-bottom: 8px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.favorites-list li:hover {
    background-color: #f0f8ff;
    border-color: #667eea;
    transform: translateX(5px);
}

.favorites-tab-content .text-muted {
    color: #495057;
    font-style: italic;
    padding: 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}



/* Trip Totals Management */
.override-indicator {
    color: #ff9800;
    font-size: 0.9em;
    cursor: help;
}

.segment-details-row {
    background-color: #f9f9f9;
    font-size: 0.9em;
}

.segment-details {
    padding: 8px 12px;
    color: #666;
}

.detail-item {
    display: inline-block;
    margin-right: 15px;
    padding: 2px 8px;
    background-color: #e8f4f8;
    border-radius: 3px;
}

.detail-item strong {
    color: #333;
    margin-right: 4px;
}



/* Properties Modal */
.properties-modal {
    max-width: 600px;
    width: 90%;
}

.properties-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

.properties-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.property-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #4CAF50;
}

.property-label {
    font-weight: 600;
    color: #555;
    min-width: 150px;
}

.property-value {
    color: #333;
    text-align: right;
    flex: 1;
}

.property-value a {
    color: #4CAF50;
    text-decoration: none;
}

.property-value a:hover {
    text-decoration: underline;
}



/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin: 15px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

/* Compact pagination for sub-tab area */
.subtab-left .pagination-controls {
    padding: 0;
    margin: 0;
    border: none;
    gap: 1rem;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.subtab-left .pagination-info {
    font-size: 12px;
}

.pagination-buttons {
    display: flex;
    gap: 5px;
}

.pagination-buttons button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
}

.subtab-left .pagination-buttons button {
    padding: 4px 8px;
    font-size: 12px;
}

.pagination-buttons button:hover:not(:disabled) {
    background: #f0f0f0;
}

.pagination-buttons button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-buttons span {
    padding: 5px;
    color: #999;
}

.pagination-size {
    font-size: 14px;
}

.pagination-size select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-left: 5px;
}

.subtab-left .pagination-size {
    font-size: 12px;
}

.subtab-left .pagination-size select {
    padding: 3px 5px;
    font-size: 12px;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    background-color: #f0f0f0;
}



/* Toggle Switch for Trip Assignment */
.trip-assignment-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.trip-assignment-toggle .toggle-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    transition: color 0.3s ease;
}

.trip-assignment-toggle .toggle-label:first-child {
    color: #667eea;
    font-weight: 600;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch .toggle-track {
    position: relative;
    width: 200px;
    height: 40px;
    background: linear-gradient(to right, #667eea 0%, #667eea 50%, #28a745 50%, #28a745 100%);
    border-radius: 25px;
    transition: all 0.4s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    height: 34px;
    width: 97px;
    background-color: white;
    border-radius: 22px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: #667eea;
}

.toggle-slider:before {
    content: "New Trip";
}

.toggle-switch input:checked + .toggle-slider {
    transform: translateX(100px);
    color: #28a745;
}

.toggle-switch input:checked + .toggle-slider:before {
    content: "Existing";
}

.toggle-switch input:checked ~ .toggle-label:last-child {
    color: #28a745;
    font-weight: 600;
}

.toggle-switch input:not(:checked) ~ .toggle-label:first-child {
    color: #667eea;
    font-weight: 600;
}

/* Marine Ports Filter Section */
.filter-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #495057;
}

.filter-section select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 150px;
}

.filter-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.stats-row span {
    color: #495057;
    font-size: 14px;
}

.stats-row strong {
    color: #0066cc;
    font-size: 16px;
}

/* Search Box in Tab Header */
.tab-header .search-box {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.tab-header .search-box input {
    flex: 1;
    max-width: 500px;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.tab-header .search-box input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}


/* Map View Selector */
.map-view-selector {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.map-view-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.map-view-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
    background: #f0f4ff;
}

.map-view-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.map-view-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.map-view-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
}

/* Map container needs to support both SVG and Canvas layers */
#visualization-container,
#favorites-map-container {
    position: relative;
}

#visualization-container canvas,
#favorites-map-container canvas {
    position: absolute;
    top: 0;
    left: 0;
}

#visualization-container svg,
#favorites-map-container svg {
    position: absolute;
    top: 0;
    left: 0;
}

/* Flight Statistics Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left-color: #764ba2;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #667eea;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-sublabel {
    font-size: 0.75em;
    color: #999;
    margin-top: 3px;
}

.longest-flight-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 10px;
}

.longest-flight-card .route {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c5f8d;
}

.longest-flight-card .airport {
    color: #1e3a5f;
}

.longest-flight-card .arrow {
    color: #667eea;
    margin: 0 10px;
}

.longest-flight-card .duration {
    font-size: 1.2em;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 8px;
}

.longest-flight-card .carrier {
    color: #666;
    margin-bottom: 5px;
}

.longest-flight-card .date {
    color: #999;
    font-size: 0.9em;
}
