
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('../img/background_mda_2000x1335.jpg') no-repeat center center fixed;
    min-height: 100vh;
    padding: 20px;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
}

.spinner-overlay { 
    display:none; 
    position:fixed; 
    top:0; 
    left:0; 
    width:100%; 
    height:100%; 
    background:rgba(255,255,255,0.8); 
    z-index:9999; 
    align-items:center; 
    justify-content:center; 
}

.spinner { 
    border:6px solid #f3f3f3; 
    border-top:6px solid #0056a4; 
    border-radius:50%; 
    width:60px; 
    height:60px; 
    animation:spin 1s linear infinite; 
}

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

.ui-autocomplete {
    background: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 0.75rem;
    margin: 0;
    padding: 0.25rem 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 240px;
    max-width: 240px;
    box-sizing: border-box;
}


.ui-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    transition: background 0.2s, color 0.2s;
}

.ui-menu-item:hover,
.ui-menu-item.ui-state-active {
    color: #fff !important;
    border: #0056a4 !important;
}

.input-error {
    border-color: red !important;
    background-color: #ffecec;
}

.error-msg {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    color: red;
    font-size: 0.8em;
    white-space: nowrap;
}

.lang-switch {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 10000;
}

.lang-switch select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #0056a4;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

.search-container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    text-align: center;
}

.logo {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.form-group {
    display: inline-flex;
    flex-direction: column;
    min-width: 150px;
    position: relative;
    vertical-align: top;
    margin-right: 12px;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.form-group input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #0056a4;
}

.search-button {
    background-color: #0056a4;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 15px;
    min-width: 200px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.search-button:hover {
    background-color: #003d80;
    transform: scale(1.03);
}

.results-wrapper {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.results-header {
    text-align: center;
    margin-bottom: 25px;
}

.results-header h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.results-destination {
    color: #666;
    font-size: 16px;
    background-color: rgba(0, 86, 164, 0.1);
    padding: 8px 20px;
    border-radius: 20px;
    display: block;
    font-weight: 500;
}

.results-count {
    color: #666;
    font-size: 16px;
    background-color: rgba(0, 86, 164, 0.1);
    padding: 8px 20px;
    border-radius: 20px;
    display: block;
    font-weight: 500;
    margin-top: 10px;
}

.results-grid {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.connection-card-new {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.connection-card-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 86, 164, 0.2);
    border-color: rgba(0, 86, 164, 0.3);
}

.card-main-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-time-section {
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 12px;
}

.card-time {
    text-align: left;
    flex-shrink: 0;
    margin-left: 10px;
    margin-right: 40px;
}

.time-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-value {
    font-size: 28px;
    font-weight: 700;
    color: #0056a4;
}

.card-duration {
    flex: 1;
    text-align: center;
}

.duration-text {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    font-weight: 500;
}

.card-info-section {
    display: flex;
    gap: 24px;
    align-items: center;
}

.card-carrier,
.card-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 14px;
}

.card-carrier svg,
.card-date svg {
    color: #0056a4;
    flex-shrink: 0;
}

.card-details-btn {
    background: linear-gradient(135deg, #0056a4 0%, #003d80 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 86, 164, 0.3);
}

.card-pdf-btn {
    background: linear-gradient(135deg, #0056a4 0%, #003d80 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 86, 164, 0.3);
}

.card-details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 86, 164, 0.4);
    background: linear-gradient(135deg, #003d80 0%, #002a5c 100%);
}

.card-details-btn svg {
    transition: transform 0.3s ease;
}

.card-details-btn:hover svg {
    transform: translateX(3px);
}

.card-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 86, 164, 0.4);
    background: linear-gradient(135deg, #003d80 0%, #002a5c 100%);
}

.card-pdf-btn svg {
    transition: transform 0.3s ease;
}

.card-pdf-btn:hover svg {
    transform: translateX(3px);
}

.no-results {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 60px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.no-results h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 15px;
}

.no-results p {
    color: #666;
    font-size: 16px;
    margin-bottom: 10px;
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 2000;
    left: 0; 
    top: 0;
    width: 100%; 
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    border: none;
    line-height: 0;
    text-align: center;
    padding: 0;
}

#modal-title {
    background: linear-gradient(135deg, #0056a4 0%, #003d80 100%);
    color: white;
    padding: 24px;
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 20px 20px 0 0;
}

.modal-title-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-right: 40px;
}

.modal-route {
    font-size: 20px;
    font-weight: 700;
}

.modal-date {
    font-size: 14px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

#modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

#modal-body::-webkit-scrollbar {
    width: 8px;
}

#modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#modal-body::-webkit-scrollbar-thumb {
    background: #0056a4;
    border-radius: 10px;
}

