/* 
  NAG MemberMatrix
  v6.2.3 Beta
  Jens van den Berg
  28-07-2025
*/

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #424242;
    color: #bebebe;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #424242;
    padding: 28px 15px 15px 15px; /* Increased top padding from 15px to 20px */
    height: 60px; /* Increased from 60px to accommodate extra padding */
    position: relative; /* For absolute positioning of search */
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-img {
    height: 40px;
    object-fit: contain;
    padding-top: 5px;
    padding-left: 10px;
}

.logo-subtext {
    font-size: 10px;
    color: #bebebe;
    margin-top: 0px;
    padding-left: 15px;
}

.search-container {
    position: absolute;
    left: 50%;
    transform: translateX(-20%);
    width: 40%;
    max-width: 400px;
    z-index: 1; /* Ensure it stays above other elements */
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bebebe;
    z-index: 1;
}

#search {
    width: 100%;
    background-color: #2a2a2a;
    border: none;
    border-radius: 20px;
    padding: 8px 15px 8px 35px; /* Added left padding for icon */
    color: #fe5200;
}

#search::placeholder {
    color: #bebebe;
}

#search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.upload-button {
    display: none !important;
    width: 40px;
    height: 40px;
}

.upload-button label {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: #2a2a2a;
    border-radius: 50%;
    cursor: pointer;
}

.upload-button i {
    color: #bebebe;
    font-size: 18px;
}

/* Main Content Styles */
main {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    padding: 15px;
    gap: 15px; /* Space between panes */
}

.companies-pane {
    width: 250px;
    background-color: #1e1e1e;
    padding: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 20px; /* More rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.companies-pane h3 {
    margin-bottom: 15px;
    color: #bebebe;
}

.company-list {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 10px; /* Add space for scrollbar */
}

/* Custom Scrollbar Styles */
.company-list::-webkit-scrollbar {
    width: 8px;
}

.company-list::-webkit-scrollbar-track {
    background: transparent; /* Invisible track */
    margin-right: 5px; /* Move scrollbar to the right */
}

.company-list::-webkit-scrollbar-thumb {
    background-color: rgba(190, 190, 190, 0.3); /* Semi-transparent thumb */
    border-radius: 4px;
    border: 1px solid transparent;
    background-clip: padding-box;
}

.company-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(254, 82, 0, 0.5); /* Highlight on hover */
}

/* For Firefox */
.company-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(190, 190, 190, 0.3) transparent;
}

.company-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #bebebe;
    color: #2a2a2a;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.company-item:hover {
    background-color: #fe5200;
    color: #fff;
}

.hamburger-icon {
    margin-left: 10px;
    color: #616161;
    cursor: pointer;
    font-size: 14px;
}

.hamburger-icon:hover {
    color: #bebebe;
}

.graph-pane {
    flex-grow: 1;
    background-color: #1e1e1e;
    padding: 15px;
    position: relative;
    border-radius: 20px; /* More rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#network-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Map background container */
#map-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through to network */
    z-index: 1; /* Behind the network */
    overflow: hidden;
    display: block; /* Hidden by default */
}

#map-background-image img {
    position: absolute;
    opacity: 0.6;
    transform-origin: center center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Ensure the vis.js network canvas is above the map */
.vis-network {
    position: relative !important;
    z-index: 2 !important; /* Above the background map */
}

/* Add a subtle indicator when geographic mode is active */
#network-container.geographic-mode {
    position: relative;
}

#network-container.geographic-mode::after {
    content: "Geographic Mode";
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(254, 82, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 10;
    pointer-events: none;
}

/* Empty State Styles */
.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #bebebe;
    text-align: center;
    opacity: 0.7;
}

.empty-state p {
    margin: 5px 0;
}

.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: #bebebe;
    text-align: center;
    opacity: 0.7;
}

.empty-state-graph i {
    margin-bottom: 15px;
}

/* LIT Projects Toggle - appears to the left when Network is active */
footer {
    background-color: #424242;
    padding: 15px 15px 28px 15px;
    display: flex;
    justify-content: center;
    position: relative;
}

.lit-projects-toggle {
    display: none; /* Hidden by default */
    position: absolute;
    right: calc(100% + 20px); /* Position to the left of main toggles */
    top: 50%;
    transform: translateY(-50%);
    background-color: #1e1e1e;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid #93c572; /* LiT green border */
    animation: slideInFromLeft 0.3s ease-out;
}

