/**
 * UDR Orari Tool Styles
 * 
 * @package UDR_Lazio
 * @since 1.0.0
 */

/* Container principale */
.udr-orari-tool {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
    min-height: 100vh;
    position: relative;
}

.udr-orari-tool::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.95) 0%, rgba(6, 182, 212, 0.95) 50%, rgba(20, 184, 166, 0.95) 100%);
    z-index: 0;
}

.udr-orari-tool > * {
    position: relative;
    z-index: 1;
}

.udr-orari-tool__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.02em;
}

.udr-orari-tool__subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2.5rem;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Guida all'utilizzo */
.udr-orari-guide {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    border-left: 4px solid #0ea5e9;
}

.udr-orari-guide__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0ea5e9;
    color: #fff;
    border-radius: 50%;
}

.udr-orari-guide__content {
    flex: 1;
}

.udr-orari-guide__title {
    font-size: 1rem;
    font-weight: 600;
    color: #0c4a6e;
    margin: 0 0 0.75rem 0;
}

.udr-orari-guide__steps {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.6;
}

.udr-orari-guide__steps li {
    margin-bottom: 0.5rem;
}

.udr-orari-guide__steps li:last-child {
    margin-bottom: 0;
}

.udr-orari-guide__steps strong {
    color: #0369a1;
}

.udr-orari-guide__intro {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    color: #334155;
}

.udr-orari-guide__categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.udr-orari-guide__category {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
}

.udr-orari-guide__badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.udr-orari-guide__badge--udr {
    background: #dbeafe;
    color: #1e40af;
}

.udr-orari-guide__badge--chiamata {
    background: #fef3c7;
    color: #92400e;
}

.udr-orari-guide__badge--comune {
    background: #d1fae5;
    color: #065f46;
}

.udr-orari-guide__badge--fermata {
    background: #fce7f3;
    color: #9d174d;
}

@media (max-width: 640px) {
    .udr-orari-guide {
        flex-direction: column;
        padding: 1rem;
    }
    
    .udr-orari-guide__icon {
        width: 32px;
        height: 32px;
    }
    
    .udr-orari-guide__icon svg {
        width: 18px;
        height: 18px;
    }
    
    .udr-orari-guide__title {
        font-size: 0.95rem;
    }
    
    .udr-orari-guide__steps {
        font-size: 0.85rem;
        padding-left: 1rem;
    }
    
    .udr-orari-guide__categories {
        grid-template-columns: 1fr;
        padding: 0.75rem;
    }
    
    .udr-orari-guide__category {
        font-size: 0.8rem;
    }
    
    .udr-orari-guide__badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
}

/* Form */
.udr-orari-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: #fff;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 100;
}

.udr-input-hint {
    display: block;
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.5rem;
    font-style: normal;
    font-weight: 400;
}

/* Vicino a me - geolocalizzazione */
.udr-vicino-ame-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.udr-vicino-ame-label {
    font-size: 0.875rem;
    color: #64748b;
}
.udr-vicino-ame-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 0.25rem;
}
.udr-vicino-ame-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0e7490;
    background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
    border: 2px solid #5eead4;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.udr-vicino-ame-btn:hover {
    background: linear-gradient(180deg, #ccfbf1 0%, #f0fdfa 100%);
    border-color: #2dd4bf;
    transform: translateY(-1px);
}
.udr-vicino-ame-icon {
    font-size: 1rem;
}
.udr-vicino-ame-results {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
}
.udr-vicino-ame-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0e7490;
    margin: 0 0 0.5rem 0;
}
.udr-vicino-ame-intro {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 1.25rem 0;
}
.udr-vicino-ame-section {
    margin-bottom: 1.25rem;
}
.udr-vicino-ame-section:last-child {
    margin-bottom: 0;
}
.udr-vicino-ame-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.75rem 0;
}
.udr-vicino-ame-chips,
.udr-vicino-ame-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.udr-vicino-ame-chip {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0e7490;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    max-width: 100%;
}
.udr-vicino-ame-chip:hover {
    background: #ccfbf1;
    border-color: #2dd4bf;
}

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

