/**
 * Treelle Travel - Search Components Styles
 * Stili per ricerca hotel/voli e calcolatore tour
 */

/* Search Results Container */
#searchResults {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    animation: slideUp 0.3s ease;
}

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

.search-results-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-results-header h3 {
    font-size: 1.5rem;
    color: #1e3c72;
    margin: 0;
}

.search-results-header p {
    color: #666;
    margin: 0;
}

.demo-badge {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.live-badge {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.demo-notice {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 8px 8px 0;
    color: #e65100;
    font-size: 0.9rem;
}

/* Hotel Results Grid */
.hotel-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.hotel-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
}

.hotel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.hotel-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.hotel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-free-cancel {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #4caf50;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.hotel-info {
    padding: 1.25rem;
}

.hotel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.hotel-header h4 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
    flex: 1;
}

.hotel-stars {
    color: #ffc107;
    font-size: 0.9rem;
}

.hotel-address {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.hotel-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rating-score {
    background: #1e3c72;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
}

.rating-text {
    color: #333;
    font-weight: 500;
}

.review-count {
    color: #999;
    font-size: 0.85rem;
}

.hotel-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.hotel-amenities .amenity {
    background: #f0f4f8;
    color: #1e3c72;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
}

.hotel-pricing {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.price-info {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.price-per-night {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3c72;
}

.price-label {
    color: #666;
    font-size: 0.85rem;
}

.price-total {
    color: #666;
    font-size: 0.85rem;
}

.price-total strong {
    color: #333;
}

.btn-book-hotel {
    background: linear-gradient(135deg, #ffdd00, #ffc107);
    color: #1e3c72;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-book-hotel:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 221, 0, 0.4);
}

/* Flight Results */
.flight-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flight-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 150px 1fr 150px;
    gap: 1.5rem;
    align-items: center;
    transition: box-shadow 0.3s;
}

.flight-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.flight-airline {
    display: flex;
    flex-direction: column;
}

.airline-name {
    font-weight: 600;
    color: #333;
}

.flight-number {
    color: #999;
    font-size: 0.85rem;
}

.flight-times {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.flight-time {
    text-align: center;
}

.flight-time strong {
    display: block;
    font-size: 1.3rem;
    color: #333;
}

.flight-time span {
    color: #666;
    font-size: 0.85rem;
}

.flight-duration {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.duration-line {
    width: 80px;
    height: 2px;
    background: #ddd;
    position: relative;
}

.duration-line::after {
    content: '✈';
    position: absolute;
    right: -10px;
    top: -8px;
    color: #1e3c72;
}

.duration-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.flight-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.flight-price .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3c72;
}

.flight-price .per-person {
    font-size: 0.8rem;
    color: #999;
}

.btn-select-flight {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: transform 0.2s;
}

.btn-select-flight:hover {
    transform: scale(1.05);
}

/* Loading State */
.search-loading {
    text-align: center;
    padding: 3rem;
}

.search-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #1e3c72;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.search-error {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Tour Calculator */
.tour-calculator-section {
    margin-top: 3rem;
    position: relative;
}

.btn-toggle-calculator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-toggle-calculator:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.4);
}

.btn-icon {
    font-size: 1.4rem;
}

.tour-calculator {
    display: none;
    background: white;
    border-radius: 16px;
    margin-top: 1rem;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    animation: slideDown 0.3s ease;
}

.tour-calculator.open {
    display: block;
}

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

.calculator-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f4f8;
}

.calculator-header h3 {
    font-size: 1.5rem;
    color: #1e3c72;
    margin-bottom: 0.5rem;
}

.calculator-header p {
    color: #666;
}

.calculator-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input,
.form-group select {
    padding: 0.9rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1e3c72;
}

.date-display {
    background: #f0f4f8;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    color: #1e3c72;
    font-weight: 500;
}

.btn-search-hotels {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #ffdd00, #ffc107);
    color: #1e3c72;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-search-hotels:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 221, 0, 0.4);
}

/* Tour Hotels Container */
#tourHotelsContainer {
    display: none;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f4f8;
}

.tour-hotels-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tour-hotels-header h3 {
    font-size: 1.3rem;
    color: #1e3c72;
    margin: 0;
}

.city-hotels-section {
    margin-bottom: 2rem;
}

.city-name {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f4f8;
}

.city-hotels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.tour-hotel-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.tour-hotel-card:hover {
    border-color: #1e3c72;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tour-hotel-card.selected {
    border-color: #ffdd00;
    background: linear-gradient(135deg, #fffde7, #fff9c4);
}

.tour-hotel-image {
    height: 120px;
    overflow: hidden;
}

.tour-hotel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tour-hotel-info {
    padding: 1rem;
}

.tour-hotel-info h5 {
    font-size: 1rem;
    color: #333;
    margin: 0 0 0.25rem 0;
}

.tour-hotel-stars {
    color: #ffc107;
    font-size: 0.85rem;
}

.tour-hotel-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.tour-hotel-rating .rating {
    background: #1e3c72;
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tour-hotel-rating .reviews {
    color: #999;
    font-size: 0.8rem;
}

.tour-hotel-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.tour-hotel-amenities span {
    background: #e3f2fd;
    color: #1e3c72;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
}

.tour-hotel-price {
    display: flex;
    flex-direction: column;
}

.tour-hotel-price strong {
    font-size: 1.1rem;
    color: #1e3c72;
}

.tour-hotel-price small {
    color: #666;
    font-size: 0.8rem;
}

.select-indicator {
    text-align: center;
    padding: 0.75rem;
    background: #1e3c72;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.tour-hotel-card.selected .select-indicator {
    background: #4caf50;
}

/* Price Summary */
#priceSummary {
    display: none;
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa, #e8ecf1);
    border-radius: 16px;
    border: 2px solid #1e3c72;
}

.summary-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.summary-header h4 {
    font-size: 1.3rem;
    color: #1e3c72;
    margin: 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 10px;
}

.summary-label {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3c72;
}

.summary-total {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border-radius: 12px;
    color: white;
    margin-bottom: 1.5rem;
}

.summary-total .total-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.summary-total .total-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.summary-total .per-person {
    font-size: 1rem;
    opacity: 0.8;
}

.btn-request-quote {
    width: 100%;
    background: linear-gradient(135deg, #ffdd00, #ffc107);
    color: #1e3c72;
    border: none;
    padding: 1.25rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-request-quote:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 221, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .hotel-results-grid {
        grid-template-columns: 1fr;
    }
    
    .flight-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .flight-price {
        align-items: center;
    }
    
    .calculator-form {
        grid-template-columns: 1fr;
    }
    
    .city-hotels-grid {
        grid-template-columns: 1fr;
    }
}