.lit-projects-toggle.visible {
    display: flex;
    align-items: center;
}

.lit-projects-toggle .toggle-label {
    color: #93c572; /* LiT green color */
    font-weight: bold;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.visualization-toggles {
    display: flex;
    gap: 20px;
    background-color: #1e1e1e;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-item {
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #bebebe;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #fe5200;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

input:disabled + .slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.toggle-label {
    margin-left: 10px;
    color: #bebebe;
}

/* Loading indicator */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(40, 40, 40, 0.8); /* Gray backdrop */
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* High z-index to appear above vis.js network */
    color: #deddd9;
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Allow clicks to pass through when hidden */
}

.loading-indicator.active {
    display: flex;
    opacity: 1;
    pointer-events: all; /* Block interactions when visible */
}

.spinner {
    border: 4px solid rgba(222, 221, 217, 0.3);
    border-radius: 50%;
    border-top: 4px solid #fe5200;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px; /* Increased spacing */
}

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

/* Optional: Add a subtle pulsing effect to the footer when processing */
footer.processing {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    overflow: auto;
}

.modal-content {
    background-color: #2a2a2a;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    border-radius: 20px;
    position: relative;
    color: #bebebe;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal.active .modal-content {
    margin-top: calc(50vh - (var(--modal-content-height, auto) / 2));
    max-height: 90vh;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.close-button:hover,
.close-button:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

#modal-company-name {
    margin-top: 0;
    margin-bottom: 20px;
    color: #fe5200;
    border-bottom: 2px solid #424242;
    padding-bottom: 15px;
    font-size: 28px; /* Increased from default */
    font-weight: bold;
    line-height: 1.2;
}

/* Modal Map Styles - Enhanced with resize handle */
.modal-map {
    position: absolute;
    top: 60px;
    right: 15px;
    cursor: move;
    user-select: none;
    z-index: 1000;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1a1a1a;
    width: 200px;
    height: auto;
}

.modal-map.dragging {
    cursor: grabbing;
}

.modal-map .map-header {
    background: #2a2a2a;
    padding: 8px;
    color: #deddd9;
    font-weight: bold;
    font-size: 12px;
    border-bottom: 2px solid #fe5200; /* Orange border to match your theme */
    cursor: move;
    margin-bottom: 0;
}

.modal-map iframe {
    border: none;
    display: block;
    pointer-events: auto;
    border-radius: 0 0 8px 8px;
}

.modal-map .map-placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    color: #999;
    font-size: 12px;
}

.modal-map .resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 16px;
    height: 16px;
    cursor: nw-resize;
    background: rgba(42, 42, 42, 0.8);
    border-top-right-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    border: 1px solid #555;
    transition: background-color 0.2s ease;
}

.modal-map .resize-handle:hover {
    background: rgba(254, 82, 0, 0.8);
}

.modal-map .resize-handle .diagonal-lines {
    width: 10px;
    height: 10px;
    background-image: 
        linear-gradient(-45deg, transparent 40%, #888 40%, #888 45%, transparent 45%),
        linear-gradient(-45deg, transparent 65%, #888 65%, #888 70%, transparent 70%);
    background-size: 6px 6px;
    background-position: 0 0, 2px 2px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.modal-map .resize-handle:hover .diagonal-lines {
    opacity: 1;
}

/* Description section styling */
.modal-description {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(254, 82, 0, 0.1);
    border-left: 4px solid #fe5200;
    border-radius: 5px;
}

.modal-description p:first-child {
    margin-bottom: 10px;
    color: #fe5200;
    font-weight: bold;
    font-size: 16px;
}

.modal-description p:last-child {
    margin-bottom: 0;
    line-height: 1.5;
    color: #deddd9;
}

/* URL section styling */
.modal-url {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(147, 197, 114, 0.1);
    border-left: 4px solid #93c572;
    border-radius: 5px;
}

.modal-url p:first-child {
    margin-bottom: 10px;
    color: #93c572;
    font-weight: bold;
    font-size: 16px;
}

.modal-url p:last-child {
    margin-bottom: 0;
}

.modal-url a {
    color: #93c572;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.modal-url a:hover {
    color: #a8d684;
    text-decoration: underline;
}

/* Separator between featured content and regular data */
.modal-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, #424242, transparent);
    margin: 20px 0;
}

/* Regular data container */
#modal-data-container {
    font-size: 14px;
    line-height: 1.6;
    flex-grow: 1;
    overflow-y: auto;
    /* Add margin-top to account for the map */
    margin-top: 20px;
}

#modal-data-container p {
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px dashed #424242;
    color: #bebebe;
}

