/* Inherits primary variables from style.css (e.g., --gold, --black, --card-bg) */

/* =====================
   Page Title & Layout
   ===================== */
.profile-page-content {
    padding-top: 100px; /* Adjust for fixed navbar */
    padding-bottom: 50px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 8%;
}

.page-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
}

.profile-layout {
    display: flex;
    align-items: flex-start; /* Align top edges */
    gap: 2rem; /* Space between profile and orders */
    flex-wrap: wrap; /* Optional: allows stacking on small screens */
}

/* =====================
   1. Profile Card
   ===================== */
.profile-card {
    flex: 0 0 320px; /* Adjusted width for more space on desktop */
    padding: 2rem 1.5rem;
    text-align: center;
    height: fit-content;
    margin-top: 0;
    align-self: flex-start !important;
}

#profile-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    border: 3px solid var(--gold);
    background-size: cover;
    background-position: center;
    background-color: #333; /* Fallback color */
    display: block;
}

#user-name {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gold); /* Highlight name */
}

.profile-detail {
    font-size: 0.95rem;
    color: var(--gray, #bdbdbd);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-detail i {
    color: var(--gold);
}

.preferences-list {
    margin: 1.5rem 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.preferences-list h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.pref-tag {
    display: inline-block;
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
    padding: 4px 10px;
    margin: 4px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}


.edit-profile-btn, .logout-btn {
    width: 100%;
    margin-top: 10px;
}

/* =====================
   2. Order History
   ===================== */
.order-history-section {
    flex-grow: 1;
    margin-top: 0;
    align-self: flex-start !important;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 25px;
    text-align: left;
    color: var(--gold);
}

.order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* --- Individual Order Card --- */
.order-card {
    padding: 1rem;
    transition: none;
}

.order-card:hover {
    transform: none;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.order-header h3 {
    font-size: 1.1rem;
    color: var(--white);
}

.order-items-summary {
    list-style: none;
    padding-left: 0;
    margin: 0.75rem 0;
}

.order-items-summary li {
    font-size: 0.9rem;
    color: var(--gray, #bdbdbd);
    position: relative;
    padding-left: 15px;
}

.order-items-summary li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--gold);
    font-size: 1.2rem;
    line-height: 1;
}

.order-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.order-status.delivered {
    background: green;
    color: var(--white);
}

.order-date {
    font-size: 0.85rem;
    color: var(--muted, #999);
    margin-bottom: 1rem;
}
.order-date i {
    margin-right: 5px;
    color: var(--gold);
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 215, 0, 0.1);
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.9rem;
    border-radius: 20px;
}

/* =====================
   Mobile Responsiveness (Improved)
   ===================== */
@media (max-width: 768px) {
    .profile-layout {
        flex-direction: column; /* Stack vertically on smaller screens */
    }

    .profile-card {
        flex: 1 1 auto;
        max-width: 100%; /* Allows it to take full width */
        margin: 0 auto 30px;
        min-height: 500px;
        align-self: flex-start !important;

    }

    .section-title {
        text-align: center;
        margin-top: 20px;
        align-self: flex-start !important;

    }
}

@media (max-width: 480px) {
    .order-grid {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 0 5%;
    }
}

/* --- Add to profile.css --- */

/* Hide static text when in edit mode */
.profile-card.edit-mode .profile-detail span {
    display: none; 
}

/* Style the input fields for editing */
.profile-card.edit-mode input[type="text"],
.profile-card.edit-mode input[type="tel"] {
    width: calc(100% - 30px); /* Leave room for the icon */
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--gold);
    border-radius: 4px;
    color: var(--white);
    font-size: 0.95rem;
    margin-left: 5px;
}

/* Hide static user name and show input */
.profile-card.edit-mode #user-name {
    /* Hiding the static H2 content by replacing it with input in JS, 
       but ensure the input itself is visible and correctly styled */
    margin: 0;
    padding: 0;
}




.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background: var(--card-bg);
    margin: 10% auto;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    color: var(--white);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gold);
}