.modal-main-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(0, 86, 164, 0.05) 0%, rgba(0, 86, 164, 0.1) 100%);
    padding: 20px;
    border-radius: 16px;
}

.modal-time-box {
    text-align: center;
    flex-shrink: 0;
}

.modal-time-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.modal-time-value {
    font-size: 32px;
    font-weight: 700;
    color: #0056a4;
}

.modal-duration-box {
    flex: 1;
    text-align: center;
}

.modal-duration-text {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    font-weight: 600;
}

.modal-carrier-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 20px;
}

.modal-carrier-box svg {
    color: #0056a4;
    flex-shrink: 0;
}

.modal-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
    margin: 24px 0;
}

.modal-stops-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-stops-title::before {
    content: "";
    width: 4px;
    height: 20px;
    background: #0056a4;
    border-radius: 2px;
}

.modal-stop-item {
    display: flex;
    gap: 16px;
    margin-bottom: 4px;
}

.stop-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.stop-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0056a4 0%, #003d80 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 86, 164, 0.3);
}

.stop-line {
    width: 3px;
    flex: 1;
    background: linear-gradient(to bottom, #0056a4, rgba(0, 86, 164, 0.3));
    margin: 4px 0;
    border-radius: 2px;
}

.stop-content {
    flex: 1;
    padding: 6px 0 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.stop-name {
    font-size: 15px;
    color: #333;
    font-weight: 500;
    flex: 1;
}

.stop-time {
    font-size: 14px;
    color: #0056a4;
    font-weight: 700;
    background: rgba(0, 86, 164, 0.1);
    padding: 4px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.no-stops-msg {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

@media (max-width: 1000px) {
    .connection-card-new {
        flex-direction: column;
        align-items: stretch;
    }

    .card-time-section {
        flex-direction: column;
        gap: 12px;
    }

    .card-time {
        text-align: center;
        flex-shrink: 0;
        margin-left: 0px;
        margin-right: 0px;
    }

    .card-duration svg {
        transform: rotate(90deg);
        width: 30px;
        height: 100px;
    }

    .card-info-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .card-details-btn {
        width: 100%;
        justify-content: center;
    }

    .card-pdf-btn {
        width: 100%;
        justify-content: center;
    }

    .modal-main-info {
        flex-direction: column;
    }

    .modal-duration-box svg {
        transform: rotate(90deg);
    }

    .modal-title-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .stop-content {
        flex-direction: column;
        gap: 4px;
    }

    .stop-times {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .stop-time-box {
        display: flex;
        justify-content: flex-start;
        gap: 8px;
        align-items: center;
    }

    .stop-time-label {
        font-size: 11px;
        color: #666;
        font-weight: 600;
        text-transform: uppercase;
    }

    .stop-time-value {
        font-size: 14px;
        font-weight: 700;
        color: #0056a4;
        background: rgba(0, 86, 164, 0.1);
        padding: 4px 8px;
        border-radius: 6px;
        white-space: nowrap;
    }

    
}

.time-stop {
        font-size: 13px;
        color: #555;
        margin-top: 4px;
        font-weight: 500;
        background: rgba(0, 86, 164, 0.1);
        padding: 3px 10px;
        border-radius: 8px;
        display: inline-block;
    }

.search-form .form-group {
    flex: 1;
    min-width: 200px;
    max-width: 240px;
}

.search-form .form-group input {
    width: 100%;
}

.card-buttons {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
}

.stop-time {
    display: grid;
    grid-template-columns: 100px auto;
}
.stop-time strong {
    text-align: left;
}