/* /account.css */

/* --- Base --- */
body {
    background-color: #f4f5f7; /* Lighter grey background for professional look */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    color: #333;
}

/* --- Main Header --- */
.account-header {
    background: #fff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}
.account-header .auth-logo img {
    height: 100%;
    max-height: 30px;
}
.account-header .back-to-shop {
    text-decoration: none;
    color: #0071dc;
    font-weight: 600;
    font-size: 0.9rem;
}
.account-header .back-to-shop i {
    margin-right: 6px;
}

/* --- Layout Container --- */
.account-layout-container {
    display: flex;
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px;
    gap: 24px;
}

/* --- 1. Sidebar --- */
.account-sidebar {
    flex: 0 0 280px; /* Fixed width sidebar */
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    height: fit-content;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.sidebar-user-info {
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 16px;
    word-break: break-all;
}
.sidebar-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f0f0f0;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #ddd;
}
.sidebar-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.sidebar-avatar-initial {
    font-size: 2.5rem;
    font-weight: 600;
    color: #0071dc;
    display: none;
}
.sidebar-user-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    color: #111;
}
.sidebar-user-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.sidebar-nav li a i {
    width: 20px;
    text-align: center;
    color: #555;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}
.sidebar-nav li a:hover {
    background-color: #f4f5f7;
    color: #0071dc;
}
.sidebar-nav li a.active {
    background-color: #e6f1fc;
    color: #0071dc;
    font-weight: 600;
}
.sidebar-nav li a.active i {
    color: #0071dc;
}
.sidebar-nav li a#sidebar-logout-btn {
    color: #d9534f;
}
.sidebar-nav li a#sidebar-logout-btn i {
    color: #d9534f;
}
.sidebar-nav li a#sidebar-logout-btn:hover {
    background-color: #fdf2f2;
    color: #b92c28;
}
.sidebar-nav li a#sidebar-logout-btn:hover i {
    color: #b92c28;
}

/* --- 2. Content Area --- */
.account-content {
    flex: 1; /* Takes remaining space */
}
.content-pane {
    display: none; /* Hidden by default */
}
.content-pane.active {
    display: block; /* Shown when active */
}

.account-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #111;
    margin-top: 0;
    margin-bottom: 8px;
}
.account-content > p {
    font-size: 1rem;
    color: #666;
    margin-top: 0;
    margin-bottom: 24px;
}
.content-box {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* --- New Avatar Upload Styles --- */
.avatar-upload-group {
    display: flex;
    align-items: center;
    gap: 20px;
}
.avatar-upload-preview {
    position: relative;
}
.avatar-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #ddd;
    position: relative; /* For overlay */
    cursor: pointer;
}
.avatar-container .avatar-initial {
    font-size: 3rem;
    font-weight: 600;
    color: #0071dc;
    display: none;
}
.avatar-container .avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.avatar-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none; /* Allows click-through to avatar-container */
}
.avatar-container:hover .avatar-upload-overlay {
    opacity: 1;
}
.avatar-upload-overlay i {
    font-size: 1.5rem;
}
.avatar-upload-overlay span {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 4px;
}

/* --- Form & Button Styles (from auth-page.css, but with tweaks) --- */
.auth-form-group {
    margin-bottom: 16px;
}
.auth-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}
.auth-form-group input[type="text"],
.auth-form-group input[type="email"] {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}
.auth-form-group input:disabled {
    background: #f4f5f7;
    color: #777;
    cursor: not-allowed;
}
.auth-form-group small {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

.auth-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: auto;
    min-width: 150px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: #0071dc;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.auth-btn:hover {
    background-color: #00519e;
}
.auth-btn:disabled {
    background-color: #a0cff1;
    cursor: not-allowed;
}

/* Button Loader */
.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none; /* Hidden by default */
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Messages */
.auth-success-message, .auth-error-message {
    display: none; /* Hidden by default */
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    margin: 10px 0 15px 0;
}
.auth-success-message.visible {
    display: block;
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.auth-error-message.visible {
    display: block;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

/* --- Placeholder Box --- */
.placeholder-box {
    text-align: center;
    padding: 60px 24px;
    color: #666;
}
.placeholder-box i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 16px;
}
.placeholder-box h3 {
    font-size: 1.25rem;
    color: #333;
    margin: 0 0 8px 0;
}
.placeholder-box p {
    margin: 0 0 24px 0;
}

/* --- Responsive (Mobile) --- */
@media (max-width: 768px) {
    .account-layout-container {
        flex-direction: column;
        margin: 16px auto;
        padding: 0 16px;
    }
    .account-sidebar {
        flex: 0 0 auto; /* Allow sidebar to be auto height */
    }
    .content-box {
        padding: 16px;
    }
    .account-content h2 {
        font-size: 1.5rem;
    }
    .avatar-upload-group {
        flex-direction: column;
        align-items: flex-start;
    }
}


img#avatar-image {
    max-width: 100%;
    object-fit: cover;
    object-position: top;
}

img#sidebar-avatar-image {
    max-width: 100%;
    object-fit: cover;
    object-position: top;
}


