/* Дополнительные стили для совместимости */
.error-message {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.form-control.error {
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-control.success {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.alert {
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

.alert-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-warning {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

/* Баннеры */
.block-banner {
    background: #faecec;
    border-radius: 14px;
    padding: 18px 20px 14px 20px;
    margin-bottom: 20px;
    position: relative;
    border-left: 6px solid #f65446;
}

.block-banner-title {
    color: #f65446;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.block-banner-text {
    color: #333;
    font-size: 17px;
}

.warn-banner {
    background: #fff7e6;
    border-radius: 14px;
    padding: 18px 20px 14px 20px;
    margin-bottom: 20px;
    position: relative;
    border-left: 6px solid #fbc02d;
}

.warn-banner-title {
    color: #fbc02d;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.warn-banner-text {
    color: #333;
    font-size: 17px;
}

/* Дополнительные стили для форм */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #5f6368;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 18px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: #f65446;
    outline: none;
    box-shadow: 0 0 0 3px rgba(246, 84, 70, 0.1);
}

.form-control.error {
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-control.success {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.error-message {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.success-message {
    color: #4caf50;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

/* Кнопки */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 18px;
    border: none;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    margin: 10px 0;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #f65446 0%, #e53e3e 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #d32f2f 100%);
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #5f6368;
    border: 1px solid #dadce0;
}

.btn-outline {
    background: transparent;
    color: #f65446;
    border: 1px solid #f65446;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
    display: inline-block;
}

/* Шапка */
.header {
    background-color: #fff;
    color: #f65446;
    padding: 15px;
    text-align: center;
    font-size: clamp(18px, 4vw, 28px);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(246, 84, 70, 0.08);
    opacity: 0;
    animation: header-fade-slide 0.7s cubic-bezier(0.4,0,0.2,1) forwards;
}

.header-title {
    flex-grow: 1;
    text-align: center;
    transition: color 0.2s, text-shadow 0.2s;
    cursor: pointer;
}

.header-title:hover {
    color: #d13a2f;
    text-shadow: 0 2px 8px rgba(246, 84, 70, 0.10);
}

/* Основной контент */
.content {
    padding: 16px;
}

/* Нижняя навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 4px 0 2px 0;
    max-width: 480px;
    margin: 0 auto;
    z-index: 100;
    height: 60px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: #5f6368;
    cursor: pointer;
    padding: 0 2px;
    flex: 1;
    transition: color 0.3s;
    min-width: 0;
    min-height: 0;
    user-select: none;
    justify-content: center;
    line-height: 1.1;
    word-break: break-word;
}

.nav-item div {
    text-align: center;
    white-space: pre-line;
    font-size: 14px;
    line-height: 1;
    margin-top: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item.active {
    color: #4e89bf;
}

.nav-item.active .nav-icon {
    color: #4e89bf;
}

.nav-icon {
    font-size: 18px;
    margin-bottom: 0;
    transition: color 0.3s;
}

@keyframes header-fade-slide {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Результаты поиска */
.search-results {
    margin-top: 20px;
}

.ride-card {
    background: white;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 16px;
    overflow: hidden;
    padding: 16px;
}

.ride-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ride-from, .ride-to {
    font-weight: 500;
    font-size: 16px;
}

.ride-arrow {
    color: #5f6368;
    font-size: 18px;
}

.ride-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ride-datetime {
    color: #5f6368;
    font-size: 14px;
}

.ride-price {
    font-weight: 600;
    font-size: 18px;
    color: #f65446;
}

.ride-driver {
    color: #5f6368;
    font-size: 14px;
    margin-bottom: 12px;
}

.book-ride-btn {
    width: 100%;
}

.results-header {
    margin-bottom: 16px;
}

.results-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #202124;
    margin: 0;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #5f6368;
}

.no-results p {
    margin: 0;
    font-size: 16px;
}

.loading {
    text-align: center;
    padding: 40px 20px;
}

.loading .spinner {
    margin-bottom: 16px;
}

.loading p {
    color: #5f6368;
    margin: 0;
}

.error {
    text-align: center;
    padding: 40px 20px;
    color: #d32f2f;
}

.error p {
    margin: 0;
    font-size: 16px;
}

.btn-danger {
    background: linear-gradient(135deg, #d32f2f, #c62828);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c62828, #b71c1c);
}

.btn-success {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #388e3c, #2e7d32);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.w-100 {
    width: 100%;
}

/* Утилиты */
.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }
.mt-30 { margin-top: 30px; }

.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-25 { margin-bottom: 25px; }
.mb-30 { margin-bottom: 30px; }

.ml-10 { margin-left: 10px; }
.mr-10 { margin-right: 10px; }

.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }

.w-100 { width: 100%; }
.w-50 { width: 50%; }

.h-100 { height: 100%; }

/* Скрытие элементов */
.d-none {
    display: none !important;
}

/* Стили для экранов */
.screen {
    display: none;
}

/* Стили для модальных окон */
#cancelModal {
    display: none;
}

#connectionStatus {
    display: none;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

/* Позиционирование */
.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.position-fixed {
    position: fixed;
}

/* Z-index */
.z-1 { z-index: 1; }
.z-10 { z-index: 10; }
.z-100 { z-index: 100; }
.z-1000 { z-index: 1000; }

/* Overflow */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

/* Border radius */
.rounded {
    border-radius: 8px;
}

.rounded-lg {
    border-radius: 12px;
}

.rounded-xl {
    border-radius: 16px;
}

.rounded-full {
    border-radius: 50%;
}

/* Shadows */
.shadow {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.shadow-lg {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.shadow-xl {
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* Transitions */
.transition {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Платежные формы */
.card-payment-form {
    padding: 20px 0;
}

.payment-security {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #6c757d;
}

.payment-security i {
    color: #28a745;
}

.sbp-qr-container {
    text-align: center;
    padding: 20px;
}

.qr-code {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.qr-code canvas {
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.qr-instructions {
    text-align: left;
    color: #6c757d;
}

.qr-instructions p {
    margin: 8px 0;
    font-size: 14px;
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .form-control {
        font-size: 14px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .form-control {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Стили для кнопки редактирования профиля */
.profile-edit-section {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.profile-edit-btn {
    width: 100%;
    background: #f65446;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-edit-btn:hover {
    background: #e53935;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(246, 84, 70, 0.3);
}

.profile-edit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(246, 84, 70, 0.2);
}

.profile-edit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
