/* property search application */

/* Label Row 
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
*/

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: 0;
}

#panel-content {
    padding-top: 0px;
    position: relative;
    overflow: visible;
}

/* Search bar styles */

.search-bar input {
    flex-grow: 0;
    border-radius: 10px;
    width: 350px;
    background-color: #2c2b2b;
    color: #fff;
    outline: none;
}

.search-bar input::placeholder {
    color: #ccc;
}

.search-bar button {
    background-color: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

/* Suggestions styles */
.suggestions {
    border: none;
    max-height: 200px;
    overflow-y: auto;
    background: #1d1d1d;
    position: absolute;
    width: 350px; /* Match search bar width */
    z-index: 10;
    top: calc(100% + 5px);
    left: 0;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.5);
}

/* Mobile responsiveness for search and suggestions */
@media screen and (max-width: 768px) {
    .search-bar input {
        width: 100%;
        max-width: 350px;
    }
    
    .suggestions {
        width: 100%;
        max-width: 350px;
        left: 0;
        right: 0;
        margin: 0 auto;
    }
}

#feedback-button-container {
    margin-top: 10px;
    width: 100%;
    position: relative;
}

#feedback-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 36px;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-sizing: border-box;
}

/* Hover states */

#feedback-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Icon styles */
#feedback-button i {
    font-size: 14px;
}

#copy-button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#copy-button:hover {
    background-color: #0056b3;
}

/* geoscore Cards */

#cards-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 10px;
}

.card {
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 80px;
    transition: transform 5s ease, order 5s ease;   
    position: relative;
}

.card img {
    width: 30px;
    height: 30px;
}

.card-number {
    font-size: 1.5em;
    font-weight: bold;
}

.card:hover::after {
    content: attr(data-name);
    position: absolute;
    top: 20%;
    left: calc(100% + 10px);
    background-color: rgba(255, 255, 255, 0.5);
    color: #000000;
    padding: 5px;
    border-radius: 10px;
    white-space: nowrap;
    margin-top: 5px;
    pointer-events: none;
    font-weight: bold;
}

/* Add active state for mobile */
@media screen and (max-width: 768px) {
    .card:hover::after {
        display: none; /* Disable hover effect on mobile */
    }
    
    .card.active::after {
        content: attr(data-name);
        position: absolute;
        top: 30px;
        left: 0;
        background-color: rgba(255, 255, 255, 0.5);
        color: #000000;
        padding: 5px;
        border-radius: 10px;
        white-space: nowrap;
        margin-top: 5px;
        pointer-events: none;
        font-weight: bold;
        display: block;
        z-index: 1000;
    }
}

.nature-card {
    background-color: rgba(139, 195, 74, 0.8); /* Green for nature */
}

.health-card {
    background-color: rgba(255, 87, 34, 0.8); /* Orange for health */
}

.transport-card {
    background-color: rgba(33, 150, 243, 0.8); /* Blue for transport */
}

.education-card {
    background-color: rgba(156, 39, 176, 0.8); /* Purple for education */
}

.gastronomy-card {
    background-color: rgba(255, 193, 7, 0.8); /* Yellow for gastronomy */
}

.entertainment-card {
    background-color: rgba(233, 30, 99, 0.8); /* Pink for entertainment */
}

.shopping-card {
    background-color: rgba(63, 81, 181, 0.8); /* Indigo for shopping */
}

.amenities-card {
    background-color: rgba(0, 188, 212, 0.8); /* Cyan for amenities */
}

.hazard-card {
    background-color: rgba(244, 67, 54, 0.8); /* Red for hazard */
}

/* Responsive Design */
@media only screen and (max-width: 768px) {
    #cards-container {
        top: 60px;
        left: 8%;
        transform: translate(-50%, 0);
        width: 15%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
    }

    .card {
        /* width: 40%; */
        width: 60px;
    }

    .card img {
        width: 20px;
        height: 20px;
    }

    .card-number {
        font-size: 1.2em;
    }

    .card:hover::after {
        top: 30px;
        left: 0;
        transform: none;
        text-align: left;
        padding-left: 5px;
    }
}

@media only screen and (max-width: 360px) {
    #cards-container {
        top: 60px;
        width: 10%;
        left: 10px;
        transform: translate(-50%, 0);
        flex-direction: column;
        gap: 5px;
    }

    .card {
        width: 60px;
        padding: 8px;
    }

    .card img {
        width: 20px;
        height: 20px;
    }

    .card-number {
        font-size: 1.1em;
    }

    .card:hover::after {
        top: -30px;
        left: 0;
        transform: none;
        text-align: left;
        padding-left: 5px;
    }
}

