/* Стили для профиля пользователя */
.profile-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    padding: 25px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.profile-modal.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 91, 170, 0.2);
}

.profile-title {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
    margin: 0;
}

.profile-close {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(0, 91, 170, 0.2);
    font-size: 20px;
    cursor: pointer;
    color: var(--primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.profile-close:hover {
    background: rgba(0, 91, 170, 0.1);
    transform: rotate(90deg);
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-section {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(0, 91, 170, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
    padding: 8px 12px;
    background: rgba(0, 91, 170, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 91, 170, 0.1);
}

.user-id-badge {
    background: linear-gradient(135deg, var(--primary), #0088cc);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 1px;
    margin-top: 10px;
}

.garage-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.8);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 91, 170, 0.1);
    outline: none;
}

.btn-save {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-save:hover {
    background: #e05a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.orders-section {
    margin-top: 10px;
}

.order-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.status-item {
    background: rgba(0, 91, 170, 0.05);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(0, 91, 170, 0.1);
}

.status-count {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.status-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.btn-orders {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
}

.btn-orders:hover {
    background: #004a8f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 91, 170, 0.3);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.btn-logout {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.garage-info {
    background: rgba(230, 242, 255, 0.5);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid rgba(0, 91, 170, 0.2);
}

.garage-item {
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
}

.garage-item:last-child {
    margin-bottom: 0;
}

.garage-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.garage-value {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.empty-garage {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* Стили для заказов */
.orders-container {
    margin-bottom: 15px;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #ddd;
    transition: all 0.3s;
}

.order-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.order-id {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.order-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.order-date {
    font-size: 0.8rem;
    color: #666;
}

/* Статусы заказов */
.status-pending {
    border-left-color: #ff9800;
    background: rgba(255, 152, 0, 0.05);
}

.status-pending .order-status {
    background: #fff3e0;
    color: #f57c00;
}

.status-confirmed {
    border-left-color: #4caf50;
    background: rgba(76, 175, 80, 0.05);
}

.status-confirmed .order-status {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-shipped {
    border-left-color: #2196f3;
    background: rgba(33, 150, 243, 0.05);
}

.status-shipped .order-status {
    background: #e3f2fd;
    color: #1565c0;
}

.status-delivered {
    border-left-color: #9c27b0;
    background: rgba(156, 39, 176, 0.05);
}

.status-delivered .order-status {
    background: #f3e5f5;
    color: #7b1fa2;
}

.status-cancelled {
    border-left-color: #f44336;
    background: rgba(244, 67, 54, 0.05);
}

.status-cancelled .order-status {
    background: #ffebee;
    color: #c62828;
}

.empty-orders {
    text-align: center;
    padding: 30px;
    color: #999;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.empty-text {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.empty-subtext {
    font-size: 0.9rem;
    color: #888;
}

.btn-refresh-orders {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    width: 100%;
}

.btn-refresh-orders:hover {
    background: #004a8f;
    transform: translateY(-1px);
}

/* Стили для попапа подписки */
.subscription-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 1002;
    padding: 25px;
    overflow-y: auto;
}

.subscription-popup.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 91, 170, 0.2);
}

.subscription-header h2 {
    color: var(--primary);
    margin: 0;
    font-size: 1.5rem;
}

.subscription-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.subscription-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.subscription-description {
    text-align: center;
    margin-bottom: 25px;
    color: #666;
    line-height: 1.5;
}

.subscription-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.subscription-plan-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.subscription-plan-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(0, 91, 170, 0.15);
}

.subscription-plan-card.selected {
    border-color: var(--primary);
    background: rgba(0, 91, 170, 0.05);
}

.plan-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.plan-price {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.plan-limit {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 15px;
}

.plan-period {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 15px;
}

.btn-select-plan {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    width: 100%;
}

.btn-select-plan:hover {
    background: #004a8f;
}

.subscription-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.subscription-note {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Стили для попапа оплаты */
.payment-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 1003;
    padding: 25px;
    overflow-y: auto;
}

.payment-popup.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 91, 170, 0.2);
}

.payment-header h2 {
    color: var(--primary);
    margin: 0;
    font-size: 1.5rem;
}

.payment-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.payment-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.payment-info {
    background: rgba(0, 91, 170, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.payment-plan-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.payment-amount {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.payment-details {
    color: #666;
    line-height: 1.5;
}

.payment-details p {
    margin: 8px 0;
}

.payment-test {
    background: #fff3e0;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #ff9800;
}

.payment-test h3 {
    color: #e65100;
    margin-bottom: 10px;
    text-align: center;
}

.payment-test p {
    color: #666;
    text-align: center;
    margin-bottom: 20px;
}

.test-payment-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-payment-success {
    background: #4caf50;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-payment-success:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-payment-failure {
    background: #f44336;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-payment-failure:hover {
    background: #da190b;
    transform: translateY(-2px);
}

/* Оверлеи */
#subscription-overlay,
#payment-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    backdrop-filter: blur(5px);
}

#subscription-overlay.active,
#payment-overlay.active {
    display: block;
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .profile-modal {
        width: 98%;
        padding: 20px;
    }
    
    .user-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .order-status-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-section {
        padding: 15px;
    }

    .subscription-popup {
        width: 95%;
        padding: 20px;
    }
    
    .payment-popup {
        width: 95%;
        padding: 20px;
    }
    
    .subscription-plans {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-modal {
        padding: 15px;
    }
    
    .profile-title {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 1rem;
    }

    .subscription-popup {
        padding: 15px;
    }
    
    .payment-popup {
        padding: 15px;
    }
    
    .plan-price {
        font-size: 1.5rem;
    }
    
    .payment-amount {
        font-size: 1.5rem;
    }
}