/* --- ADD THIS CSS --- */
    .favourite-card-body {
        display: flex;
        align-items: center;
        gap: 16px;
        text-decoration: none;
        color: inherit;
    }
    .favourite-card-image {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: 6px;
        border: 1px solid #eee;
    }
    .favourite-card-image-placeholder {
        width: 80px;
        height: 80px;
        border-radius: 6px;
        background: #f0f0f0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: #ccc;
    }
    .favourite-card-details {
        flex: 1;
    }
    .favourite-card-price {
        font-size: 1.1rem;
        font-weight: 600;
        color: #333;
        margin: 0;
    }
    /* --- END OF NEW CSS --- */

    /* This style is already in your file */
     

    /* --- NEW STYLES FOR FAVOURITE CARD --- */
    /* This replaces the simple .favourite-card-body from last time */
    .fav-card-body-layout {
        display: flex;
        align-items: flex-start;
        gap: 16px;
        text-decoration: none;
        color: inherit;
    }
    .fav-card-image {
        width: 100px;
        height: 100px;
        object-fit: cover;
        border-radius: 6px;
        border: 1px solid #eee;
        flex-shrink: 0; /* Prevents image from shrinking */
    }
    .fav-card-image-placeholder {
        width: 100px;
        height: 100px;
        border-radius: 6px;
        background: #f0f0f0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: #ccc;
        flex-shrink: 0;
    }
    .fav-card-details {
        flex: 1; /* Allows details to take up remaining space */
        min-width: 0; /* Fixes flexbox text overflow */
    }
    .fav-card-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: #222;
        margin: 0 0 4px 0;
    }
    .fav-card-price {
        font-size: 1rem;
        font-weight: 500;
        color: #e53935; /* Red price */
        margin: 0 0 8px 0;
    }
    .fav-card-description {
        font-size: 0.9rem;
        color: #666;
        margin: 0 0 8px 0;
        line-height: 1.4;
    }
    .fav-card-availability {
        font-size: 0.85rem;
        font-weight: 500;
        color: #00695c; /* Green */
    }
    .fav-card-availability.out-of-stock {
        color: #d9534f; /* Red */
    }

    /* We are keeping the .data-card styles from your code */
    /* This just styles the *body* of the card */
    
    
    /* Reposition delete button to be less obtrusive */
     
    .data-card-delete-btn:hover {
        background: #e0e0e0;
    }
    /* --- END OF NEW CSS --- */






    /* ===== My Orders – card layout ===== */

.orders-loading {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.order-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.order-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    padding: 16px 20px;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.order-id {
    margin: 0;
    font-weight: 600;
    color: #111;
}

.order-date {
    margin: 2px 0 0 0;
    font-size: 0.85rem;
    color: #777;
}

.order-status-badge {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f4f5f7;
    color: #555;
}

/* status colours */
.order-status-badge.status-placed,
.order-status-badge.status-pending {
    background: #fff7ed;
    color: #c05621;
}
.order-status-badge.status-processing,
.order-status-badge.status-shipped {
    background: #e0f2fe;
    color: #0369a1;
}
.order-status-badge.status-delivered,
.order-status-badge.status-completed {
    background: #ecfdf3;
    color: #15803d;
}
.order-status-badge.status-cancelled,
.order-status-badge.status-refunded {
    background: #fef2f2;
    color: #b91c1c;
}

.order-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.order-card-column {
    flex: 1 1 220px;
}

.order-section-title {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111;
}

/* items list */
.order-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 0.9rem;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-name {
    flex: 1;
    color: #333;
}

.order-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.85rem;
    color: #555;
}

.order-item-price {
    font-weight: 600;
    margin-top: 2px;
}

.order-items-placeholder {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* summary block */
.order-summary-list {
    margin: 0;
    padding: 0;
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.9rem;
    padding: 4px 0;
}

.order-summary-row dt {
    margin: 0;
    font-weight: 500;
    color: #555;
}

.order-summary-row dd {
    margin: 0;
    font-weight: 600;
    color: #222;
    text-align: right;
}

.order-address {
    font-weight: 400;
    color: #666;
    font-size: 0.85rem;
}

/* responsive */
@media (max-width: 768px) {
    .order-card-body {
        flex-direction: column;
    }
}

/* ===== Favourites – small tweaks so cards feel unified with orders ===== */

 

/* keep your existing .fav-card-* styles; they already match this design */

/* Order ID small meta line */
.order-code {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: #999;
}
.order-code span {
    font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Item thumbnail layout */
.order-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-item-thumb-wrap {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.order-item-thumb-wrap.placeholder i {
    font-size: 1rem;
    color: #9ca3af;
}

.order-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-item-name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #111;
}

.order-item-qty-label {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.order-item-meta {
    min-width: 80px;
}



/* Grid of favourite / wishlist cards */
.data-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

/* Card container */
.data-card {
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.data-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

/* Header only holds delete icon now */
.data-card-header {
    position: relative;
    height: 0;
}

.data-card-delete-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: #f9fafb;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.data-card-delete-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* Card body / link layout */
.data-card-body {
    padding: 16px 18px 18px;
}

.fav-card-body-layout {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

/* Product image */
.fav-card-image,
.fav-card-image-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fav-card-image {
    object-fit: cover;
}

.fav-card-image-placeholder i {
    font-size: 1.3rem;
    color: #9ca3af;
}

/* Product text */
.fav-card-details {
    flex: 1;
    min-width: 0;
}

.fav-card-title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.fav-card-price {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e11d48;
}

.fav-card-description {
    margin: 0 0 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #6b7280;
}

.fav-card-availability {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #059669;
}

.fav-card-availability.out-of-stock {
    color: #b91c1c;
}
