/* 💎 Ultra-Premium Account Page Styling */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --primary: #c98e3b; /* Honey / Gold */
    --primary-gradient: linear-gradient(135deg, #c98e3b, #f3c470);
    --secondary: #e67e22;
    --bg-color: #f4f7fb;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px -10px rgba(201, 142, 59, 0.25);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    background-color: var(--bg-color);
    font-family: 'Tajawal', sans-serif;
    color: var(--text-main);
    margin: 0; padding: 0;
    overflow-x: hidden;
}

/* 🌟 Hero Section */
.hero {
    background: var(--primary-gradient);
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    box-shadow: 0 15px 30px rgba(201, 142, 59, 0.2);
    margin-bottom: -40px; /* Overlap effect */
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.5rem;
    margin: 0 0 10px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 500;
}

/* 🌟 Main Layout */
.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
    position: relative;
    z-index: 2;
}

.layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

/* 🌟 Sidebar & Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 35px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar {
    flex: 1 1 320px;
    position: sticky;
    top: 30px;
    text-align: center;
}

/* 🌟 User Box & Avatar */
.user-box { margin-bottom: 35px; }

.avatar {
    width: 110px;
    height: 110px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(201, 142, 59, 0.25);
    position: relative;
    font-weight: bold;
    padding: 4px; /* Gradient border effect */
}

.avatar img, .avatar .avatar-letter {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar img[hidden], .avatar .avatar-letter[hidden] {
    display: none !important;
}

.user-box h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 800;
}

.user-box p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 5px;
    font-weight: 500;
}

/* 🌟 Tab Navigation (Segmented Control Style) */
.tab-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 35px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: right;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: var(--text-main);
    transform: translateX(-5px);
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 8px 20px rgba(201, 142, 59, 0.2);
    transform: translateX(-5px);
}

/* 🌟 Buttons */
.logout-btn {
    width: 100%;
    background: #fef2f2;
    color: var(--danger);
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

.primary-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(201, 142, 59, 0.2);
}

.primary-btn:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.outline-btn {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.outline-btn:hover {
    border-color: var(--primary);
    background: #f0f7ff;
}

.outline-btn.danger {
    color: var(--danger);
}
.outline-btn.danger:hover {
    border-color: var(--danger);
    background: #fef2f2;
}

/* 🌟 Content Area */
.content-area {
    flex: 1 1 600px;
}

.tab-panel {
    display: none;
    animation: slideUpFade 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tab-panel.active { display: block; }

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

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.panel-head h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.8rem;
    font-weight: 800;
}

/* 🌟 Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.form-grid label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
}

.form-grid input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-family: inherit;
    background: #f8fafc;
    transition: 0.3s;
    box-sizing: border-box;
    font-weight: 500;
}

.form-grid input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(201, 142, 59, 0.15);
    outline: none;
}

.form-grid input:disabled {
    background: #f1f5f9;
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border-color);
}

.actions { display: flex; gap: 15px; margin-top: 30px; }

/* 🌟 Upload Group */
.upload-group {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f8fafc;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 2px dashed #cbd5e1;
    transition: border-color 0.3s;
}
.upload-group:hover { border-color: var(--primary); }
.upload-text { flex: 1; }
.upload-text label { color: var(--primary); margin-bottom: 5px; font-size: 1.05rem; }
.upload-text p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }
#uploadStatus { font-size: 0.85rem; color: var(--success); display: block; margin-top: 8px; font-weight: bold; }
#imageInput { display: none; }
.upload-btn { cursor: pointer; display: inline-flex; border-radius: 30px; padding: 12px 24px; white-space: nowrap; }

/* 🌟 Orders Tab */
.order-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    transition: 0.3s;
}
.order-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.order-head {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}
.order-info strong { font-size: 1.2rem; color: var(--text-main); display: block; margin-bottom: 5px;}
.order-meta { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.order-price-status { text-align: left; }
.status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
}
.status.completed { background: #dcfce7; color: var(--success); }
.status.pending { background: #fef3c7; color: var(--warning); }
.status.cancelled { background: #fee2e2; color: var(--danger); }
.order-total { margin-top: 8px; font-size: 1.2rem; color: var(--text-main); }
.order-items-preview {
    display: flex;
    gap: 15px;
    align-items: center;
}
.order-images { display: flex; gap: -10px; }
.order-images img {
    width: 50px; height: 50px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.order-items-names { flex: 1; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px;}

/* 🌟 Addresses Tab */
.address-card {
    background: white;
    border: 1px solid var(--border-color);
    border-right: 5px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    transition: 0.3s;
}
.address-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.address-card .panel-head { border: none; padding: 0; margin-bottom: 15px; }
.address-details p { margin: 8px 0; color: var(--text-muted); font-size: 1.05rem; }
.address-details strong { color: var(--text-main); }
.coords { font-size: 0.9rem !important; color: var(--success) !important; font-family: monospace; background: #f0fdf4; padding: 6px 10px; border-radius: 8px; display: inline-block;}
.address-actions { margin-top: 20px; display: flex; gap: 12px; }

/* 🌟 Favorites Grid */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}
.fav-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}
.fav-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}
.fav-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}
.fav-box {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.fav-box h4 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-main);
    font-weight: 800;
}
.fav-price {
    color: var(--secondary);
    font-weight: 800;
    font-size: 1.3rem;
}

/* 📱 Responsive Design (Mobile First Tweaks) */
@media (max-width: 900px) {
    .page-wrap { padding: 0 15px 40px; }
    .layout { flex-direction: column; gap: 20px; }
    .sidebar, .content-area { flex: 1 1 100%; width: 100%; }
    
    .hero { padding: 40px 15px 60px; border-bottom-left-radius: 30px; border-bottom-right-radius: 30px;}
    .hero h1 { font-size: 2rem; }
    .card { padding: 25px 20px; border-radius: 20px; }
    
    /* Horizontal Scrollable Tabs on Mobile */
    .tab-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        margin-bottom: 20px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
    }
    .tab-nav::-webkit-scrollbar { display: none; }
    .tab-btn {
        flex: 0 0 auto;
        scroll-snap-align: start;
        padding: 12px 20px;
        text-align: center;
        font-size: 1rem;
        transform: none !important;
    }
    
    .form-grid { grid-template-columns: 1fr; gap: 20px; }
    .panel-head { flex-direction: column; gap: 15px; text-align: center; align-items: stretch; }
    .panel-head h2 { text-align: center; }
    .actions { flex-direction: column; }
    .actions button { width: 100%; }
    
    .upload-group { flex-direction: column; text-align: center; }
    
    .order-head { flex-direction: column; gap: 15px; text-align: right;}
    .order-price-status { text-align: right; display: flex; justify-content: space-between; align-items: center;}
    .order-total { margin-top: 0; }
    .order-items-preview { flex-direction: column; align-items: stretch; text-align: right;}
    .order-items-preview a { text-align: center; }
    
    .favorites-grid { grid-template-columns: 1fr; }
}