/* Main styles for Star Wars Galaxy Map */

html {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: grey;
    overflow: hidden;
}

.container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.map {
    width: 100%;
    height: 100%;
    background: #000000;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Leaflet tooltip customization */
.leaflet-tooltip-mov {
    background-color: transparent;
    border: none;
    color: white;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 3px;
}

.leaflet-tooltip-special {
    background-color: rgba(255, 0, 0, 0.2);
    border: none;
    color: white;
    font-weight: bold;
    padding: 1px 1px;
    border-radius: 1px;
}

.leaflet-tooltip-mov::before {
    border: none;
}

/* Map popup customization */
.custom-popup {
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    border: 1px solid #444;
}

.custom-popup .leaflet-popup-content-wrapper {
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
}

.custom-popup .leaflet-popup-tip {
    background-color: rgba(0, 0, 0, 0.85);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-indicator {
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffd700; /* Star Wars gold */
    padding: 15px 25px;
    border-radius: 5px;
    border: 1px solid #444;
    font-family: 'Arial', sans-serif;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    animation: pulse 1.5s infinite ease-in-out;
    position: relative;
}

.loading-indicator:before {
    content: "";
    display: block;
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #ffd700;
    border-right-color: #ffd700;
    margin-left: -50px;
    margin-top: -3px;
    animation: spin 1s linear infinite;
    left: 20px;
    top: 50%;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }
}

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

/* System Search UI */
#system-search-container {
	position: fixed;
	top: 20px;
	right: 30px;
	left: auto;
	z-index: 9999;
	background: rgba(255, 255, 255, 0.97);
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	padding: 12px 16px 8px 16px;
	min-width: 260px;
	max-width: 340px;
	font-family: Arial, sans-serif;
}

#system-search-input {
	width: 100%;
	padding: 7px 10px;
	font-size: 1em;
	border: 1px solid #bbb;
	border-radius: 4px;
	outline: none;
	box-sizing: border-box;
	background-color: #fff;
}

#system-search-results {
	margin-top: 6px;
	max-height: 260px;
	overflow-y: auto;
	background: #fff;
	border-radius: 4px;
	border: 1px solid #ddd;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	z-index: 1200;
	/* Hide by default until search input is used */
	display: none;
}

.system-search-result {
	padding: 8px 12px;
	cursor: pointer;
	transition: background 0.15s;
	border-bottom: 1px solid #eee;
	font-size: 14px;
	color: #333;
}

.system-search-result:last-child {
	border-bottom: none;
}

.system-search-result:hover,
.system-search-result.active {
	background: #e3eaff;
	color: #1a1a1a;
	font-weight: 500;
}

/* Home button control */
.leaflet-control-home {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    font-size: 16px;
    text-align: center;
    background-color: #fff;
    color: #000;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    line-height: 26px;
}

.leaflet-control-home:hover {
    background-color: #f4f4f4;
}