* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
}

.title i {
    margin-right: 15px;
    color: #ffd700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.admin-link {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.admin-link i {
    font-size: 1rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-btn:hover {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
}

.tab-btn.active {
    color: #4facfe;
    background: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    animation: slideIn 0.3s ease-out;
}

.tab-btn i {
    font-size: 1.2rem;
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.route-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.form-group label i {
    color: #4facfe;
}

select {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

select:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
    transform: translateY(-2px);
}

.route-points {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.route-point {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    animation: slideInLeft 0.4s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.route-point:hover {
    border-color: #4facfe;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.route-point-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.route-point-header label {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.route-point-header label i {
    color: #4facfe;
}

.remove-route-point-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.remove-route-point-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.remove-route-point-btn i {
    font-size: 10px;
}

.route-point label {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-point label i {
    color: #4facfe;
}

.add-city-btn {
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0.7;
    pointer-events: none;
}

.add-city-btn.active {
    opacity: 1;
    pointer-events: all;
}

.add-city-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.add-city-btn i {
    transition: transform 0.3s ease;
}

.add-city-btn:hover i {
    transform: rotate(90deg);
}

.checkbox-group {
    margin: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
    background: white;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #4facfe;
    border-color: #4facfe;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.checkbox-label i {
    color: #4facfe;
}

.calculate-btn {
    padding: 18px 30px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(79, 172, 254, 0.4);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

.result {
    margin-top: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    overflow: hidden;
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result.hidden {
    display: none;
}

.result-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.result-header i {
    font-size: 1.4rem;
    color: #ffd700;
}

.result-content {
    padding: 25px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffd700;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    margin-top: 10px;
    padding-top: 20px;
}

.result-item .label {
    font-weight: 500;
}

.result-item .value {
    font-weight: 600;
    color: #ffd700;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 15px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .admin-link {
        position: static;
        margin-top: 15px;
        display: inline-flex;
        justify-content: center;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 15px;
        font-size: 1rem;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .route-form {
        gap: 20px;
    }
    
    select {
        padding: 12px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .route-point {
        padding: 15px;
    }
    
    .route-point-header {
        margin-bottom: 6px;
    }
    
    .remove-route-point-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .add-city-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .calculate-btn {
        padding: 15px 25px;
        font-size: 1rem;
    }
    
    .result-header {
        padding: 15px 20px;
    }
    
    .result-header h3 {
        font-size: 1.1rem;
    }
    
    .result-content {
        padding: 20px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .result-item.total {
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .route-form {
        gap: 15px;
    }
    
    .route-point {
        padding: 12px;
    }
    
    .route-point-header {
        margin-bottom: 5px;
    }
    
    .remove-route-point-btn {
        width: 22px;
        height: 22px;
        font-size: 9px;
    }
    
    .result-header {
        padding: 12px 15px;
    }
    
    .result-content {
        padding: 15px;
    }
}

/* Анимации для интерактивных элементов */
.form-group, .route-point, .checkbox-label {
    animation: fadeInUp 0.4s ease-out;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.route-point:nth-child(1) { animation-delay: 0.3s; }
.route-point:nth-child(2) { animation-delay: 0.4s; }
.route-point:nth-child(3) { animation-delay: 0.5s; }

/* Эффект пульсации для кнопок */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(79, 172, 254, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0);
    }
}

.calculate-btn:hover {
    animation: pulse 1.5s infinite;
}

/* Стили для скроллбара */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3a8bfe 0%, #00d4fe 100%);
} 