* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-section {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
}

input[type="text"] {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

button {
    padding: 15px 30px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
    min-width: 100px;
}

button:hover:not(:disabled) {
    background: #45a049;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #ff5252;
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vehicle-info h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.label {
    color: #666;
    font-weight: 500;
}

.value {
    color: #333;
    font-weight: 600;
}

.badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.stats {
    display: flex;
    justify-content: center;
}

.stat-item {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    flex: 1;
}

.stat-item.idle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
}

.card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.stops-list {
    max-height: 400px;
    overflow-y: auto;
}

.stop-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.stop-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #333;
}

.stop-duration {
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 14px;
}

.stop-details {
    font-size: 14px;
    color: #666;
}

.stop-time {
    font-weight: 500;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 20px;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 24px;
    }

    .input-group {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .stat-value {
        font-size: 28px;
    }
}

.stops-list::-webkit-scrollbar {
    width: 6px;
}

.stops-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.stops-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.stops-list::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Активный простой */
.active-idle-card {
    animation: slideIn 0.3s ease;
}

.active-idle-card.critical {
    animation: pulse 1.5s ease-in-out infinite;
    border: 3px solid #ff5252;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 16px rgba(255, 82, 82, 0.4);
        transform: scale(1.02);
    }
}

.stat-item.active-idle {
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    color: white;
}

.active-idle-card.critical .stat-item.active-idle {
    background: linear-gradient(135deg, #ff3838 0%, #a61e1e 100%);
}

.active-idle-location {
    font-size: 14px;
    margin-top: 10px;
    opacity: 0.9;
    font-weight: 400;
}