.udr-form-group label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1e293b;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.udr-search-label {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.udr-form-group input,
.udr-form-group select {
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #fff;
    color: #1e293b;
}

.udr-form-group input:focus,
.udr-form-group select:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
    background: #fff;
}

.udr-form-group input:disabled,
.udr-form-group select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Riga Orario + Tutti gli orari */
.udr-time-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.udr-form-group .udr-time-row input {
    flex: 1;
    min-width: 8rem;
}
/* Pulsante "Tutti gli orari" caratterizzato: icona griglia + testo */
.udr-tutti-orari-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0e7490;
    background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
    border: 2px solid #5eead4;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(6, 182, 212, 0.08);
}
.udr-tutti-orari-btn .udr-tutti-orari-btn-icon {
    flex-shrink: 0;
    opacity: 0.9;
}
.udr-tutti-orari-btn:hover {
    background: linear-gradient(180deg, #ccfbf1 0%, #f0fdfa 100%);
    color: #0d9488;
    border-color: #2dd4bf;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.15);
    transform: translateY(-1px);
}
.udr-tutti-orari-btn[aria-pressed="true"],
.udr-tutti-orari-btn.udr-tutti-orari-btn--active {
    background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%);
    color: #fff;
    border-color: #06b6d4;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);
}
.udr-tutti-orari-btn[aria-pressed="true"] .udr-tutti-orari-btn-icon,
.udr-tutti-orari-btn.udr-tutti-orari-btn--active .udr-tutti-orari-btn-icon {
    opacity: 1;
}
.udr-tutti-orari-btn[aria-pressed="true"]:hover,
.udr-tutti-orari-btn.udr-tutti-orari-btn--active:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border-color: #0891b2;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
}

/* Autocomplete */
.udr-form-group {
    position: relative;
}

/* Form group con searchbar deve avere z-index alto per autocomplete */
.udr-form-group--full {
    grid-column: 1 / -1;
    position: relative;
    z-index: 9999;
}

.udr-searchbar {
    position: relative;
    z-index: 10000;
}