#modal-data-container p:last-child {
    border-bottom: none;
}

/* Style for the network container when filtered */
#network-container.filtered {
    border: 2px solid #fe5200;
    border-radius: 18px; /* Slightly less than the parent's 20px */
}

/* Small badge for filtered state */
#network-container.filtered::before {
    content: "Filtered";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #fe5200;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    z-index: 10;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }
    
    .modal-map {
        position: static;
        width: 100%;
        margin-bottom: 15px;
    }
    
    #modal-company-name {
        font-size: 24px;
    }
    
    #modal-data-container {
        margin-top: 0;
    }
}

/* High z-index to ensure modal appears above everything */
#company-data-modal {
    z-index: 2000 !important;
}

#nts-ket-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(50, 50, 50, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-align: center;
  padding: 1rem;
  z-index: 1000; /* above nodes but below modals */
}

/* Mobile message screen - hidden by default */
.mobile-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #424242;
    color: #deddd9;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 10000;
}

.mobile-message h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #fe5200;
}

.mobile-message p {
    font-size: 18px;
    line-height: 1.4;
    max-width: 300px;
}

/* Hide main app on mobile, show mobile message */
@media (max-width: 768px) {
    /* Hide the entire main application */
    .container {
        display: none !important;
    }
    
    /* Show the mobile message */
    .mobile-message {
        display: flex !important;
    }
}

/* Also hide on very small screens and portrait tablets */
@media (max-height: 600px) {
    .container {
        display: none !important;
    }
    
    .mobile-message {
        display: flex !important;
    }
}

.developer-credit {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 7px;
    color: rgba(190, 190, 190, 0.6);
    z-index: 9998;
    user-select: none;
    font-family: Arial, sans-serif;
    cursor: pointer; /* Show it's clickable */
    transition: color 0.3s ease, font-size 0.3s ease;
}

.developer-credit:hover {
    color: rgba(190, 190, 190, 0.9);
    font-size: 8px;
}

/* Flying airplane animation */
.flying-airplane {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 14px;
    color: #ff4f00;
    z-index: 9999;
    pointer-events: none;
    filter: drop-shadow(2px 4px 4px rgba(0, 0, 0, 0.2));
}

/* Simple straight flight across screen */
@keyframes airplane-straight-flight {
    0% {
        right: 10px;
        opacity: 1;
    }
    100% {
        right: 100vw;
        opacity: 0.8;
    }
}

.flying-airplane.animate {
    animation: airplane-straight-flight 10s linear forwards; 
}

.header-buttons {
    display: flex;
    gap: 6px; /* Reduced from 10px to 6px for closer spacing */
    align-items: center;
}

/* Base header button styles */
.header-btn {
    background-color: #2a2a2a;
    border: 1px solid #424242;
    color: #bebebe;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-family: Arial, sans-serif;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    white-space: nowrap;
}

.header-btn:hover {
    background-color: #fe5200;
    color: #fff;
    border-color: #fe5200;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Specific button styles */
.info-btn {
    width: 36px;
    padding: 8px;
}

.info-btn i {
    font-size: 16px;
}

.about-btn {
    padding: 8px 16px;
    font-weight: 500;
}

.feedback-btn {
    padding: 8px 16px;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .header-buttons {
        gap: 4px; /* Even closer on smaller screens */
    }
    
    .header-btn {
        font-size: 13px;
        padding: 6px 10px;
        min-height: 32px;
    }
    
    .info-btn {
        width: 32px;
        padding: 6px;
    }
    
    .info-btn i {
        font-size: 14px;
    }
    
    .search-container {
        width: 45%; /* Slightly wider on medium screens */
    }
}

@media (max-width: 768px) {
    header {
        padding: 15px 10px 10px 10px; /* Adjusted padding for mobile */
        height: 55px;
    }
    
    /* Hide text buttons on mobile, keep only info icon */
    .about-btn,
    .feedback-btn {
        display: none;
    }
    
    .info-btn {
        width: 28px;
        min-height: 28px;
        padding: 4px;
    }
    
    .info-btn i {
        font-size: 12px;
    }
    
    .search-container {
        width: 50%; /* Adjust for mobile */
    }
}