/* =========================================
   ACCOUNT & AUTH PAGES CSS
   ========================================= */

/* --- 1. SHARED STYLES --- */
body {
    background: #fdfdfd;
}

/* --- 1. CART HEADER (Fixed) --- */
.cart-header {
    background: transparent;
    padding: 120px 20px 40px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.header-content h1 {
    font-size: 3rem;
    color: var(--rose-primary);
    margin-bottom: 10px;
}

.header-content p {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
    font-family: 'Playfair Display', serif;
}


.parallax-bg {
    z-index: 0;
}

/* --- 2. AUTH (LOGIN/REGISTER) STYLES --- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px 50px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(183, 110, 121, 0.2);
    width: 100%;
    max-width: 450px;
    text-align: center;
    border: 1px solid #fff0f5;
}

.brand-header img {
    height: 60px;
    margin-bottom: 15px;
}

.brand-header h2 {
    color: var(--rose-primary);
    margin-bottom: 30px;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
}

/* --- AUTH INPUTS (Specific Fix) --- */
/* These styles apply ONLY to inputs inside the Auth Card */
.auth-card .input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.auth-card .input-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #b76e79;
    opacity: 0.7;
    z-index: 5;
    font-size: 1.1rem;
}

.auth-card .input-group input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    /* Padding Left creates space for the Icon */
    border: 2px solid #eee;
    border-radius: 50px;
    outline: none;
    transition: 0.3s;
    font-size: 1rem;
    background: #fffcfc;
    color: #444;
    font-family: 'Lato', sans-serif;
}

.auth-card .input-group input:focus {
    border-color: var(--rose-primary);
    background: white;
    box-shadow: 0 5px 15px rgba(183, 110, 121, 0.1);
}

.auth-card .input-group input::placeholder {
    color: #bbb;
}

/* Auth Buttons */
.btn-auth {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #d4af37, #b76e79);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(183, 110, 121, 0.3);
}

.btn-auth:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(183, 110, 121, 0.4);
}

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.switch-text {
    margin-top: 25px;
    font-size: 0.95rem;
    color: #666;
}

.switch-text a {
    color: var(--rose-primary);
    text-decoration: none;
    font-weight: bold;
}

.hidden-form {
    display: none;
}

#authMessage {
    margin-top: 20px;
    font-size: 0.95rem;
    min-height: 25px;
    padding: 5px;
    border-radius: 5px;
}

.success {
    color: #4CAF50;
    background: #e8f5e9;
}

.error {
    color: #ff6b6b;
    background: #ffebee;
}


/* --- 3. ACCOUNT DASHBOARD LAYOUT --- */
.account-container {
    padding: 40px 20px;
    position: relative;
    z-index: 2;
    min-height: 80vh;
}

.account-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* Sidebar */
.account-sidebar {
    background: white;
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: sticky;
    top: 100px;
    border: 1px solid #fff0f5;
}

.user-profile-header {
    margin-bottom: 30px;
}

.avatar {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #fff0f5, #ffe4e1);
    color: var(--rose-primary);
    font-size: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.user-profile-header h3 {
    color: var(--text-main);
    margin-bottom: 5px;
    font-size: 1.3rem;
}

.user-profile-header p {
    color: #999;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.account-menu {
    list-style: none;
    text-align: left;
    padding: 0;
}

.account-menu li {
    padding: 15px 20px;
    border-radius: 15px;
    cursor: pointer;
    color: #666;
    transition: 0.3s;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}

.account-menu li i {
    width: 20px;
    text-align: center;
}

.account-menu li:hover {
    background: #fffcfc;
    color: var(--rose-primary);
    transform: translateX(5px);
}

.account-menu li.active {
    background: var(--rose-primary);
    color: white;
    box-shadow: 0 5px 15px rgba(183, 110, 121, 0.3);
}

.account-menu li.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: none;
    color: #999;
}

/* Main Content Area */
.account-content {
    background: white;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    min-height: 500px;
    border: 1px solid #fff0f5;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f5f5f5;
}

.content-header h2 {
    font-size: 2rem;
    color: var(--text-main);
}

