@charset "utf-8";

/* ========================================= */
/* 1. FONT DEFINITIONS                       */
/* ========================================= */

@font-face {
    font-family: 'Macho Modular';
    src: url('fonts/MachoModular_Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Macho Modular';
    src: url('fonts/MachoModular_Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Macho Modular';
    src: url('fonts/MachoModular_Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ========================================= */
/* 2. BASE & UTILITY STYLES                  */
/* ========================================= */

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: 'Macho Modular', sans-serif;
    font-weight: 500;
    text-decoration: none;
    background-color: black;
	color: #013f5b;
}

h1 {
    font-size: 32px;
    text-align: center;
}

.pulsante {
    height: 36px;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 1px 1px 1px rgba(255,255,255,.5);
    padding: 0 16px;
    border: 1px solid gray;
    border-radius: 18px;
    background-color: rgba(170, 170, 170, 1);
    transition: background-color 0.8s ease, color 0.3s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.pulsante:hover {
    background-color: rgba(220, 220, 220, 1);
}

.highlight {
    background-color: yellow;
    font-weight: bold;
}

/* ========================================= */
/* 3. LOGIN PAGE STYLES                      */
/* ========================================= */

#logo, 
#logounisi {
    margin: 0 auto;
    text-align: center;
}

#logounisi {
    margin-top: 50px;
}

#logo img, 
#logounisi img {
    width: 240px;
    height: 240px;
}

#login {
    margin-top: 20px;
}

#login_form {
    background-color: white;
    color: #013f5afe;
    margin: 0 auto;
    padding-bottom: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#login_form p {
    font-size: 24px;
    text-align: center;
}

#login input {
    margin-bottom: 20px;
    background-color: #fff9e6;
    border-radius: 10px;
    border: 1px black solid;
    font-size: 18px;
    width: 100%;
    padding: 10px 40px 10px 12px;
    box-sizing: border-box;
}

#invio-login {
    text-align: center;
}

#user-pw {
    position: relative;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #555;
}

.toggle-password:hover {
    color: #333;
}

#err-msg {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    min-height: 24px;
    margin: 0;
    padding: 0;
}

/* ========================================= */
/* 4. MAP & LAYOUT CONTAINERS                */
/* ========================================= */

#wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 60vh;
    background-color: #fff6d9;
}

svg {
    cursor: grab;
    display: block;
    height: 100%;
    width: 100%;
    touch-action: none;
    user-select: none;
}

svg.dragging {
    cursor: grabbing;
}

/* ========================================= */
/* 5. UI COMPONENTS - POSITIONING            */
/* ========================================= */

/* Search Container */
#search-container {
    position: absolute;
	color: #013f5b;
    right: 20px;
    top: 20px;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Floor Selectors */
#floor-selector {
    position: absolute;
    left: 50%;
    top: 18%;
    transform: translateX(-50%);
    z-index: 1000;
    display: none; /* Questo viene gestito via JavaScript */
}

#floor-selector-inline {
    position: absolute;
    top: 20px;
    left: 50px; /* Spazio per il search container */
    z-index: 1000;
    display: none;
}

/* Tooltip */
.tooltip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

/* ========================================= */
/* 6. UI COMPONENTS - STYLING                */
/* ========================================= */

/* Search Components */
#search-toggle {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #979494;
    border-radius: 50%;
    box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    height: 32px;
    padding: 7px;
    transition: all 0.3s ease;
    width: 32px;
}

#search-toggle:hover { 
	background: rgba(255, 255, 255, 1);   
    transform: scale(1.1);
}

#search-box {
    background: white;
    border: 1px solid #ccc;
    border-radius: 20px;
    box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.4);
    display: none;
    min-width: 250px;
    padding: 8px 15px;
    position: relative;
}

#search-input {
    background: transparent;
    border: none;
    font-size: 14px;
    outline: none;
    width: 100%;
}

#search-results {
    background: white;
    border: 1px solid #ccc;
    border-radius: 0 0 10px 10px;
    border-top: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
    left: 0;
    margin-top: 0;
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1002;
}

.search-result-item {
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 15px;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Floor Selector Base Styling - CORRETTO */
.floor-selector-base {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.4);
    padding: 12px 16px;
    text-align: center;
}

/* Applica la classe base ai selettori */
#floor-selector {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.4);
    padding: 12px 16px;
    text-align: center;
}

#floor-selector-inline {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.4);
    padding: 8px 12px;
    text-align: center;
}

/* Floor Selector Title */
#floor-selector .title {
    font-weight: 700;
    font-size: 32px;
    margin-bottom: 8px;
    text-align: center;    
}

/* Floor Buttons */
.floor-btn {
    display: inline-block;
    margin: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-size: 24px;
    font-family: 'Macho Modular', sans-serif;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 50px;
    text-align: center;
	color: #013f5b;
}

.floor-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.floor-btn:focus {
    outline: 2px solid #3282F6;
    outline-offset: 2px;
}

/* Floor Select Dropdown */
#floor-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Macho Modular', sans-serif;
}

#floor-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Tooltip Styling */
.tooltip {
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: auto;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 10px;
    border-radius: 10px;
    font-size: 20px;
	min-width: 340px;
    max-width: 600px;
    text-align: center;
    box-shadow: 1px 4px 12px rgba(0,0,0,0.4);
    display: none;
    cursor: default;
}

.tooltip.show {
    display: block;
    opacity: 1;
}

.tooltip-search-content {
    position: relative;
    padding-right: 30px;
}

.tooltip-close-btn {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #B00020;/*rosso unisi!*/
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.tooltip-close-btn:hover {
    background: #f00;
}

#tooltip button {
    pointer-events: auto;
    cursor: pointer;
}

/* Button Components */
.floor-change-btn {
    background: #3282F6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 8px;
    transition: background-color 0.2s;
    font-family: 'Macho Modular', sans-serif;
}

.floor-change-btn:hover {
    background: #2563eb;
}

/* Utility Components */
.rettangolo-colore {
    display: inline-block;
    width: 32px;
    height: 16px;
    border-radius: 8px;
    margin-left: 8px;
    position: relative;
}

/* ========================================= */
/* 7. ANIMATIONS                             */
/* ========================================= */

@keyframes markerAppear {
    0% {
        transform: scale(20);
        opacity: 0;
    }
    20% {
        transform: scale(0.5);
        opacity: 1;
    }
    40% {
        transform: scale(1.3);
    }
    60% {
        transform: scale(0.8);
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.search-marker,
.location-marker {
    animation: markerAppear 5s ease-in-out forwards;
    transform-origin: center;
}

@media (max-width: 1024px){
	 #floor-selector {
        top: 0px;
        width: 100%;
        height: 100%;
        box-shadow: none;
        border-radius: 0; 
        padding: 0px; 
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        justify-content: center; 
    }	
	#floor-buttons{
		width: 350px;
		margin: 0 auto;
	}
	.floor-btn {
		margin: 15px;
	}

@media (max-width: 370px) {	
	.tooltip {width: 100%;min-width: 0;}
}