/* 
  NAG MemberMatrix - AeroNL
  v6.5.0(a) - stable
  Jens van den Berg
  14-04-2026
*/

/* Brand Color Variables */
:root {
    --aero-dawn-orange: #FFC176;
    --aero-sky-blue: #20C2FF;
    --aero-lift-orange: #FF4400;
    --aero-deep-blue: #051A31;
    --aero-alloy-grey: #BFCCCF;
    --cloud-white: #FFFFFF;
    
    --bg-primary: #0a0a0a;
    --bg-secondary: #151515;
    --bg-tertiary: #1a1a1a;
    --bg-card: #1e1e1e;
    --text-primary: #FFFFFF;
    --text-secondary: #BFCCCF;
    --text-muted: #808080;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-glow-orange: 0 0 20px rgba(255, 68, 0, 0.3);
    --shadow-glow-blue: 0 0 20px rgba(32, 194, 255, 0.3);
}

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-secondary);
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile browsers */
    width: 100%;
}

/* Header Styles - Modern with gradient accent */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(21, 21, 21, 0.95) 0%, rgba(15, 15, 15, 0.9) 100%);
    backdrop-filter: blur(10px);
    padding: 28px 20px 15px 20px;
    height: 65px;
    position: relative;
    border-bottom: 1px solid rgba(32, 194, 255, 0.1);
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.3s ease;
    margin-top: -10px;  
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo-img {
    height: 42px;
    object-fit: contain;
    padding-top: 0px;
    padding-left: 10px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.logo-subtext {
    font-size: 10px;
    color: var(--aero-sky-blue);
    margin-top: -5px;  /* Desktop only - move version text up */
    padding-left: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Modern Search Bar */
.search-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    max-width: 450px;
    z-index: 1;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--aero-sky-blue);
    z-index: 1;
    transition: color 0.3s ease;
}

#search {
    width: 100%;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8) 0%, rgba(25, 25, 25, 0.9) 100%);
    border: 1px solid rgba(32, 194, 255, 0.2);
    border-radius: 25px;
    padding: 10px 18px 10px 40px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#search:focus {
    outline: none;
    border-color: var(--aero-sky-blue);
    box-shadow: 0 0 0 3px rgba(32, 194, 255, 0.1), var(--shadow-glow-blue);
    background: rgba(30, 30, 30, 0.95);
}

#search::placeholder {
    color: var(--text-muted);
}

#search:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upload-button {
    display: none !important;
}

/* Main Content - Enhanced Layout */
main {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
    background: transparent;
}

/* Modern Companies Pane with Gradient Border */
.companies-pane {
    width: 280px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.98) 100%);
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(32, 194, 255, 0.15);
    position: relative;
}

.companies-pane::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--aero-lift-orange);
    border-radius: 24px 24px 0 0;
}

.companies-pane h3 {
    margin-bottom: 18px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--aero-sky-blue) 0%, var(--cloud-white) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.company-list {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 10px;
}

/* Custom Scrollbar - Modern Blue Theme */
.company-list::-webkit-scrollbar {
    width: 6px;
}

.company-list::-webkit-scrollbar-track {
    background: rgba(5, 26, 49, 0.2);
    border-radius: 3px;
}

.company-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--aero-sky-blue) 0%, var(--aero-lift-orange) 100%);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.company-list::-webkit-scrollbar-thumb:hover {
    background: var(--aero-sky-blue);
}

.company-list {
    scrollbar-width: thin;
    scrollbar-color: var(--aero-sky-blue) rgba(5, 26, 49, 0.2);
}

/* Modern Company Items with Hover Effects */
.company-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(191, 204, 207, 0.1) 0%, rgba(191, 204, 207, 0.05) 100%);
    color: var(--text-primary);
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(191, 204, 207, 0.1);
    position: relative;
    overflow: hidden;
}

.company-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(32, 194, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.company-item:hover::before {
    left: 100%;
}

.company-item:hover {
    background: linear-gradient(135deg, var(--aero-lift-orange) 0%, var(--aero-dawn-orange) 100%);
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow-orange);
    border-color: var(--aero-lift-orange);
}

