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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0f;
    color: #ffffff;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.6;
    position: relative;
}

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

.header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(45deg, #00d4ff, #5b86e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.header p {
    color: #a0a0a0;
    font-size: 14px;
}

.search-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.search-box {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 12px 24px;
    color: #ffffff;
    font-size: 14px;
    width: 400px;
    max-width: 100%;
    outline: none;
    transition: all 0.3s ease;
}

.search-box::placeholder {
    color: #a0a0a0;
}

.search-box:focus {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.routes-grid {
    display: grid;
    gap: 20px;
}

.route-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.route-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #5b86e5);
}

.route-card.expanded {
    background: linear-gradient(135deg, #1e1e35 0%, #1a2147 100%);
}

.route-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
}

.route-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.route-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
}

.route-arrow {
    color: #00d4ff;
    font-size: 16px;
}

.date-badge {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #00d4ff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.route-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.offers-count {
    background: rgba(91, 134, 229, 0.2);
    border: 1px solid rgba(91, 134, 229, 0.3);
    color: #5b86e5;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.expand-icon {
    color: #00d4ff;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.route-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.stats-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 9px;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-agent {
    font-size: 9px;
    background: linear-gradient(45deg, #00d4ff, #5b86e5);
    color: #0a0a0f;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.offers-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
}

.route-card.expanded .offers-content {
    max-height: 2000px;
    opacity: 1;
    padding-top: 12px;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.offers-grid.single-offer {
    grid-template-columns: 1fr 1fr;
}

.offers-grid.single-offer .offer-card:first-child {
    max-width: 100%;
}

.offer-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.offer-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.1);
}

.offer-card.cheapest {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

.agent-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.agent-name {
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow: hidden;
}

.agent-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-icon {
    width: 8px;
    height: 8px;
    background: #00d4ff;
    border-radius: 50%;
}

.price {
    font-size: 14px;
    font-weight: 700;
    color: #00d4ff;
    white-space: nowrap;
}

.price-unit {
    font-size: 9px;
    color: #a0a0a0;
    font-weight: 400;
}

.airlines {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
}

.airline-badge {
    background: rgba(255, 149, 0, 0.15);
    border: 1px solid rgba(255, 149, 0, 0.3);
    color: #ff9500;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.best-badge {
    background: linear-gradient(45deg, #00d4ff, #5b86e5);
    color: #0a0a0f;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.tech-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .offers-grid {
        grid-template-columns: 1fr;
    }
    
    .route-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .stats-compact {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .search-box {
        width: 100%;
    }
}

/* Анимация загрузки */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s infinite;
}

/* Scrollbar стилизация */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}