/* 
 * User Account Styles 
 */

.account-sidebar {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.account-sidebar .nav-link {
    color: var(--bs-dark);
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.account-sidebar .nav-link:hover,
.account-sidebar .nav-link.active {
    background-color: var(--bs-primary);
    color: white;
}

.account-sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

.account-content {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.account-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.account-title {
    margin-bottom: 0;
    font-weight: 600;
}

/* Profile */
.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid #eee;
}

.avatar-upload {
    position: relative;
    width: 120px;
    margin: 0 auto 20px;
}

.avatar-upload .avatar-edit {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 34px;
    height: 34px;
    background-color: var(--bs-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
}

.avatar-upload input {
    display: none;
}

/* Orders */
.order-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.order-number {
    font-weight: 600;
}

.order-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending {
    background-color: #ffeeba;
    color: #856404;
}

.status-processing {
    background-color: #b8daff;
    color: #004085;
}

.status-shipped {
    background-color: #c3e6cb;
    color: #155724;
}

.status-delivered {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f5c6cb;
    color: #721c24;
}

.order-product {
    display: flex;
    margin-bottom: 10px;
}

.order-product-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 15px;
    background-color: white;
    padding: 5px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.order-product-name {
    font-weight: 500;
}

.order-product-price {
    font-weight: 500;
    color: var(--bs-primary);
}

.order-total {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid #eee;
}

.order-total-label {
    font-weight: 600;
}

.order-total-value {
    font-weight: 600;
    color: var(--bs-primary);
}

/* Order Details */
.order-detail-header {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.order-detail-info {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.order-detail-info div {
    margin-bottom: 15px;
}

.order-detail-label {
    font-weight: 500;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.order-detail-value {
    font-weight: 600;
}

.order-detail-products {
    margin-top: 30px;
}

.order-detail-product {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.order-detail-product:last-child {
    border-bottom: none;
}

.order-detail-product-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background-color: white;
    padding: 5px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-right: 15px;
}

.order-detail-product-name {
    font-weight: 500;
}

.order-detail-product-price {
    color: var(--bs-primary);
    font-weight: 500;
}

.order-detail-product-quantity {
    color: #666;
}

.order-detail-summary {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.order-detail-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.order-detail-summary-row:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.order-detail-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Address Book */
.address-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
}

.address-card.default {
    border-color: var(--bs-primary);
}

.address-card.default::after {
    content: 'Mặc định';
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--bs-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.address-name {
    font-weight: 600;
    margin-bottom: 10px;
}

.address-details {
    margin-bottom: 15px;
    line-height: 1.6;
}

.address-actions {
    display: flex;
    gap: 10px;
}

/* Wishlist */
.wishlist-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.wishlist-item:last-child {
    border-bottom: none;
}

.wishlist-item-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background-color: white;
    padding: 5px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-right: 15px;
}

.wishlist-item-name {
    font-weight: 500;
}

.wishlist-item-price {
    color: var(--bs-primary);
    font-weight: 500;
    margin-top: 5px;
}

.wishlist-item-actions {
    margin-top: 10px;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .account-sidebar {
        margin-bottom: 30px;
    }
}

@media (max-width: 767px) {
    /* Mobile navigation tabs - Clean & modern design */
    .account-mobile-tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        background: #ffffff;
        padding: 8px;
        border-radius: 20px;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
        position: sticky;
        top: 60px;
        z-index: 20;
        margin: 0 -10px 20px -10px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        border: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .account-mobile-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .account-mobile-tabs .tab-btn {
        flex: 1;
        background: transparent;
        border: none;
        padding: 12px 10px;
        font-size: 12px;
        font-weight: 500;
        border-radius: 14px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 70px;
        color: #6b7280;
        transition: all 0.25s ease;
        position: relative;
    }
    
    .account-mobile-tabs .tab-btn i { 
        font-size: 20px; 
        margin-bottom: 2px;
        transition: all 0.25s ease;
    }
    
    .account-mobile-tabs .tab-btn:hover {
        background: #f3f4f6;
        color: #374151;
    }
    
    .account-mobile-tabs .tab-btn.active {
        background: #3b82f6;
        color: #ffffff;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
        transform: translateY(-1px);
    }
    
    .account-mobile-tabs .tab-btn.active i {
        color: #ffffff;
    }
    
    .account-mobile-tabs .tab-btn.text-danger.active { 
        background: #ef4444;
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
        color: #ffffff;
    }
    
    .account-mobile-tabs .tab-btn.text-danger.active i {
        color: #ffffff;
    }

    /* Container adjustments for mobile */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .account-content {
        padding: 20px;
        border-radius: 20px;
        margin-top: 10px;
        background: #ffffff;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    /* Cards mobile optimization */
    .card {
        border-radius: 16px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
        margin-bottom: 16px;
        overflow: hidden;
        background: #ffffff;
    }
    
    .card-body {
        padding: 20px;
    }

    /* Orders mobile styling */
    .order-item {
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 16px;
        padding: 20px;
        margin-bottom: 16px;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
        transition: all 0.2s ease;
    }
    
    .order-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
        border-color: rgba(59, 130, 246, 0.2);
    }
    
    .order-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .order-status {
        margin-top: 0;
        align-self: flex-start;
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Address cards mobile */
    .address-card {
        border-radius: 16px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        background: #ffffff;
        padding: 20px;
        margin-bottom: 16px;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
        transition: all 0.2s ease;
    }
    
    .address-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
        border-color: rgba(59, 130, 246, 0.2);
    }

    /* Form elements mobile */
    .form-control, .form-select {
        border-radius: 12px;
        border: 1.5px solid #e5e7eb;
        padding: 14px 16px;
        font-size: 16px;
        transition: all 0.2s ease;
        background: #ffffff;
    }
    
    .form-control:focus, .form-select:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }
    
    .form-label {
        font-weight: 600;
        color: #374151;
        margin-bottom: 8px;
        font-size: 14px;
    }

    /* Buttons mobile */
    .btn {
        border-radius: 12px;
        padding: 12px 20px;
        font-weight: 600;
        font-size: 14px;
        transition: all 0.2s ease;
        border: none;
    }
    
    .btn-primary {
        background: #3b82f6;
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }
    
    .btn-primary:hover {
        background: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    }
    
    .btn-outline-primary {
        border: 1.5px solid #3b82f6;
        color: #3b82f6;
        background: transparent;
    }
    
    .btn-outline-primary:hover {
        background: #3b82f6;
        border-color: #3b82f6;
        color: #ffffff;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }
    
    .btn-outline-success {
        border: 1.5px solid #10b981;
        color: #10b981;
        background: transparent;
    }
    
    .btn-outline-success:hover {
        background: #10b981;
        border-color: #10b981;
        color: #ffffff;
    }
    
    .btn-outline-danger {
        border: 1.5px solid #ef4444;
        color: #ef4444;
        background: transparent;
    }
    
    .btn-outline-danger:hover {
        background: #ef4444;
        border-color: #ef4444;
        color: #ffffff;
    }

    /* Typography mobile */
    .account-title {
        font-size: 24px;
        font-weight: 700;
        color: #111827;
        margin-bottom: 8px;
    }
    
    h6 {
        font-size: 16px;
        font-weight: 600;
        color: #374151;
    }

    /* Empty states mobile */
    .text-center.py-5 {
        padding: 40px 20px !important;
        background: #ffffff;
        border-radius: 16px;
        border: 2px dashed #e5e7eb;
    }
    
    .text-center.py-5 i {
        opacity: 0.6;
        margin-bottom: 16px;
        color: #9ca3af;
    }

    /* Order detail info mobile */
    .order-detail-info {
        flex-direction: column;
        gap: 16px;
    }
    
    .order-detail-product {
        padding: 16px 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .order-detail-product-image {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    /* Badge improvements */
    .badge {
        border-radius: 20px;
        padding: 6px 12px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .bg-primary { background: #3b82f6 !important; }
    .bg-success { background: #10b981 !important; }
    .bg-warning { background: #f59e0b !important; }
    .bg-danger { background: #ef4444 !important; }
    .bg-info { background: #06b6d4 !important; }
    .bg-secondary { background: #6b7280 !important; }

    /* Pagination mobile */
    .pagination {
        justify-content: center;
        gap: 8px;
    }
    
    .page-link {
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        background: #ffffff;
        color: #374151;
        padding: 10px 14px;
        font-weight: 500;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease;
    }
    
    .page-link:hover {
        background: #f9fafb;
        border-color: #d1d5db;
        color: #111827;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .page-item.active .page-link {
        background: #3b82f6;
        border-color: #3b82f6;
        color: white;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    }
}

/* Skeleton Loading - Enhanced for mobile */
.placeholder-wave { 
    position: relative; 
    overflow: hidden;
    background: linear-gradient(90deg, #f0f2f5 0%, #ffffff 50%, #f0f2f5 100%);
    border-radius: 12px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.placeholder { 
    display: inline-block; 
    background: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 50%, #e9ecef 100%);
    border-radius: 8px; 
    min-height: 12px;
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.placeholder-wave .placeholder { 
    position: relative; 
    overflow: hidden;
}

.placeholder-wave .placeholder::after { 
    content: ""; 
    position: absolute; 
    inset: 0; 
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%); 
    animation: placeholder-wave 1.2s linear infinite; 
    border-radius: inherit;
}

@keyframes placeholder-wave { 
    0% { transform: translateX(-100%); } 
    100% { transform: translateX(100%); } 
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Enhanced skeleton cards for mobile */
@media (max-width: 767px) {
    .placeholder-wave.card {
        border-radius: 16px;
        background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
        border: 1px solid rgba(102, 126, 234, 0.1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
        margin-bottom: 16px;
        overflow: hidden;
        position: relative;
    }
    
    .placeholder-wave.card::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.1) 50%, transparent 100%);
        animation: skeleton-slide 1.5s infinite;
    }
    
    .placeholder-wave .card-body {
        padding: 20px;
    }
    
    .placeholder-wave .placeholder {
        border-radius: 8px;
        margin-bottom: 12px;
    }
    
    .placeholder-wave .placeholder:nth-child(1) { height: 20px; }
    .placeholder-wave .placeholder:nth-child(2) { height: 16px; width: 80%; }
    .placeholder-wave .placeholder:nth-child(3) { height: 14px; width: 60%; }
    .placeholder-wave .placeholder:nth-child(4) { height: 12px; width: 40%; }
}

@keyframes skeleton-slide {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal enhancements for mobile */
@media (max-width: 767px) {
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .modal-content {
        border-radius: 20px;
        border: none;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        overflow: hidden;
    }
    
    .modal-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        padding: 20px;
    }
    
    .modal-title {
        font-weight: 700;
        font-size: 18px;
    }
    
    .modal-body {
        padding: 24px;
    }
    
    .modal-footer {
        border: none;
        padding: 20px 24px;
        background: #f8f9fa;
    }
    
    .btn-close {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        width: 32px;
        height: 32px;
        opacity: 1;
    }
    
    .btn-close:hover {
        background: rgba(255, 255, 255, 0.5);
    }
}

/* Alert enhancements for mobile */
@media (max-width: 767px) {
    .alert {
        border-radius: 16px;
        border: none;
        padding: 16px 20px;
        margin-bottom: 20px;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
        position: relative;
        overflow: hidden;
    }
    
    .alert::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: currentColor;
    }
    
    .alert-success {
        background: #ecfdf5;
        color: #065f46;
        border-left-color: #10b981;
    }
    
    .alert-danger {
        background: #fef2f2;
        color: #991b1b;
        border-left-color: #ef4444;
    }
    
    .alert-warning {
        background: #fffbeb;
        color: #92400e;
        border-left-color: #f59e0b;
    }
    
    .alert-info {
        background: #f0f9ff;
        color: #1e40af;
        border-left-color: #3b82f6;
    }
    
    .alert i {
        font-size: 18px;
        margin-right: 12px;
    }
    
    .btn-close {
        background: transparent;
        color: currentColor;
        opacity: 0.7;
        font-size: 16px;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-close:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.1);
    }
}

/* Additional mobile improvements */
@media (max-width: 767px) {
    /* Improved scrolling */
    .account-mobile-tabs {
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
    }
    
    .account-mobile-tabs::-webkit-scrollbar {
        display: none;
    }
    
    /* Better touch targets */
    .btn, .tab-btn, .page-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Improved form elements */
    .form-check-input {
        width: 20px;
        height: 20px;
        border-radius: 6px;
        border: 2px solid #dee2e6;
    }
    
    .form-check-input:checked {
        background-color: #667eea;
        border-color: #667eea;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    }
    
    .form-check-label {
        padding-left: 8px;
        font-weight: 500;
    }
    
    /* Better spacing for mobile */
    .mb-3 { margin-bottom: 1.5rem !important; }
    .mb-4 { margin-bottom: 2rem !important; }
    .py-3 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .py-4 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    
    /* Improved list groups */
    .list-group-item {
        border-radius: 12px !important;
        border: 1px solid rgba(102, 126, 234, 0.15) !important;
        margin-bottom: 8px;
        padding: 16px 20px;
        background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
        transition: all 0.3s ease;
    }
    
    .list-group-item:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .list-group-item.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        border-color: #667eea !important;
        color: white !important;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
}
