/* GGT Shortcodes - Stili personalizzati */

/* ============================================================
   SEARCHBOX - Struttura principale
   ============================================================ */

.searchbox {
    position: relative;
    padding: 0.5rem 1rem;
}

.searchbox__wrapper {
    position: relative;
}

/* Form orizzontale */
.searchbox__form {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Campo singolo */
.searchbox__field {
    display: flex;
    position: relative;
    border-radius: 2rem;
    border: 1px solid rgba(153, 153, 153, 0.23);
    background: white;
    align-items: center;
    width: 100%;
}

/* Input */
.searchbox__wrapper input,
.searchbox__input {
    display: flex;
    align-items: center;
    border: 0;
    padding: 1.2rem 1rem 1.2rem 3rem;
    outline: none;
    border-radius: 2rem;
    font-family: inherit;
    flex: 1;
    box-sizing: border-box;
    background: transparent;
    font-size: 0.95rem;
    color: #111827;
    cursor: pointer;
    width: 100%;
}

.searchbox__input::placeholder {
    color: #9ca3af;
}

/* Icona a sinistra (posizionata in assoluto dentro il field) */
.searchbox__icon {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    padding: 1rem;
    color: #9ca3af;
    pointer-events: none;
    flex-shrink: 0;
}

/* Pulsante cerca */
.searchbox__submit {
    background: var(--e-global-color-primary, #f5a623);
    color: #fff;
    border: 0;
    border-radius: 2rem;
    margin: 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 1rem;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    cursor: pointer;
    line-height: 0;
}

.searchbox__submit:hover {
    opacity: 0.9;
}

.search-icon {
    flex-shrink: 0;
}

.search-text {
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: 600;
}

/* Container dropdown pannelli — nascosto di default */
.searchbox__content {
    position: absolute;
    display: none;
    box-shadow: 0 0 10px rgba(153, 153, 153, 0.23);
    border-radius: 0.5rem;
    background: white;
    padding: 1rem;
    z-index: 9990;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    top: 75px;
}

.searchbox__content.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.searchbox__content.swapping {
    opacity: 0;
    transform: scale(0.95);
}

/* Pannello singolo — il JS usa style.display = "block" per mostrarlo */
.content-panel {
    display: none;
}

/* Item cliccabile */
.content-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.content-item:hover {
    background-color: rgba(35, 142, 203, 0.1);
}

/* Calendario */
.calendar-wrapper {
    font-family: inherit;
}

.calendar-wrapper button {
    font-family: inherit;
}

.calendar-days button:not(:disabled) {
    cursor: pointer;
}

/* Autocomplete Results */
.autocomplete-results {
    animation: fadeIn 0.2s ease-in-out;
}

/* Scroll nel pannello autocomplete destinazioni */
[data-for="destination"] .space-y-1,
[data-for="from"] .space-y-1 {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

[data-for="destination"] .space-y-1::-webkit-scrollbar,
[data-for="from"] .space-y-1::-webkit-scrollbar {
    width: 6px;
}

[data-for="destination"] .space-y-1::-webkit-scrollbar-track,
[data-for="from"] .space-y-1::-webkit-scrollbar-track {
    background: transparent;
}

[data-for="destination"] .space-y-1::-webkit-scrollbar-thumb,
[data-for="from"] .space-y-1::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulsante submit con spinner */
.searchbox__submit svg.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .searchbox__form {
        flex-direction: column;
        gap: 0.75rem;
    }

    .searchbox__field {
        width: 100%;
    }

    .searchbox__submit {
        width: 100%;
        justify-content: center;
        border-radius: 2rem;
        margin: 0;
        height: auto;
        padding: 1rem;
    }

    .searchbox__content {
        position: static;
        margin-top: 8px;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Loading Modal */
.ggt-loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeInModal 0.3s ease-in-out;
}

.ggt-loading-modal.active {
    display: flex;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ggt-loading-card {
    background: white;
    border-radius: 1rem;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ggt-loading-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    position: relative;
}

.ggt-loading-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
}

.ggt-loading-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ggt-loading-location svg {
    flex-shrink: 0;
}

.ggt-loading-content {
    padding: 2rem;
    text-align: center;
}

.ggt-loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.ggt-loading-spinner::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    border: 4px solid #f3f3f3;
    border-top-color: var(--e-global-color-primary, #238ECB);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ggt-loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-family: 'League Spartan', sans-serif;
}

.ggt-loading-subtext {
    font-size: 0.95rem;
    color: #666;
    font-family: 'League Spartan', sans-serif;
}

/* Focus states */
.searchbox__input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Loading state */
.searchbox__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