.udr-autocomplete-list {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 99999 !important;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Autocomplete quando è dentro searchbar */
.udr-searchbar .udr-autocomplete-list {
    top: calc(100% + 0.5rem);
    left: -1rem;
    right: -0.75rem;
    border-radius: 16px;
    z-index: 99999 !important;
}

.udr-autocomplete-item {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    border-bottom: none;
    transition: all 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.125rem 0.5rem;
    border-radius: 8px;
}

.udr-autocomplete-item:hover,
.udr-autocomplete-item:focus,
.udr-autocomplete-item.selected {
    background-color: #f0fdfa;
    outline: none;
    transform: translateX(2px);
    border: 1px solid #ccfbf1;
}

.udr-autocomplete-item strong {
    color: #333;
    font-weight: 600;
}

.udr-autocomplete-comune {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.udr-autocomplete-udr {
    font-size: 0.8rem;
    color: #0f766e;
    font-weight: 600;
    background: #ccfbf1;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
}

.udr-autocomplete-item:last-child {
    border-bottom: none;
}

/* Autocomplete migliorato con icone e badge */
.udr-autocomplete-main {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.udr-autocomplete-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.udr-autocomplete-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.udr-autocomplete-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
    flex-shrink: 0;
}

.udr-autocomplete-type-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.udr-autocomplete-type-badge--udr {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.udr-autocomplete-type-badge--line {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}

.udr-autocomplete-type-badge--comune {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.udr-autocomplete-type-badge--servizio_chiamata {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
}

.udr-autocomplete-type-badge--fermata {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

/* Stili specifici per tipo elemento */
.udr-autocomplete-item--udr:hover,
.udr-autocomplete-item--udr.selected {
    background-color: #f5f3ff;
    border-color: #ddd6fe;
}

.udr-autocomplete-item--line:hover,
.udr-autocomplete-item--line.selected {
    background-color: #f0fdfa;
    border-color: #ccfbf1;
}

.udr-autocomplete-item--comune:hover,
.udr-autocomplete-item--comune.selected {
    background-color: #f0fdf4;
    border-color: #d1fae5;
}

.udr-autocomplete-item--servizio_chiamata:hover,
.udr-autocomplete-item--servizio_chiamata.selected {
    background-color: #fffbeb;
    border-color: #fde68a;
}

.udr-autocomplete-item--fermata:hover,
.udr-autocomplete-item--fermata.selected {
    background-color: #eef2ff;
    border-color: #c7d2fe;
}

/* Modern Search Bar - Pill Style */
.udr-searchbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.75rem 1rem 0.75rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    position: relative;
}

.udr-searchbar:focus-within {
    border-color: #06b6d4;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15), 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.udr-searchbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.udr-searchbar-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: #333;
    outline: none;
    min-width: 0;
}

.udr-searchbar-input::placeholder {
    color: #999;
}

.udr-searchbar-input:focus {
    outline: none;
}

.udr-searchbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.udr-searchbar-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0891b2 0%, #0284c7 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.udr-searchbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.udr-searchbar-btn:focus-visible {
    outline: 2px solid #3A6BB3;
    outline-offset: 2px;
}

.udr-searchbar-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.udr-searchbar-btn svg,
.udr-searchbar-btn .udr-searchbar-btn-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    flex-shrink: 0;
}

/* Pulsante Cerca con icona + testo visibile */
.udr-searchbar-btn--cerca {
    width: auto;
    min-width: 48px;
    padding: 0 1.25rem;
    gap: 0.5rem;
}

.udr-searchbar-btn--cerca .udr-searchbar-btn-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.udr-searchbar-btn--cerca .udr-searchbar-btn-label {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Stati */
.udr-orari-state {
    padding: 2.5rem;
    text-align: center;
    border-radius: 20px;
    margin-bottom: 2rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.udr-orari-state--loading {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    color: #0f766e;
    border: 2px solid #5eead4;
}

.udr-orari-state--empty {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border: 2px solid #fcd34d;
}

/* Contenitore servizio a chiamata nei risultati orari */
.udr-results-servizio-chiamata {
    margin-bottom: 1.5rem;
}
.udr-results-servizio-chiamata .udr-servizio-chiamata-message {
    margin-bottom: 1rem;
}
.udr-results-servizio-chiamata .udr-servizio-chiamata-message:last-child {
    margin-bottom: 0;
}

/* Messaggio servizio a chiamata */
.udr-servizio-chiamata-message {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.udr-servizio-chiamata-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.udr-servizio-chiamata-message h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #92400e;
}

.udr-servizio-chiamata-message > p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.udr-servizio-chiamata-details {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.udr-servizio-chiamata-details p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.udr-servizio-chiamata-details strong {
    color: #78350f;
    font-weight: 600;
}

.udr-servizio-chiamata-details a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.udr-servizio-chiamata-details a:hover {
    color: #0284c7;
    text-decoration: underline;
}

.udr-servizio-chiamata-apps {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(146, 64, 14, 0.2);
}

.udr-servizio-chiamata-apps p {
    margin-bottom: 0.5rem;
}

.udr-app-link {
    display: inline-block;
    margin-right: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #0ea5e9;
    color: white !important;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.udr-app-link:hover {
    background: #0284c7;
    text-decoration: none;
    color: white !important;
}

.udr-orari-state--error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 2px solid #fca5a5;
}

.udr-orari-state--error-help {
    text-align: left;
    line-height: 1.6;
    padding: 1.25rem 1.5rem;
}
.udr-orari-state--error-help strong {
    font-weight: 700;
}
.udr-vicino-ame-retry-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #991b1b;
    background: #fff;
    border: 2px solid #fca5a5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.udr-vicino-ame-retry-btn:hover {
    background: #fef2f2;
    border-color: #f87171;
}

/* Risultati */
.udr-orari-results {
    margin-top: 2rem;
    background: #fff;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.udr-orari-results-list h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

/* Toolbar risultati + Esporta PDF */
.udr-results-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.udr-btn-export-pdf {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #0e7490 0%, #0ea5e9 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(14, 116, 144, 0.35);
    transition: all 0.2s ease;
}

.udr-btn-export-pdf:hover {
    background: linear-gradient(135deg, #0c6478 0%, #06b6d4 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 116, 144, 0.45);
}

.udr-btn-export-pdf:active {
    transform: translateY(0);
}

.udr-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.udr-result-item {
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    background: #f8fafc;
    border-left: 4px solid #06b6d4;
    border-radius: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.udr-result-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-left-color: #0ea5e9;
}

.udr-result-line {
    font-size: 1.15rem;
    font-weight: 700;
    color: #06b6d4;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    letter-spacing: -0.01em;
}

/* Badge UDR - selettore specifico per evitare conflitti con main.css */
.udr-orari-tool .udr-badge,
.udr-header-badges .udr-badge,
.udr-result-line-header .udr-badge,
.udr-result-line .udr-badge,
.udr-result-group .udr-header-badges .udr-badge,
.udr-result-group .udr-result-line-header .udr-badge {
    display: inline-block !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #000 !important;
    background-color: #b0b0b0 !important;
    padding: 0.4rem 0.7rem !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    border: 2px solid #666 !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    min-width: auto !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    max-width: none !important;
    flex-shrink: 0 !important;
}

.udr-result-times {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.udr-time-depart,
.udr-time-arrive {
    font-size: 0.95rem;
    color: #666;
}

.udr-time-depart strong,
.udr-time-arrive strong {
    color: #333;
    font-size: 1.1rem;
}

.udr-result-stops {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #666;
}

.udr-stop-from,
.udr-stop-to {
    display: flex;
    align-items: center;
}

.udr-stop-from::before {
    content: '📍';
    margin-right: 0.25rem;
}

.udr-stop-to::before {
    content: '🎯';
    margin-right: 0.25rem;
}

/* ============================================
   Percorso della linea – stile linea bus
   (tratto + fermate a pallino)
   ============================================ */
.udr-result-percorso {
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, #f0f9ff 0%, #fff 100%);
    border-radius: 10px;
    border: 1px solid #bae6fd;
    box-shadow: 0 1px 3px rgba(6, 182, 212, 0.1);
}

.udr-result-percorso .udr-percorso-title {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #0e7490;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #a5f3fc;
}

.udr-result-percorso .udr-percorso-route {
    margin-bottom: 0;
}

/* Tratto “linea bus”: linea verticale + fermate a pallino */
.udr-result-percorso .udr-bus-line {
    position: relative;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.udr-result-percorso .udr-bus-line::before {
    content: '';
    position: absolute;
    left: 0.3rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 3px;
    background: linear-gradient(180deg, #06b6d4 0%, #0ea5e9 100%);
    border-radius: 2px;
}

.udr-result-percorso .udr-percorso-stop {
    position: relative;
    font-size: 0.875rem;
    color: #1e293b;
    line-height: 1.5;
    padding: 0.25rem 0;
    padding-left: 0.5rem;
    font-weight: 500;
}

.udr-result-percorso .udr-percorso-stop::before {
    content: '';
    position: absolute;
    left: -1.2rem;
    top: 0.55rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #06b6d4;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #06b6d4;
}

.udr-result-percorso .udr-percorso-stop:first-child::before,
.udr-result-percorso .udr-percorso-stop:last-child::before {
    width: 12px;
    height: 12px;
    left: -1.3rem;
    top: 0.45rem;
    background: #0f766e;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #0f766e;
}

/* Meta riga (Percorso | UDR) */
.udr-result-meta {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.35rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    line-height: 1.5;
}

.udr-result-meta .udr-meta-label {
    font-weight: 600;
    color: #334155;
}

.udr-result-meta .udr-meta-value {
    color: #0e7490;
    font-weight: 500;
}

.udr-result-meta .udr-meta-sep {
    margin: 0 0.5rem;
    color: #cbd5e1;
}

/* Percorso in meta (evidenziato, non testo piatto) */
.udr-result-meta .udr-meta-percorso {
    display: inline-block;
    font-weight: 700;
    font-size: 0.95rem;
    color: #0e7490;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(6, 182, 212, 0.06) 100%);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border-left: 4px solid #06b6d4;
    margin-left: 0.25rem;
    box-shadow: 0 1px 2px rgba(6, 182, 212, 0.15);
}

/* Blocco per direzione */
.udr-direction-block {
    margin-top: 1.25rem;
    padding: 1rem 0;
    border-top: 1px solid #e2e8f0;
}

.udr-direction-block:first-of-type {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: none;
}

.udr-direction-header {
    font-weight: 700;
    font-size: 1rem;
    color: #0e7490;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: rgba(6, 182, 212, 0.1);
    border-left: 4px solid #06b6d4;
    border-radius: 0 6px 6px 0;
}

.udr-orari-per-direzione {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.udr-direction-block .udr-departure-group {
    background: #fff;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.udr-direction-block .udr-departure-info {
    margin-bottom: 0.35rem;
}

.udr-direction-block .udr-day-type {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.udr-direction-block .udr-times-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.udr-direction-block .udr-result-percorso {
    margin-bottom: 0.75rem;
}

/* Percorso sintesi (solo titolo, senza lista fermate) */
.udr-percorso-sintesi .udr-percorso-route-trasferta {
    padding: 0.5rem 0.75rem;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.08) 0%, transparent 100%);
    border-radius: 8px;
    border-left: 4px solid #06b6d4;
}

.udr-percorso-sintesi .udr-percorso-stop.udr-percorso-capolinea {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0e7490;
}

.udr-percorso-sintesi .udr-percorso-stop.udr-percorso-capolinea::before {
    display: none;
}

/* UDR5 specific */
.udr-result-group {
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    background: #f8fafc;
    border-left: 4px solid #06b6d4;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.udr-result-group:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.udr-result-line-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow: visible !important;
}

.udr-header-badges {
    display: flex !important;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0;
}

.udr-result-line-header h4 {
    margin: 0;
    font-size: 1.25rem;
    color: #06b6d4;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    letter-spacing: -0.01em;
}

.udr-direction {
    font-size: 0.9rem;
    color: #0f766e;
    background: #ccfbf1;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

.udr-departure-group {
    margin-bottom: 1rem;
    padding: 1.25rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.udr-departure-group:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.udr-departure-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.udr-day-type {
    font-weight: 600;
    color: #0f766e;
    background: #ccfbf1;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.udr-capolinea {
    color: #666;
}

.udr-times-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.udr-time-chip {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 65px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(6, 182, 212, 0.25);
    transition: all 0.2s ease;
}

.udr-time-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);
}

.udr-disclaimer {
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.udr-disclaimer p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
    line-height: 1.5;
}

.udr-info-message {
    background: #e8f0fe;
    border-left: 4px solid #3A6BB3;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.udr-info-message p {
    margin: 0;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
}

.udr-result-route {
    margin-top: 1rem;
}

.udr-route-toggle {
    padding: 0.5rem 1rem;
    background-color: transparent;
    color: #3A6BB3;
    border: 1px solid #3A6BB3;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.udr-route-toggle:hover {
    background-color: #3A6BB3;
    color: #fff;
}

.udr-route-stops {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.udr-route-stops h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.udr-stops-sequence {
    margin: 0;
    padding-left: 1.5rem;
}

.udr-stops-sequence li {
    margin-bottom: 0.25rem;
    color: #666;
    padding: 0.25rem 0;
}

.udr-stops-sequence li.highlighted {
    background: #fff9e6;
    padding: 0.5rem;
    border-radius: 3px;
    font-weight: 600;
    color: #856404;
    margin: 0.25rem 0;
}

/* PDF Link */
.udr-orari-pdf-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(14, 165, 233, 0.2);
}

.udr-orari-pdf-link {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
    text-align: center;
}

.udr-orari-pdf-link .btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.udr-orari-pdf-link .btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.udr-orari-pdf-link .btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.udr-orari-pdf-link .btn-secondary {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.udr-orari-pdf-link .btn-secondary:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0284c7 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .udr-orari-tool {
        padding: 2rem 1rem;
        min-height: auto;
    }
    
    .udr-orari-tool__title {
        font-size: 2rem;
    }
    
    .udr-orari-tool__subtitle {
        font-size: 1.1rem;
    }
    
    .udr-orari-form {
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .udr-orari-results {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .udr-orari-form {
        grid-template-columns: 1fr;
    }

    .udr-searchbar {
        padding: 0.5rem 0.5rem 0.5rem 0.75rem;
        gap: 0.375rem;
    }

    .udr-searchbar-input {
        font-size: 0.95rem;
        padding: 0.5rem 0.5rem;
    }

    .udr-searchbar-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 10px;
    }

    .udr-searchbar-icon {
        width: 18px;
        height: 18px;
    }

    .udr-searchbar-icon svg,
    .udr-searchbar-btn svg {
        width: 18px;
        height: 18px;
    }

    .udr-result-times,
    .udr-result-stops {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* === RISULTATI MOBILE === */
    
    /* Card risultato */
    .udr-result-item {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .udr-result-item:hover {
        transform: none; /* Disabilita hover su mobile */
    }
    
    /* Header linea */
    .udr-result-line-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .udr-result-line-header h4 {
        font-size: 1rem;
        line-height: 1.3;
        word-break: break-word;
    }
    
    .udr-result-meta {
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .udr-meta-sep {
        display: none;
    }
    
    .udr-meta-percorso {
        display: block;
        width: 100%;
    }
    
    /* Badge UDR */
    .udr-orari-tool .udr-badge,
    .udr-result-line-header .udr-badge {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Blocco direzione */
    .udr-direction-block {
        margin-top: 0.75rem;
        padding: 0.75rem 0;
    }
    
    .udr-direction-header {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    /* Percorso fermate */
    .udr-result-percorso {
        padding: 0.75rem;
    }
    
    .udr-percorso-title {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .udr-bus-line {
        gap: 0;
    }
    
    .udr-percorso-stop {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        margin: 0.15rem 0;
    }
    
    /* Orari */
    .udr-direction-block .udr-departure-group {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .udr-times-chips,
    .udr-direction-block .udr-times-chips {
        gap: 0.35rem;
    }
    
    .udr-time-chip {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .udr-day-type,
    .udr-direction-block .udr-day-type {
        font-size: 0.7rem;
    }
    
    /* Toolbar risultati */
    .udr-results-toolbar {
        margin-bottom: 1rem;
    }
    
    .udr-btn-export-pdf {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Servizio a chiamata */
    .udr-servizio-chiamata-message {
        padding: 1rem;
    }
    
    .udr-servizio-chiamata-message h3 {
        font-size: 1rem;
    }
    
    .udr-servizio-chiamata-details p {
        font-size: 0.85rem;
    }
    
    .udr-servizio-chiamata-apps {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .udr-app-link {
        width: 100%;
        text-align: center;
    }
}

/* === MOBILE SMALL (< 480px) === */
@media (max-width: 480px) {
    .udr-orari-tool {
        padding: 1.5rem 0.75rem;
    }
    
    .udr-orari-tool__title {
        font-size: 1.5rem;
    }
    
    .udr-orari-tool__subtitle {
        font-size: 0.95rem;
    }
    
    .udr-orari-form {
        padding: 1rem;
        border-radius: 16px;
    }
    
    .udr-orari-results {
        padding: 1rem;
        border-radius: 16px;
    }
    
    /* Input ricerca */
    .udr-searchbar {
        padding: 0.375rem;
    }
    
    .udr-searchbar-input {
        font-size: 0.9rem;
        padding: 0.5rem 0.375rem;
    }
    
    .udr-searchbar-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
    
    .udr-searchbar-btn-label {
        display: none;
    }
    
    /* Form controls */
    .udr-form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .udr-form-group input,
    .udr-form-group select {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .udr-time-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .udr-tutti-orari-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Risultati ultra-compatti */
    .udr-result-item {
        padding: 0.875rem;
    }
    
    .udr-result-line-header h4 {
        font-size: 0.95rem;
    }
    
    .udr-time-chip {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .udr-percorso-stop {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }
    
    /* Autocomplete */
    .udr-autocomplete-list {
        max-height: 50vh;
    }
    
    .udr-autocomplete-item {
        padding: 0.75rem;
    }
    
    .udr-autocomplete-content strong {
        font-size: 0.9rem;
    }
    
    .udr-autocomplete-type-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {
    /* Aumenta aree touch */
    .udr-time-chip {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .udr-autocomplete-item {
        min-height: 48px;
    }
    
    .udr-searchbar-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .udr-tutti-orari-btn {
        min-height: 44px;
    }
    
    .udr-line-map-toggle {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }
    
    /* Disabilita hover effects */
    .udr-result-item:hover,
    .udr-time-chip:hover,
    .udr-autocomplete-item:hover {
        transform: none;
    }
}

/* Accessibilità */
.udr-orari-tool [aria-hidden="true"] {
    display: none;
}

.udr-orari-tool [role="listbox"] {
    list-style: none;
}

.udr-orari-tool [role="option"]:focus {
    outline: 2px solid #3A6BB3;
    outline-offset: 2px;
}

/* ============================================
   ROUTE TIMELINE (Rail Verticale)
   ============================================ */

.udr-route {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.udr-route__title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.udr-route__list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    padding-left: 1.5rem;
}

.udr-route__item {
    position: relative;
    padding: 0.5rem 0 0.5rem 2rem;
    min-height: 2.5rem;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
}

.udr-route__item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 1.5rem;
    bottom: -0.5rem;
    width: 2px;
    background: #ccc;
    z-index: 0;
}

.udr-route__item[aria-hidden="true"] {
    display: none;
}

.udr-route__list--expanded .udr-route__item[aria-hidden="true"] {
    display: flex;
}

.udr-route__list--expanded .udr-route__item--collapsed {
    display: none;
}

.udr-route__dot {
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #06b6d4;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #06b6d4;
    z-index: 1;
    flex-shrink: 0;
}

.udr-route__item--capolinea .udr-route__dot {
    width: 1.25rem;
    height: 1.25rem;
    top: 0.625rem;
    background: #0891b2;
    box-shadow: 0 0 0 2px #0891b2, 0 2px 4px rgba(0, 0, 0, 0.2);
}

.udr-route__item--highlighted .udr-route__dot {
    background: #f59e0b;
    box-shadow: 0 0 0 2px #f59e0b, 0 0 0 4px rgba(245, 158, 11, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.udr-route__label {
    color: #333;
    font-size: 0.9rem;
    flex: 1;
}

.udr-route__item--capolinea .udr-route__label {
    font-weight: 600;
    color: #0891b2;
}

.udr-route__item--highlighted .udr-route__label {
    font-weight: 600;
    color: #f59e0b;
}

.udr-route__capolinea-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: normal;
    font-style: italic;
    margin-left: 0.25rem;
}

.udr-route__label--collapsed {
    font-style: italic;
    color: #666;
    font-size: 0.85rem;
}

.udr-route__toggle {
    margin-top: 1rem;
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: 2px solid #06b6d4;
    color: #06b6d4;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.udr-route__toggle:hover {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.udr-route__toggle:focus {
    outline: 2px solid #3A6BB3;
    outline-offset: 2px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .udr-route {
        padding: 1rem;
    }

    .udr-route__list {
        padding-left: 1.25rem;
    }

    .udr-route__item {
        padding-left: 1.75rem;
        font-size: 0.85rem;
    }

    .udr-route__dot {
        width: 0.875rem;
        height: 0.875rem;
    }

    .udr-route__item--capolinea .udr-route__dot {
        width: 1rem;
        height: 1rem;
    }
}

/* Multi-UDR Results */
.udr-multi-udr-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.udr-multi-udr-header h3 {
    font-size: 1.6rem;
    color: #06b6d4;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.udr-multi-udr-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

.udr-results-section {
    margin-bottom: 3rem;
    padding: 1.75rem;
    background: #f8fafc;
    border-radius: 16px;
    border-left: 4px solid #06b6d4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.udr-section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.udr-section-title {
    font-size: 1.35rem;
    color: #06b6d4;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

.udr-section-title::before {
    content: '🚌';
    font-size: 1.2rem;
}

.udr-orari-pdf-links {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ============================================
   UDR LINE MAP - Mappe Leaflet
   ============================================ */

.udr-line-map-wrapper {
    margin: 1.5rem 0;
    border-radius: 16px;
    overflow: hidden;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.udr-line-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
}

.udr-line-map-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.udr-line-map-title::before {
    content: '🗺️';
    font-size: 1.1rem;
}

.udr-line-map-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.udr-line-map-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.udr-line-map-toggle[aria-expanded="false"] .udr-toggle-icon {
    transform: rotate(-90deg);
}

.udr-toggle-icon {
    transition: transform 0.2s ease;
}

.udr-line-map-container {
    height: 350px;
    width: 100%;
    background: #e5e7eb;
    position: relative;
}

.udr-line-map-container.leaflet-container {
    font-family: inherit;
}

/* Popup Leaflet personalizzato */
.udr-line-map-container .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.udr-line-map-container .leaflet-popup-content {
    margin: 10px 14px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.udr-line-map-container .leaflet-popup-content strong {
    color: #0ea5e9;
}

/* Stato nessun dato */
.udr-map-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.95rem;
    text-align: center;
    padding: 1rem;
}

/* Loading mappa */
.udr-line-map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px;
    background: #f1f5f9;
    color: #64748b;
}

.udr-line-map-loading::after {
    content: 'Caricamento mappa...';
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Icona fermata personalizzata */
.udr-map-stop-icon {
    background: transparent !important;
    border: none !important;
}

/* Zoom controls */
.udr-line-map-container .leaflet-control-zoom {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.udr-line-map-container .leaflet-control-zoom a {
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 16px;
    color: #1e293b;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.udr-line-map-container .leaflet-control-zoom a:hover {
    background: #f1f5f9;
    color: #0ea5e9;
}

.udr-line-map-container .leaflet-control-zoom-out {
    border-bottom: none !important;
}

/* Attribution */
.udr-line-map-container .leaflet-control-attribution {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 4px 0 0 0;
}

/* Layer control (toggle direzioni) */
.udr-line-map-container .leaflet-control-layers {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: none;
}

.udr-line-map-container .leaflet-control-layers-expanded {
    padding: 8px 12px;
    background: white;
}

.udr-line-map-container .leaflet-control-layers-overlays label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    margin: 4px 0;
    cursor: pointer;
}

.udr-line-map-container .leaflet-control-layers-overlays label span {
    font-weight: 500;
    color: #1e293b;
}

/* Legenda direzioni */
.udr-map-legend {
    position: absolute;
    bottom: 30px;
    left: 10px;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.8rem;
    z-index: 1000;
}

.udr-map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.udr-map-legend-line {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}

.udr-map-legend-line--andata {
    background: #0ea5e9;
}

.udr-map-legend-line--ritorno {
    background: #14b8a6;
    background-image: repeating-linear-gradient(
        90deg,
        #14b8a6,
        #14b8a6 6px,
        transparent 6px,
        transparent 10px
    );
}

/* Responsive */
@media (max-width: 768px) {
    .udr-line-map-container {
        height: 280px;
    }
    
    .udr-line-map-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .udr-line-map-toggle {
        width: 100%;
        justify-content: center;
    }
}

/* Print styles per PDF */
@media print {
    .udr-line-map-toggle {
        display: none !important;
    }
    
    .udr-line-map-container {
        height: 250px !important;
        page-break-inside: avoid;
    }
}

/* ============================================
   PULSANTI DOWNLOAD PDF UDR
   ============================================ */
.udr-pdf-download-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.udr-pdf-download-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.udr-pdf-download-icon {
    font-size: 1.5rem;
}

.udr-pdf-download-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.udr-pdf-download-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.udr-btn-pdf-udr {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
}

.udr-btn-pdf-udr--udr3 {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    color: #1e40af;
}

.udr-btn-pdf-udr--udr3:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.udr-btn-pdf-udr--udr5 {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
    color: #065f46;
}

.udr-btn-pdf-udr--udr5:hover {
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.udr-btn-pdf-icon {
    font-size: 1.75rem;
}

.udr-btn-pdf-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.udr-btn-pdf-text strong {
    font-size: 1.1rem;
    font-weight: 700;
}

.udr-btn-pdf-text small {
    font-size: 0.85rem;
    opacity: 0.8;
}

.udr-pdf-download-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
}

/* Responsive pulsanti PDF */
@media (max-width: 600px) {
    .udr-pdf-download-buttons {
        flex-direction: column;
    }
    
    .udr-btn-pdf-udr {
        max-width: none;
        justify-content: center;
    }
}

