/* 
    User Profile Page Styles 
    Extracted from UserProfilePage.js for Clean Code and Performance
*/

.profile-root {
    background: #f8fafc;
    min-height: 90vh;
    padding: 60px 0;
    font-family: 'IBMPlexSansArabic', sans-serif;
}

.profile-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    align-items: start;
}

/* Sidebar Styles */
.profile-sidebar {
    position: sticky;
    top: 100px;
}

.profile-user-card {
    background: #fff;
    border-radius: 30px;
    padding: 40px 30px;
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    text-align: center;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 28px;
    background: #fff;
    color: #d7ae6a;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 900;
    border: 2px solid #f1f5f9;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.profile-user-name {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
}

.profile-user-email {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.profile-nav {
    background: #fff;
    border-radius: 24px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-nav-btn {
    padding: 14px 18px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #475569;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
}

[dir="rtl"] .profile-nav-btn { text-align: right; }

.profile-nav-btn.active {
    background: #0f172a;
    color: #fff;
    font-weight: 800;
}

.profile-nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.profile-nav-btn.active .profile-nav-icon {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.profile-logout-btn {
    margin-top: 10px;
    padding: 16px 18px;
    border: none;
    border-top: 1px solid #f1f5f9;
    background: none;
    color: #ef4444;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: inherit;
    text-align: left;
}

[dir="rtl"] .profile-logout-btn { text-align: right; }

.profile-logout-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #fef2f2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Content Area */
.profile-content-card {
    background: #fff;
    border-radius: 32px;
    padding: 40px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.02);
    min-height: 500px;
}

.profile-section-fade {
    animation: profileFade 0.4s ease-out;
}

@keyframes profileFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Overview Section */
.profile-welcome-row {
    margin-bottom: 40px;
}

.profile-welcome-title {
    font-size: 28px;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.5px;
}

.profile-welcome-subtitle {
    color: #64748b;
    margin: 8px 0 0;
    font-size: 16px;
    font-weight: 600;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.profile-stat-card {
    padding: 24px;
    background: #fff;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.profile-stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.profile-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.profile-stat-icon.orders { background: rgba(215, 174, 106, 0.1); color: #d7ae6a; }
.profile-stat-icon.addresses { background: rgba(56, 189, 248, 0.1); color: #0ea5e9; }

.profile-stat-label {
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
}

.profile-stat-value {
    font-size: 32px;
    font-weight: 900;
    color: #0f172a;
}

.profile-details-box {
    padding: 30px;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    background: #fafafa;
    margin-bottom: 30px;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.profile-detail-item label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.profile-detail-item .value {
    display: block;
    font-weight: 800;
    color: #0f172a;
    font-size: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
}

.section-subtitle {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
}

.section-label {
    margin: 0 0 15px;
    font-size: 15px;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
}

.add-btn-primary {
    padding: 12px 24px;
    background: #d7ae6a;
    color: #fff;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(215, 174, 106, 0.3);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.add-btn-primary:hover { transform: scale(1.02); }

/* Order Details Modal Enhanced */
.order-item-compact {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    align-items: center;
}

.order-item-img-box {
    width: 60px;
    height: 60px;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.order-item-img-box img { width: 100%; height: 100%; object-fit: contain; }

.order-item-txt .item-name { font-weight: 800; font-size: 14px; margin-bottom: 2px; color: #0f172a; }
.order-item-txt .item-meta { font-size: 12px; color: #64748b; font-weight: 600; }
.order-item-compact .item-price { font-weight: 900; color: #d7ae6a; margin-inline-start: auto; }

.order-summary-box {
    background: #f8fafc;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.summary-divider { height: 1px; background: #e2e8f0; margin: 12px 0; }

.summary-row.total { font-size: 18px; font-weight: 900; color: #0f172a; margin-bottom: 0; }
.total-val { color: #d7ae6a; }

.shipping-address-box {
    font-size: 14px;
    color: #334155;
    font-weight: 600;
    line-height: 1.6;
    background: #fff;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid #f1f5f9;
}

.customer-name { margin-bottom: 6px; font-size: 15px; font-weight: 800; color: #0f172a; }
.customer-phone { margin-top: 12px; color: #0f172a; display: flex; align-items: center; gap: 8px; }
.customer-phone i { font-size: 12px; color: #94a3b8; }

.order-status-banner {
    padding: 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 13px;
}

.order-status-banner.pending { background: #fffbeb; color: #b45309; }
.order-status-banner.delivered { background: #f0fdf4; color: #166534; }
.order-status-banner.cancelled { background: #fef2f2; color: #b91c1c; }
.order-status-banner.processing, .order-status-banner.out-for-delivery { background: #f0f9ff; color: #0369a1; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Status Pills for History */
.status-pill {
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pill.pending { background: #fffbeb; color: #b45309; }
.status-pill.delivered { background: #f0fdf4; color: #166534; }
.status-pill.cancelled { background: #fef2f2; color: #b91c1c; }
.status-pill.processing, .status-pill.out-for-delivery { background: #f0f9ff; color: #0369a1; }

.details-btn-ghost {
    border: none;
    background: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: color 0.2s;
}

.details-btn-ghost:hover { color: #d7ae6a; }

.text-btn-gold {
    border: none;
    background: none;
    color: #d7ae6a;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
}

/* Overview Enhancements */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.empty-msg-center {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 20px;
}

/* Form Actions */
.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.submit-btn {
    padding: 14px 40px;
    background: #d7ae6a;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 900;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(215, 174, 106, 0.3);
    font-family: inherit;
}

.cancel-btn {
    padding: 14px 30px;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    font-size: 15px;
    font-family: inherit;
}

/* Orders List */
.orders-list-compact {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-row-compact {
    padding: 16px 20px;
    background: #fcfcfc;
    border: 1px solid #f1f5f9;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.order-row-compact:hover {
    transform: translateY(-3px);
    border-color: #d7ae6a;
    box-shadow: 0 10px 20px rgba(215, 174, 106, 0.08);
}

.order-info-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.order-icon-box {
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d7ae6a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    font-size: 16px;
}

.order-details-meta {
    text-align: right;
}

[dir="rtl"] .order-details-meta { text-align: left; }

.order-price-val {
    font-weight: 900;
    color: #0f172a;
    font-size: 16px;
}

.order-status-tag {
    font-size: 11px;
    font-weight: 800;
    margin-top: 3px;
}

/* Full Width Order Card */
.order-card-full {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    margin-bottom: 20px;
}

.order-card-header {
    padding: 20px 24px;
    background: #fafaf9;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.order-card-id {
    background: #0f172a;
    color: #fff;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
}

.order-card-price {
    font-weight: 900;
    color: #d7ae6a;
    font-size: 18px;
}

.order-card-items {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-item-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.order-item-img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fafc;
    flex-shrink: 0;
    border: 1px solid #f1f5f9;
}

.order-item-img img { width: 100%; height: 100%; object-fit: contain; }

.order-item-info { flex: 1; min-width: 0; }
.order-item-title { font-weight: 800; font-size: 15px; color: #0f172a; margin-bottom: 4px; }
.order-item-qty { font-size: 13px; color: #64748b; font-weight: 600; }

.order-card-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Addresses Grid */
.addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.address-box {
    padding: 24px;
    background: #fff;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    position: relative;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.address-box:hover {
    border-color: #d7ae6a;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.address-title { font-weight: 800; font-size: 17px; color: #0f172a; }
.address-delete-btn { border: none; background: #fee2e2; color: #ef4444; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Form Styles */
.add-address-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.form-group.full { grid-column: 1 / -1; }

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus { border-color: #d7ae6a; outline: none; background: #fff; }

.phone-input-wrap {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.phone-code {
    padding: 14px 18px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 800;
    font-size: 14px;
    border-right: 1px solid #e2e8f0;
}

[dir="rtl"] .phone-code { border-right: none; border-left: 1px solid #e2e8f0; }

.phone-input-wrap .form-input { border: none; background: transparent; }

/* Modal Styles */
.profile-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.profile-modal-content {
    background: #fff;
    width: 100%;
    max-width: 650px;
    border-radius: 32px;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease-out;
}

.modal-header {
    padding: 24px 30px;
    background: #fafaf9;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Empty States */
.profile-empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 24px;
    border: 2px dashed #e2e8f0;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: #f8fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: #94a3b8;
}

/* Responsive Overrides */
@media (max-width: 991px) {
    .profile-root { padding: 30px 0 !important; }
    .profile-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
    .profile-sidebar { position: static !important; }
    
    .profile-nav {
        flex-direction: row !important;
        overflow-x: auto;
        padding: 8px !important;
        gap: 6px !important;
        border-radius: 12px 12px 24px 24px !important;
        border-top: none;
        box-shadow: 0 10px 20px rgba(0,0,0,0.02);
    }
    
    .profile-nav::-webkit-scrollbar { display: none; }
    
    .profile-nav-btn {
        flex: 0 0 auto;
        padding: 10px 14px !important;
        font-size: 13px !important;
        white-space: nowrap;
    }
    
    .profile-nav-icon {
        width: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
    }
    
    .profile-logout-btn {
        display: none !important; 
    }
    
    .profile-content-card {
        padding: 24px 16px !important;
        border-radius: 28px !important;
    }
    
    .profile-user-card {
        padding: 24px !important;
        margin-bottom: 0 !important;
        border-bottom: none;
        border-radius: 24px 24px 0 0;
    }
}

@media (max-width: 600px) {
    .profile-stats-grid { grid-template-columns: 1fr; }
    .profile-details-grid { grid-template-columns: 1fr; }
    .add-address-form { grid-template-columns: 1fr !important; }
    .order-row-compact { flex-direction: column; align-items: flex-start; gap: 12px; }
    .order-details-meta { text-align: left; }
    [dir="rtl"] .order-details-meta { text-align: right; }
}