/* Address not found popup */

#address-not-found-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#popup-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

#popup-content p {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#popup-content input {
    width: 80%;
    padding: 10px;
    margin-bottom: 10px;
}

#popup-content button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

#popup-content button:hover {
    background-color: #0056b3;
}

#popup-close {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

/* Feedback Module */

#feedback-button-container {
    width: 100%;
}

#feedback-button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

#feedback-button:hover {
    background-color: #0056b3;
}

#feedback-button i {
    font-size: 16px;
}

#feedback-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 90%;
    max-width: 400px;
    z-index: 1001;
    margin: 0;
}

#feedback-popup::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

@media screen and (max-width: 768px) {
    #feedback-popup {
        width: 90%;
        max-height: 90vh;
        overflow-y: auto;
        margin: 0;
    }
}

#feedback-popup h2 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 15px;
}

#feedback-popup label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#feedback-popup input,
#feedback-popup textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

#feedback-popup button[type="submit"] {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    width: 38%;
}

#feedback-popup button[type="submit"]:hover {
    background-color: #0056b3;
}

#feedback-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #aaa;
}

#feedback-close:hover {
    color: #000;
}

/* Right click search popup */

#right-click-popup {
    position: absolute;
    background-color: white;
    border: 1px solid black;
    border-radius: 4px;
    padding: 10px;
    display: none;
    z-index: 9999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    /* Allow popup to run off the page */
    max-width: none;
    max-height: none;
    overflow: visible;
    pointer-events: auto;
}

#right-click-popup button {
    background-color: #3d348b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

#right-click-popup button:hover {
    background-color: #2a2461;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    #right-click-popup {
        padding: 12px;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    #right-click-popup button {
        padding: 10px 20px;
        font-size: 16px;
        width: 100%;
        white-space: nowrap;
    }
}

/* Copyright */

#copyrightNotice {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: #000;
    font-size: 10px;
    z-index: 1000;
    transition: color 0.3s ease;
}

body.dark-mode #copyrightNotice {
    color: #fff;
}

#copyrightNotice a {
    color: inherit;
    text-decoration: none;
}

#copyrightNotice a:hover {
    text-decoration: underline;
}

/* Tooltip */

.tooltip-container {
    display: flex;
    align-items: center;
}

.tooltip-icon {
    margin-right: 10px;
    background-color: white;
    border-radius: 4px;
}

.tooltip-icon-svg {
    margin-right: 10px;
    background-color: white;
    border-radius: 4px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tooltip-icon-svg svg {
    width: 50px !important;
    height: 50px !important;
    max-width: 50px;
    max-height: 50px;
}

.tooltip-info {
    display: flex;
    flex-direction: column;
    margin-right: 10px;
}

.tooltip-info div {
    margin-top: 0;
}

/* Mobile Tooltip */
#mobile-tooltip {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #3d348b;
    color: white;
    padding: 15px;
    z-index: 1001;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    max-height: 40vh;
    overflow-y: auto;
}

#mobile-tooltip.show {
    transform: translateY(0);
}

#mobile-tooltip .tooltip-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
}

#mobile-tooltip .tooltip-icon {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    background-color: white;
    border-radius: 8px;
    padding: 5px;
    flex-shrink: 0;
}

#mobile-tooltip .tooltip-info {
    flex: 1;
    font-size: 16px;
}

#mobile-tooltip .tooltip-info div {
    margin-bottom: 5px;
}

.mobile-tooltip-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    z-index: 1002;
}

/* Add a subtle indicator that the tooltip can be scrolled */
#mobile-tooltip::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
    pointer-events: none;
}

/* Ensure the mobile tooltip appears at the very bottom of the screen on mobile */
@media screen and (max-width: 768px) {
    #mobile-tooltip {
        bottom: 0; /* Position at the very bottom of the screen */
        z-index: 1001; /* Ensure it's above other elements */
    }
}

.card {
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

#cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.maplibregl-popup {
    max-width: 200px;
}

.popup-content {
    padding: 8px;
    font-size: 14px;
    line-height: 1.4;
}

/* Theme Switch 

#theme-toggle-container {
    margin-bottom: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 90px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
*/


/* Loading Module Styles */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.3s ease-out;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3d348b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Lato', Arial, sans-serif;
}

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

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dark mode loading styles */
body.dark-mode #loading-overlay .loading-spinner {
    background: #2c2c2c;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

body.dark-mode #loading-overlay .loading-text {
    color: #ffffff;
}

body.dark-mode #loading-overlay .spinner {
    border: 4px solid #444;
    border-top: 4px solid #3d348b;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}