.hamburger-icon {
    margin-left: 10px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.company-item:hover .hamburger-icon {
    color: var(--bg-primary);
}

.hamburger-icon:hover {
    transform: scale(1.2);
}

/* Graph Pane - Enhanced with Border Glow */
.graph-pane {
    flex-grow: 1;
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.7) 0%, rgba(35, 35, 35, 0.8) 100%);
    padding: 20px;
    position: relative;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(32, 194, 255, 0.15);
    overflow: hidden;
}

.graph-pane::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--aero-lift-orange);
    border-radius: 24px 24px 0 0;
}

#network-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

/* Map Background - Enhanced Visibility */
#map-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    display: block;
}

#map-background-image img {
    position: absolute;
    opacity: 0.55;
    transform-origin: center center;
    user-select: none;
    filter: brightness(1.1) contrast(1.3) saturate(1.2);
}

.vis-network {
    position: relative !important;
    z-index: 2 !important;
}

/* Geographic Mode Indicator - Modern Badge */
#network-container.geographic-mode::after {
    content: "📍 Geographic Mode";
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--aero-lift-orange) 0%, var(--aero-dawn-orange) 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.5px;
}

/* Empty States - Modern Typography */
.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    opacity: 0.8;
}

.empty-state p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

.empty-state-graph {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    text-align: center;
    opacity: 0.7;
}

.empty-state-graph i {
    margin-bottom: 20px;
    font-size: 48px;
    color: var(--aero-sky-blue);
    opacity: 0.6;
}

/* Footer - Modern Toggle Design */
footer {
    background: linear-gradient(180deg, rgba(15, 15, 15, 0.9) 0%, rgba(10, 10, 10, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 18px 20px 28px 20px;
    display: flex;
    justify-content: center;
    position: relative;
    border-top: 1px solid rgba(32, 194, 255, 0.1);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

/* LIT Projects Toggle - Enhanced */
.lit-projects-toggle {
    display: none;
    position: absolute;
    right: calc(100% + 25px);
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.98) 100%);
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--aero-sky-blue);
    animation: slideInFromLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lit-projects-toggle.visible {
    display: flex;
    align-items: center;
}

.lit-projects-toggle .toggle-label {
    color: var(--aero-sky-blue);
    font-weight: 600;
    letter-spacing: 0.5px;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Modern Visualization Toggles */
.visualization-toggles {
    display: flex;
    gap: 24px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.98) 100%);
    padding: 12px 28px;
    border-radius: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(32, 194, 255, 0.2);
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Modern Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(191, 204, 207, 0.3);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 2px;
    background: linear-gradient(135deg, var(--cloud-white) 0%, var(--aero-alloy-grey) 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--aero-lift-orange) 0%, var(--aero-dawn-orange) 100%);
    border-color: var(--aero-lift-orange);
    box-shadow: var(--shadow-glow-orange);
}

input:checked + .slider:before {
    transform: translateX(24px);
    background: var(--cloud-white);
    box-shadow: 0 2px 8px rgba(255, 68, 0, 0.4);
}

input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.slider.round {
    border-radius: 28px;
}

.slider.round:before {
    border-radius: 50%;
}

.toggle-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.3px;
}

/* Loading Indicator - Modern Spinner */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.92) 0%, rgba(15, 15, 15, 0.95) 100%);
    backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.loading-indicator.active {
    display: flex;
    opacity: 1;
    pointer-events: all;
}

.spinner {
    border: 4px solid rgba(32, 194, 255, 0.2);
    border-radius: 50%;
    border-top: 4px solid var(--aero-sky-blue);
    border-right: 4px solid var(--aero-lift-orange);
    width: 48px;
    height: 48px;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin-bottom: 20px;
    box-shadow: var(--shadow-glow-blue);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

footer.processing {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* Modal Styles - Modern Dark Theme */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    overflow: auto;
}

.modal-content {
    background: linear-gradient(135deg, rgba(25, 25, 25, 0.98) 0%, rgba(15, 15, 15, 0.98) 100%);
    margin: 8% auto;
    padding: 30px;
    border: 1px solid rgba(32, 194, 255, 0.3);
    width: 85%;
    max-width: 900px;
    border-radius: 24px;
    position: relative;
    color: var(--text-secondary);
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--aero-lift-orange);
    border-radius: 24px 24px 0 0;
}

