body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f8f8;
    color: #000;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.train-type:hover {
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}
.card {
    background-color: white;
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}
.card-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 600;
    color: #000;
    letter-spacing: 0.5px;
}
.input-group {
    display: flex;
    margin-bottom: 1.5rem;
}
input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e0e0;
    border-right: none;
    font-size: 0.95rem;
    outline: none;
    background-color: #fff;
    border-radius: 4px 0 0 4px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
input:focus {
    background-color: #fff;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}
.btn-primary {
    background-color: #000;
    color: white;
    border: none;
    padding: 0 1.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    border-radius: 0 4px 4px 0;
    white-space: nowrap;
}
.btn-primary:hover {
    background-color: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.btn-primary:active {
    transform: translateY(1px);
}
.d-none {
    display: none;
}
.text-center {
    text-align: center;
}
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-right-color: #000;
    border-radius: 50%;
    animation: spinner 0.85s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin-bottom: 10px;
}
.loading-text {
    margin: 0;
    color: #000;
    font-size: 0.9rem;
}
@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}
#result {
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
#result.show {
    opacity: 1;
    transform: translateY(0);
}
.mini-card {
    margin-bottom: 1rem;
    background-color: #fff;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    padding: 1.2rem;
    border: 1px solid #f0f0f0;
}
.mini-card:hover {
}
.mini-card-title {
    color: #000;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.mini-card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #f0f0f0;
    z-index: 1;
}
.mini-card-title i {
    color: #000;
}
.mini-card-content {
    color: #000;
    font-weight: 400;
    line-height: 1.6;
    padding: 0.2rem 0 0;
}
.emu-history {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 1.2rem -5px 0.8rem;
    padding: 5px 5px 15px;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.emu-history::-webkit-scrollbar {
    display: none;
}

.emu-tag {
    background: #fff;
    padding: 12px 14px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    margin-right: 10px;
    min-width: 110px;
    flex-shrink: 0;
    scroll-snap-align: start;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.emu-tag:last-child {
    margin-right: 0;
}

.emu-tag:hover {
    border-color: #000;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.emu-number {
    font-weight: 600;
    color: #000;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emu-date {
    font-size: 0.8rem;
    color: #000;
    display: block;
    margin-top: 4px;
    white-space: nowrap;
}

.scroll-hint-right,
.scroll-hint-left {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.4);
    font-size: 16px;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: pulse 1.5s ease-in-out infinite;
}

.scroll-hint-right {
    right: 8px;
}

.scroll-hint-left {
    left: 8px;
    opacity: 0;
}

@keyframes pulse {
    0% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.1);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

.emu-history::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 25px;
    background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.emu-history::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 25px;
    background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.emu-history.scrolled-right::before {
    opacity: 1;
}

.route-info {
    background: #fff;
    padding: 14px;
    margin: 1rem 0;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.route-info:hover {
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}
.station {
    color: #000;
    font-weight: 600;
}
.route-info i {
    color: #000;
    font-size: 0.9rem;
    margin: 0 4px;
}
.emu-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    margin-top: 1rem;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.emu-info:hover {
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}
.emu-image {
    height: 50px;
    object-fit: contain;
}
.emu-details {
    flex: 1;
}
.emu-model {
    font-weight: 500;
    color: #000;
    margin-bottom: 4px;
}
.emu-specs {
    display: flex;
    gap: 16px;
    color: #000;
    font-size: 0.9rem;
}
.train-header {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.2rem;
}
.train-number-name {
    display: flex;
    align-items: center;
    gap: 10px;
}
.train-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #000;
}
.train-name {
    font-size: 1.25rem;
    color: #000;
    font-weight: 500;
}
.train-types {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 5px;
}
.train-type {
    font-size: 0.9rem;
    color: #000;
    padding: 3px 10px;
    background: #fff;
    white-space: nowrap;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.footer {
    text-align: center;
    margin-top: 2rem;
    color: #000;
    font-size: 0.9rem;
}

.emu-history-container {
    position: relative;
    overflow: hidden;
    padding: 0 0 0 10px;
}

.scroll-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    opacity: 0.7;
    transform: translateY(-50%) scale(0.95);
}

.scroll-control:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    background: #000;
    color: #fff;
    border-color: #000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.scroll-left {
    left: 0;
    opacity: 0;
    visibility: hidden;
}

.scroll-right {
    right: 0;
}

.emu-history-container:hover .scroll-control {
    opacity: 1;
    visibility: visible;
}

.scrolled-right .scroll-left {
    opacity: 1;
    visibility: visible;
}

.scroll-hint-right,
.scroll-hint-left {
    display: none;
}


@media (min-width: 768px) {
    .emu-history-container {
        /* overflow: hidden; */
    }
    .scroll-control {
        display: flex;
    }
}

@media (max-width: 767px) {
    .scroll-control {
        display: none;
    }
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1.5rem;
    }
    
    .train-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .emu-specs {
        flex-direction: column;
        gap: 8px;
    }
} 