/* ==========================================================================
   User Profile Page - BRAND COLOR UPDATES
   ========================================================================== */

/* --- Base Profile Container & Layout --- */
.profile-container {
    max-width: 900px; /* Adjusted slightly for more content */
    margin: 40px auto;
    padding: 35px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.08);
    font-family: "Spartan", sans-serif; /* Ensure font is consistent */
}

/* --- Profile Header --- */
.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    background-color: var(--primary-gold); /* UPDATED */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    flex-shrink: 0;
}
.profile-title h2 {
    margin: 0;
    color: var(--primary-gold); /* UPDATED */
    font-size: 1.8rem;
}
.profile-title p {
    color: #666;
    margin: 5px 0 0;
}

/* --- Profile Stats --- */
.profile-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0 30px;
    padding: 15px 0;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
.stat-item {
    text-align: center;
    flex: 1; /* Distribute space evenly */
}
.stat-value {
    font-size: 1.8rem; /* Increased size */
    font-weight: bold;
    color: var(--primary-gold); /* UPDATED */
    margin-bottom: 5px;
}
.stat-label {
    font-size: 0.9rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Profile Details --- */
.profile-details {
    background-color: #fbfbfb; /* Lighter background */
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}
.profile-details h3 {
    color: var(--primary-gold); /* UPDATED */
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem; /* Adjusted size */
    border-bottom: 1px solid #eee; /* Added border */
    padding-bottom: 10px;
}
.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px dashed #f0f0f0;
}
.detail-row:last-child {
    border-bottom: none;
}
.detail-label {
    width: 140px;
    color: #666;
    font-weight: 600;
}
.detail-value {
    flex: 1;
    color: #333;
}

/* --- Recent Orders --- */
.recent-orders {
    margin-top: 30px;
}
.recent-orders h3 {
    color: var(--primary-gold); /* UPDATED */
    margin-bottom: 15px;
    font-size: 1.5rem; /* Adjusted size */
    border-bottom: 1px solid #eee; /* Added border */
    padding-bottom: 10px;
}
.order-card {
    background-color: #fcfcfc; /* Lighter background for cards */
    border: 1px solid #e0e0e0; /* Subtle border */
    border-radius: 8px;
    padding: 20px; /* Increased padding */
    margin-bottom: 15px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.03);
    transition: box-shadow 0.2s ease-in-out;
    display: flex; /* Make order-card a flex container */
    flex-direction: column; /* Stack children vertically */
}
.order-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}
.order-number {
    font-weight: bold;
    color: var(--primary-gold); /* UPDATED */
    font-size: 1.1em;
    margin-right: 10px; /* Space between order number and date */
}
.order-date {
    color: #777;
    font-size: 0.9em;
    white-space: nowrap; /* Prevent date from wrapping */
}

/* --- STATUS BADGE STYLES (Semantic colors - NO CHANGE) --- */
.status-badge {
    display: inline-block;
    padding: 0.25em 0.8em;
    font-size: 0.85em;
    font-weight: bold;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border-radius: 0.5rem;
    color: #fff;
    text-transform: uppercase;
}
.status-paid { background-color: #28a745; }
.status-due { background-color: #dc3545; }
.status-pending { background-color: #007bff; }
.status-failed { background-color: #6c757d; }
.status-cancelled { background-color: #6c757d; }
.status-partial { background-color: #ffc107; color: #343a40; }
.status-ordered { background-color: #17a2b8; }
.status-unknown { background-color: #6f42c1; }


.order-details-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px; /* Space from the next row */
    flex-wrap: wrap; /* Allow items to wrap */
}
.order-status {
    margin-right: 10px;
    margin-bottom: 5px;
}
.order-total {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
    white-space: nowrap;
}

.order-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: auto;
    border-top: 1px dashed #eee;
    padding-top: 15px;
    flex-wrap: wrap;
}
.view-order-details, .pay-now-btn-small {
    padding: 8px 15px;
    font-size: 0.85em;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
    cursor: pointer;
    text-align: center;
    display: inline-block;
    flex-shrink: 0;
}
.view-order-details {
    background-color: #f8f8f8;
    color: var(--primary-gold); /* UPDATED */
    border: 1px solid var(--primary-gold); /* UPDATED */
}
.view-order-details:hover {
    background-color: #e8e8e8;
}

.pay-now-btn-small {
    background-color: var(--primary-gold); /* UPDATED */
    color: #fff;
    border: 1px solid var(--primary-gold); /* UPDATED */
}
.pay-now-btn-small:hover {
    background-color: var(--primary-gold-dark); /* UPDATED */
    color: #fff;
}


/* --- Profile Actions (Logout) --- */
.profile-actions {
    text-align: right;
    margin-top: 30px;
}
.action-button {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
}
/* Red is kept for semantic meaning (destructive action) */
.logout-button {
    background-color: #dc3545;
    color: white;
    border: none;
}
.logout-button:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

/* --- General Alert Styling (Semantic colors - NO CHANGE) --- */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.95em;
    border: 1px solid transparent;
}
.alert .icon {
    font-size: 1.8em;
}
.alert-success {
    background-color: #e6f7ee;
    color: #28a745;
    border-color: #d4edda;
}
.alert-success .icon { color: #28a745; }
.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
.alert-danger .icon { color: #dc3545; }
.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}
.alert-info .icon { color: #007bff; }


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .profile-container {
        padding: 20px;
        margin: 20px auto;
    }
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    .profile-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    .profile-stats {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    .stat-item {
        width: 100%;
        text-align: center;
    }
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .detail-label {
        width: 100%;
        margin-bottom: 5px;
    }
    .profile-actions {
        flex-direction: column;
        gap: 15px;
    }
    .action-button {
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .order-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .view-order-details, .pay-now-btn-small {
        width: 100%;
        text-align: center;
    }
}