.close-button {
    color: transparent; /* Hide the text character */
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 0; /* Hide any text content */
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* First line of the X */
.close-button::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: var(--text-muted);
    transform: rotate(45deg);
    transition: all 0.3s ease;
}

/* Second line of the X */
.close-button::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: var(--text-muted);
    transform: rotate(-45deg);
    transition: all 0.3s ease;
}

.close-button:hover {
    background: rgba(255, 68, 0, 0.1);
}

.close-button:hover::before {
    background-color: var(--aero-lift-orange);
    transform: rotate(135deg);
}

.close-button:hover::after {
    background-color: var(--aero-lift-orange);
    transform: rotate(45deg);
}

#modal-company-name {
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--aero-lift-orange);
    border-bottom: 2px solid rgba(32, 194, 255, 0.2);
    padding-bottom: 18px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

/* Modal Map - Enhanced Modern Design */
.modal-map {
    position: absolute;
    top: 70px;
    right: 20px;
    cursor: move;
    user-select: none;
    z-index: 1000;
    border: 2px solid rgba(32, 194, 255, 0.4);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    width: 220px;
    height: auto;
    box-shadow: var(--shadow-md), var(--shadow-glow-blue);
    transition: border-color 0.3s ease;
}

.modal-map:hover {
    border-color: var(--aero-sky-blue);
}

.modal-map.dragging {
    cursor: grabbing;
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
}

.modal-map .map-header {
    background: linear-gradient(135deg, rgba(32, 194, 255, 0.2) 0%, rgba(255, 68, 0, 0.2) 100%);
    padding: 10px 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid var(--aero-sky-blue);
    cursor: move;
    margin-bottom: 0;
    letter-spacing: 0.3px;
}

.modal-map iframe {
    border: none;
    display: block;
    pointer-events: auto;
    border-radius: 0 0 12px 12px;
}

.modal-map .map-placeholder {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(5, 26, 49, 0.3) 0%, rgba(30, 30, 30, 0.5) 100%);
    color: var(--text-muted);
    font-size: 12px;
}

.modal-map .resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 18px;
    height: 18px;
    cursor: nw-resize;
    background: linear-gradient(135deg, rgba(32, 194, 255, 0.3) 0%, rgba(255, 68, 0, 0.3) 100%);
    border-top-right-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    border: 1px solid rgba(32, 194, 255, 0.5);
    transition: all 0.3s ease;
}

.modal-map .resize-handle:hover {
    background: linear-gradient(135deg, var(--aero-sky-blue) 0%, var(--aero-lift-orange) 100%);
    box-shadow: var(--shadow-glow-blue);
}

.modal-map .resize-handle .diagonal-lines {
    width: 10px;
    height: 10px;
    background-image: 
        linear-gradient(-45deg, transparent 40%, var(--cloud-white) 40%, var(--cloud-white) 45%, transparent 45%),
        linear-gradient(-45deg, transparent 65%, var(--cloud-white) 65%, var(--cloud-white) 70%, transparent 70%);
    background-size: 6px 6px;
    background-position: 0 0, 2px 2px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.modal-map .resize-handle:hover .diagonal-lines {
    opacity: 1;
}

/* Description Section - Modern Card Design */
.modal-description {
    margin-bottom: 24px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(255, 68, 0, 0.08) 0%, rgba(255, 193, 118, 0.05) 100%);
    border-left: 4px solid var(--aero-lift-orange);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.modal-description p:first-child {
    margin-bottom: 12px;
    color: var(--aero-lift-orange);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.modal-description p:last-child {
    margin-bottom: 0;
    line-height: 1.6;
    color: var(--text-primary);
}

/* URL Section - Modern Card Design */
.modal-url {
    margin-bottom: 24px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(32, 194, 255, 0.08) 0%, rgba(191, 204, 207, 0.05) 100%);
    border-left: 4px solid var(--aero-sky-blue);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.modal-url p:first-child {
    margin-bottom: 12px;
    color: var(--aero-sky-blue);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.modal-url p:last-child {
    margin-bottom: 0;
}

.modal-url a {
    color: var(--aero-sky-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.modal-url a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, var(--aero-sky-blue) 0%, var(--aero-lift-orange) 100%);
    transition: width 0.3s ease;
}

.modal-url a:hover {
    color: var(--aero-lift-orange);
}

.modal-url a:hover::after {
    width: 100%;
}

/* Separator - Gradient Line */
.modal-separator {
    height: 2px;
    background: linear-gradient(to right, transparent, var(--aero-sky-blue), var(--aero-lift-orange), transparent);
    margin: 28px 0;
    opacity: 0.3;
}

/* Regular Data Container */
#modal-data-container {
    font-size: 14px;
    line-height: 1.8;
    flex-grow: 1;
    overflow-y: auto;
    margin-top: 20px;
    padding-right: 10px;
}

/* Custom scrollbar for modal content */
#modal-data-container::-webkit-scrollbar {
    width: 6px;
}

#modal-data-container::-webkit-scrollbar-track {
    background: rgba(5, 26, 49, 0.2);
    border-radius: 3px;
}

