/* User Menu Styles */
.user-menu {
    position: relative;
}

.user-dropdown {
    position: relative;
}

.user-name-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.user-name-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-name {
    font-weight: 500;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
}

.user-name-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-size: 14px;
}

.dropdown-item:hover:not(.balance-item) {
    background: rgba(255, 255, 255, 0.1);
}

.balance-item {
    justify-content: space-between;
    cursor: default;
    color: rgba(255, 255, 255, 0.8);
}

.balance-label {
    font-weight: 500;
}

.balance-value {
    font-weight: 600;
    color: #4ade80;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.dropdown-link {
    color: #fff !important;
}

.dropdown-button {
    text-align: left;
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile User Menu */
.mobile-user-menu {
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 15px;
}

.mobile-user-info {
    margin-bottom: 15px;
}

.mobile-user-name {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

.mobile-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-balance-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.mobile-balance-value {
    color: #4ade80;
    font-weight: 600;
    font-size: 14px;
}

.mobile-user-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-user-link {
    display: block;
    padding: 12px;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.mobile-user-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-logout-mobile {
    width: 100%;
    padding: 12px;
    background: rgba(220, 38, 38, 0.2);
    color: #fff;
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-logout-mobile:hover {
    background: rgba(220, 38, 38, 0.3);
}

.mobile-auth-buttons {
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 15px;
}

/* Orders Page Styles */
.orders-section {
    padding: 40px 0;
    min-height: 60vh;
}

.orders-header {
    text-align: center;
    margin-bottom: 40px;
}

.orders-header h1 {
    font-size: 2.5em;
    color: #fff;
    margin-bottom: 10px;
}

.orders-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4;
}

.orders-loading {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.8);
}

.orders-loading p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin-top: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.orders-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.8);
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.orders-empty h3 {
    color: #fff;
    margin-bottom: 10px;
    font-weight: 600;
}

.orders-empty p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    line-height: 1.5;
}

.orders-empty .btn-primary {
    margin-top: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.orders-empty .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin: 0;
}

.order-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.order-card:hover {
    transform: translateY(-2px);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.order-number {
    font-weight: 600;
    color: #fff;
    font-size: 18px;
}

.order-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.status-confirmed { background: rgba(40, 167, 69, 0.2); color: #28a745; }
.status-processing { background: rgba(0, 123, 255, 0.2); color: #007bff; }
.status-shipped { background: rgba(23, 162, 184, 0.2); color: #17a2b8; }
.status-delivered { background: rgba(40, 167, 69, 0.2); color: #28a745; }
.status-cancelled { background: rgba(220, 53, 69, 0.2); color: #dc3545; }

.order-details {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.order-amount {
    font-weight: 600;
    color: #4ade80;
}

.order-items {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.item-name {
    flex: 1;
}

.item-quantity {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 15px;
}

.item-price {
    font-weight: 500;
    color: #4ade80;
}

/* User Statistics Styles */
.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-item {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.65);
}

.stat-item:hover {
    background: rgba(0, 0, 0, 0.78);
    transform: translateY(-2px);
}

.stats-loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.stats-error {
    text-align: center;
    padding: 20px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    margin-bottom: 20px;
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-title {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Order Card Styles */
.order-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
}

.order-product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 15px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f3f4;
}

.order-number {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.order-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-confirmed, .status-paid {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #74c0fc;
}

.status-processing {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #ced4da;
}

.status-shipped {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #74c0fc;
}

.status-delivered, .status-completed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-return_in_progress {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-return {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-refunded {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #74c0fc;
}

.status-completed_delivered {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.order-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.order-date, .order-amount, .order-payment, .order-tracking {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.detail-value {
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 600;
}

.tracking-number {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* Order Items Styles */
.order-items {
    margin-bottom: 20px;
}

.items-header {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

.items-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
}

.order-item:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c3e50;
}

.item-description {
    font-size: 0.85rem;
    color: #6c757d;
}

.item-details {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
}

.item-quantity {
    color: #6c757d;
    font-size: 0.9rem;
}

.item-price {
    color: #28a745;
    font-size: 0.95rem;
}

.items-placeholder {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Order Actions */
.order-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f1f3f4;
}

.btn-secondary, .btn-danger, .btn-primary {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Pagination Styles */
.orders-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.pagination-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-pagination {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #6c757d;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.btn-pagination:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-pagination.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: #6c757d;
}

.pagination-info {
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .order-card {
        padding: 16px;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .order-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .order-item {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .item-details {
        align-self: flex-end;
    }
    
    .order-actions {
        justify-content: center;
    }
    
    .pagination-buttons {
        gap: 3px;
    }
    
    .btn-pagination {
        padding: 6px 10px;
        font-size: 0.85rem;
        min-width: 35px;
    }
}

/* Дополнительные стили для страниц пользователя */
.user-content {
    padding: 20px 0;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header h2 {
    color: #fff;
    font-size: 1.8rem;
    margin: 0;
}

.page-header .stat-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
}

/* Анимации для статистики */
.stat-item {
    animation: slideInUp 0.3s ease-out;
    animation-fill-mode: both;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }
.stat-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}