.btn-add-new {
    background: var(--rose-primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(183, 110, 121, 0.2);
}

.btn-add-new:hover {
    background: var(--rose-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(183, 110, 121, 0.3);
}

/* --- 4. TABS & CONTENT --- */
.content-tab {
    display: none;
    animation: fadeIn 0.4s ease;
}

.content-tab.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- 5. ADDRESS GRID & CARDS --- */
.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.address-card {
    background: #fffcfc;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    position: relative;
    border: 2px solid transparent;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.address-card:hover {
    border-color: var(--rose-primary);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(183, 110, 121, 0.1);
}

.addr-label {
    background: var(--rose-light);
    color: var(--rose-primary);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 20px;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.addr-details {
    color: #555;
    line-height: 1.7;
    font-size: 1.05rem;
    flex-grow: 1;
}

.addr-phone {
    margin-top: 15px;
    color: #888;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-addr {
    position: absolute;
    top: 25px;
    right: 25px;
    color: #e0e0e0;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.2rem;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.delete-addr:hover {
    color: #ff6b6b;
    background: #ffebee;
}

.dashboard-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #ccc;
    font-size: 1.5rem;
    padding: 50px;
}


/* --- 6. ORDER HISTORY STYLES --- */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-card {
    border: 1px solid #eee;
    border-radius: 15px;
    overflow: hidden;
    background: #fffcfc;
    transition: 0.3s;
}

.order-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-color: var(--rose-primary);
}

.order-header {
    background: #fff0f5;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #e0e0e0;
}

.order-id {
    font-weight: bold;
    color: var(--rose-primary);
    font-size: 1.1rem;
}

.order-date {
    color: #888;
    font-size: 0.9rem;
}

.order-status {
    background: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #4CAF50;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.order-body {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-items-preview {
    display: flex;
    gap: 10px;
}

.order-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.more-items {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
    font-weight: bold;
}

.order-total {
    text-align: right;
}

.order-total span {
    display: block;
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.order-total strong {
    font-size: 1.3rem;
    color: var(--text-main);
}


/* --- 7. MODALS (Address Form) --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.4s;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.address-form-card {
    background: white;
    width: 600px;
    max-width: 95%;
    padding: 40px;
    border-radius: 30px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-backdrop.active .address-form-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.modal-header h3 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

/* Modal Form Layouts */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.full-width {
    margin-bottom: 20px;
}

/* Simple Inputs (for modals - DIFFERENT from Auth Inputs) */
.input-group.simple label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #666;
}

.input-group.simple input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    outline: none;
    transition: 0.3s;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
}

.input-group.simple input:focus {
    border-color: var(--rose-primary);
}

.btn-save {
    width: 100%;
    padding: 15px;
    background: var(--text-main);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    font-size: 1.1rem;
}

.btn-save:hover {
    background: var(--rose-primary);
    box-shadow: 0 5px 15px rgba(183, 110, 121, 0.3);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .account-wrapper {
        grid-template-columns: 1fr;
    }

    .account-sidebar {
        position: static;
        margin-bottom: 30px;
    }

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .order-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .order-total {
        text-align: left;
    }
}

/* =========================================
   8. ORDER DETAILS MODAL (FIXED)
   ========================================= */

/* --- 1. THE MODAL CONTAINER (Was Missing) --- */
.receipt-card {
    background: white;
    width: 500px;
    max-width: 90%;
    padding: 30px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    /* Prevents modal from being too tall */
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- 2. HEADER & META INFO --- */
.receipt-card .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.receipt-card h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-main);
}

.order-meta-info {
    background: #fdfdfd;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #eee;
}

/* --- 3. ITEMS LIST (Scrollable) --- */
.receipt-body {
    overflow-y: auto;
    padding-right: 5px;
    flex-grow: 1;
    /* Takes available space */
}

/* Individual Item Row */
.receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #f5f5f5;
}

.receipt-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Left Side: Image + Text Group */
.receipt-item-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.receipt-item img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #eee;
    background: #fffcfc;
}

/* Text details inside the item */
.receipt-item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.3;
    text-align: left;
}

.receipt-item-info div:first-child {
    font-weight: bold;
    color: #333;
    font-size: 0.95rem;
}

.receipt-item-info div:last-child {
    font-size: 0.85rem;
    color: #888;
}

/* Price */
.receipt-item-price {
    font-weight: bold;
    color: var(--rose-primary);
    font-size: 1rem;
    white-space: nowrap;
    /* Prevents price wrapping */
}

/* --- 4. FOOTER (Total) --- */
.receipt-footer {
    border-top: 2px solid #f0f0f0;
    padding-top: 20px;
    margin-top: 20px;
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.receipt-total span:first-child {
    font-size: 1.1rem;
    color: #666;
}

.receipt-total span:last-child {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
}


/* =========================================
   9. WISHLIST STYLES
   ========================================= */

/* Reusing .address-card style but centering content */
#wishlistGrid .address-card {
    align-items: center;
    text-align: center;
    padding-bottom: 20px;
}

#wishlistGrid img {
    transition: transform 0.3s ease;
}

#wishlistGrid .address-card:hover img {
    transform: scale(1.05);
}

#wishlistGrid h4 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Remove button position in wishlist card */
#wishlistGrid .delete-addr {
    top: 15px;
    right: 15px;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}