#modal-data-container::-webkit-scrollbar-thumb {
    background: var(--aero-sky-blue);
    border-radius: 3px;
}

#modal-data-container p {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(191, 204, 207, 0.03);
    border-radius: 6px;
    border-bottom: 1px solid rgba(32, 194, 255, 0.1);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

#modal-data-container p:hover {
    background: rgba(32, 194, 255, 0.05);
    border-left: 2px solid var(--aero-sky-blue);
    padding-left: 14px;
}

#modal-data-container p:last-child {
    border-bottom: none;
}

/* Filtered State - Modern Indicator */
#network-container.filtered {
    border: 2px solid var(--aero-lift-orange);
    border-radius: 20px;
    box-shadow: var(--shadow-glow-orange);
}

#network-container.filtered::before {
    content: "🔍 Filtered";
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--aero-lift-orange) 0%, var(--aero-dawn-orange) 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.5px;
}

/* NTS-KET Overlay - Enhanced */
#nts-ket-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(5, 26, 49, 0.85) 0%, rgba(10, 10, 10, 0.9) 100%);
    backdrop-filter: blur(5px);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-align: center;
    padding: 2rem;
    z-index: 1000;
    font-weight: 500;
}

/* Header Buttons - Modern Design */
.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-btn {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(25, 25, 25, 0.95) 100%);
    border: 1px solid rgba(32, 194, 255, 0.3);
    color: var(--text-secondary);
    padding: 9px 16px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.header-btn:hover {
    background: linear-gradient(135deg, var(--aero-lift-orange) 0%, var(--aero-dawn-orange) 100%);
    color: var(--cloud-white);
    border-color: var(--aero-lift-orange);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-orange);
}

.header-btn:active {
    transform: translateY(0);
}

.info-btn {
    width: 38px;
    padding: 9px;
}

.info-btn i {
    font-size: 16px;
}

.about-btn,
.feedback-btn {
    padding: 9px 18px;
}

/* Developer Credit - Subtle */
.developer-credit {
    position: fixed;
    bottom: 12px;
    right: 12px;
    font-size: 7px;
    color: rgba(191, 204, 207, 0.4);
    z-index: 9998;
    user-select: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.developer-credit:hover {
    color: var(--aero-sky-blue);
    font-size: 8px;
}

/* Flying Airplane Animation */
.flying-airplane {
    position: fixed;
    bottom: 12px;
    right: 12px;
    font-size: 16px;
    color: var(--aero-lift-orange);
    z-index: 9999;
    pointer-events: none;
    filter: drop-shadow(2px 4px 6px rgba(255, 68, 0, 0.4));
}

@keyframes airplane-straight-flight {
    0% {
        right: 12px;
        opacity: 1;
    }
    100% {
        right: 100vw;
        opacity: 0.7;
    }
}

.flying-airplane.animate {
    animation: airplane-straight-flight 12s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Mobile Message Screen - Hidden, no longer used */
.mobile-message {
    display: none !important;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .header-buttons {
        gap: 6px;
    }
    
    .header-btn {
        font-size: 13px;
        padding: 7px 12px;
        min-height: 34px;
    }
    
    .info-btn {
        width: 34px;
        padding: 7px;
    }
    
    .search-container {
        width: 45%;
    }
    
    .companies-pane {
        width: 240px;
    }
}

/* Mobile Layout - Simplified Version */
@media (max-width: 768px) {
    /* MOBILE FIX: Ensure proper height using safe area insets */
    body {
        overflow-x: hidden;
    }
    
    .container {
        height: 100vh;
        height: 100dvh;
    }
    
    /* MOBILE VIEW TOGGLE BUTTON - Next to search bar */
    .mobile-view-toggle {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(25, 25, 25, 0.95) 100%);
        border: 1px solid rgba(32, 194, 255, 0.3);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-view-toggle:active {
        transform: scale(0.95);
        background: linear-gradient(135deg, var(--aero-lift-orange) 0%, var(--aero-dawn-orange) 100%);
    }
    
    .mobile-view-toggle i {
        color: var(--aero-sky-blue);
        font-size: 18px;
        transition: all 0.3s ease;
    }
    
    .mobile-view-toggle:active i {
        color: white;
    }
    
    /* Header: Logo + Version on left, Info button on right */
    header {
        padding: 12px 15px;
        height: auto;
        flex-wrap: wrap;
        flex-shrink: 0;
    }
    
    .logo {
        flex: 1;
        margin-top: 0;  /* Reset desktop adjustment for mobile */
    }
    
    .logo-img {
        height: 32px;
        padding-left: 0;
    }
    
    .logo-subtext {
        font-size: 9px;
        padding-left: 5px;
        margin-top: 0;  /* Reset desktop adjustment for mobile */
    }
    
    /* Hide About and Feedback buttons on mobile */
    .about-btn,
    .feedback-btn {
        display: none;
    }
    
    /* Keep only Info button */
    .header-buttons {
        gap: 0;
    }
    
    .info-btn {
        width: 36px;
        min-height: 36px;
        padding: 8px;
    }
    
    /* Full-width search bar on second row */
    .search-container {
        position: relative;
        left: auto;
        transform: none;
        width: 100%;
        max-width: none;
        order: 3;
        margin-top: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .search-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
    }
    
    #search {
        border-radius: 18px;
        padding: 8px 12px 8px 36px;
        flex: 1;
        width: auto;
    }
    
    /* Companies pane - hidden by default, shown when toggled */
    .companies-pane {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        border-radius: 0;
        margin: 0;
    }
    
    .companies-pane.mobile-visible {
        display: flex;
    }
    
    /* Full-width graph pane */
    main {
        padding: 12px;
        gap: 0;
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        position: relative;
    }
    
    /* Hide graph when list is visible */
    main.list-view-active .graph-pane {
        display: none;
    }
    
    .graph-pane {
        width: 100%;
        border-radius: 16px;
        padding: 12px;
        height: 100%;
        min-height: 0;
    }
    
    /* MOBILE FIX: Footer should be visible and at bottom */
    footer {
        padding: 12px 15px;
        flex-shrink: 0;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    
    .visualization-toggles {
        flex-direction: row;
        justify-content: space-around;
        gap: 8px;
        padding: 10px 12px;
        width: 100%;
    }
    
    .toggle-item {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
    
    /* Hide NTS-KET toggle on mobile */
    #toggle-nts-ket {
        display: none;
    }
    
    .toggle-item:has(#toggle-nts-ket) {
        display: none;
    }
    
    .toggle-label {
        font-size: 11px;
        text-align: center;
        white-space: nowrap;
    }
    
    /* Smaller toggle switches for mobile */
    .switch {
        width: 44px;
        height: 24px;
    }
    
    .slider:before {
        height: 18px;
        width: 18px;
        left: 2px;
        bottom: 1px;
    }
    
    input:checked + .slider:before {
        transform: translateX(20px);
    }
    
    /* MOBILE FIX: Modal adjustments with proper ordering */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
        max-height: 85vh;
    }
    
    /* MOBILE FIX: Make description and URL full width on mobile */
    .modal-description,
    .modal-url {
        max-width: 100% !important;
    }
    
    /* MOBILE FIX: Make modal-data-container use flexbox for ordering */
    #modal-data-container {
        display: flex;
        flex-direction: column;
    }
    
    /* MOBILE FIX: Order the info paragraphs to come last */
    #modal-data-container > p {
        order: 10;
    }
    
    /* MOBILE FIX: Modal map should be inline, not floating, with proper height */
    .modal-map {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        min-height: 220px !important;
        margin-top: 0 !important;
        margin-bottom: 18px;
        order: 3;
    }
    
    /* MOBILE FIX: Make map iframe taller on mobile */
    .modal-map iframe {
        width: 100% !important;
        height: 200px !important;
        display: block !important;
    }
    
    .modal-map .map-placeholder {
        height: 200px !important;
        width: 100% !important;
    }
    
    .modal-map .map-header {
        display: block !important;
        width: 100% !important;
    }
    
    /* MOBILE FIX: Disable dragging/resizing on mobile */
    .modal-map .map-header {
        cursor: default !important;
    }
    
    .modal-map .resize-handle {
        display: none !important;
    }
    
    /* MOBILE FIX: Proper modal section ordering */
    .modal-description {
        order: 1;
    }
    
    .modal-url {
        order: 2;
    }
    
    .modal-separator {
        order: 4;
    }
    
    #modal-company-name {
        font-size: 22px;
    }
    
    /* Hide LiT projects toggle on mobile */
    .lit-projects-toggle {
        display: none !important;
    }
    
    /* Also hide the LiT projects toggle row inside network legend on mobile */
    #network-legend div:has(#toggle-lit-projects) {
        display: none !important;
    }
    
    /* MOBILE FIX: Hide developer credit on mobile */
    .developer-credit {
        display: none !important;
    }
    
    /* Legends: Stack vertically on mobile, smaller text */
    #network-legend,
    #sector-legend,
    #nts-legend {
        font-size: 10px;
        padding: 8px;
        min-width: 140px;
        max-width: 200px;
    }
    
    /* Hide ONLY the interactive toggle switches in legends on mobile */
    #network-legend input[type="checkbox"],
    #network-legend .slider,
    #network-legend button,
    #sector-legend input[type="checkbox"],
    #sector-legend .slider,
    #sector-legend button,
    #nts-legend input[type="checkbox"],
    #nts-legend .slider,
    #nts-legend button {
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    #project-codes-legend {
        font-size: 9px;
        padding: 8px;
        max-width: 90%;
    }
    
    /* MOBILE FIX: Info modal should stack vertically */
    .info-modal .modal-content {
        max-width: 95%;
        margin: 2% auto;
    }
    
    .info-columns {
        flex-direction: column !important;
    }
    
    .info-video-column {
        border-right: none !important;
        border-bottom: 1px solid #444;
        padding: 20px !important;
        flex: none !important;
    }
    
    .info-text-column {
        padding: 20px !important;
    }
    
    .video-container iframe {
        height: 200px !important;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .logo-img {
        height: 28px;
    }
    
    .logo-subtext {
        font-size: 8px;
    }
    
    .info-btn {
        width: 32px;
        min-height: 32px;
    }
    
    .toggle-label {
        font-size: 10px;
    }
    
    .visualization-toggles {
        gap: 4px;
        padding: 8px;
    }
}

/* High z-index for modal */
#company-data-modal {
    z-index: 2000 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🔄 RESET BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

/* Reset Button - Top Left of Network Container */
#reset-button {
    position: absolute;  /* Positioned relative to .graph-pane */
    top: 20px;  /* Increased from 10px */
    left: 20px;  /* Increased from 10px */
    z-index: 1000;
    background: #3a3a3a;  /* Solid dark grey - blends with background */
    color: rgba(255, 255, 255, 0.8);  /* Slightly transparent text */
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);  /* Subtle shadow */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.85;  /* Slightly transparent to blend in */
}

#reset-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    background: #4a4a4a;  /* Slightly lighter on hover */
    opacity: 1;
    color: white;
}

#reset-button:active {
    transform: translateY(0);
}

#reset-button i {
    font-size: 16px;
}

#reset-button span {
    font-weight: 600;
}

/* Mobile adjustments for reset button */
@media (max-width: 768px) {
    #reset-button {
        padding: 8px 12px;
        font-size: 12px;
        top: 15px;  /* Increased from 8px */
        left: 15px;  /* Increased from 8px */
    }
    
    #reset-button i {
        font-size: 14px;
    }
    
    #reset-button span {
        display: none;  /* Hide text on mobile, show only icon */
    }
}