/* public/css/user.css */

/* --- 1. LAYOUT & HERO --- */
.user-page {
    padding-bottom: 80px;
    background-color: #000;
    min-height: 100vh;
}

.user-hero {
    position: relative;
    height: 180px; /* Compact height */
    width: 100%;
    overflow: hidden;
    margin-bottom: -60px;
}

.user-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #1a1a1a, #000);
    border-bottom: 1px solid #333;
}

.user-container {
    max-width: 1100px; /* Slightly wider for the row layout */
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 2;
}

/* --- 2. PROFILE HEADER CARD --- */
.user-card {
    background: #000;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.9);
}

@media (min-width: 768px) {
    .user-card {
        flex-direction: row;
        text-align: left;
        align-items: flex-end;
        gap: 30px;
        padding: 30px;
    }
}

/* Avatar */
.user-avatar-wrapper {
    position: relative;
    margin-top: -60px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .user-avatar-wrapper { margin-top: -80px; margin-bottom: 0; }
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #000;
    object-fit: cover;
    background: #222;
}

.user-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #fff;
    color: #000;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border: 3px solid #000;
    transition: transform 0.2s;
}
.user-avatar-edit:hover { transform: scale(1.1); }

/* Details */
.user-details { flex: 1; width: 100%; }

.user-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
}

@media (min-width: 768px) { .user-name-row { justify-content: flex-start; } }

.user-name {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1;
}

.user-role {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    background: #fff;
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
}

.user-email {
    color: #888;
    font-size: 13px;
    margin-bottom: 12px;
}

/* XP Bar */
.xp-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}
@media (min-width: 768px) { .xp-container { margin: 0; } }

.xp-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    color: #ccc;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.xp-track {
    height: 6px;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: #fff;
    border-radius: 4px;
}

/* --- 3. NAVIGATION TABS --- */
.user-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    border-bottom: 1px solid #222;
    padding-bottom: 1px;
    overflow-x: auto;
    scrollbar-width: none;
}

.user-tab {
    background: transparent;
    border: none;
    color: #666;
    font-size: 13px;
    font-weight: 700;
    padding: 12px 16px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    white-space: nowrap;
    text-transform: uppercase;
}

.user-tab:hover { color: #ccc; }

.user-tab.active {
    color: #fff;
    border-bottom: 2px solid #fff;
}

/* --- 4. CONTENT: SETTINGS (Horizontal Layout) --- */
.settings-grid {
    display: flex;
    flex-direction: column; /* Mobile: Stacked */
    gap: 20px;
    width: 100%;
}

/* Desktop: Side-by-Side Row */
@media (min-width: 800px) {
    .settings-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    .settings-full-width {
        grid-column: 1 / -1;
    }
}

.form-box {
    background: #111;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #333;
    height: 100%; /* Equal height */
    box-sizing: border-box;
}

.form-box h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #fff;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.input-group { margin-bottom: 15px; }
.input-group label { 
    display: block; color: #888; font-size: 11px; 
    margin-bottom: 6px; font-weight: 700; text-transform: uppercase; 
}
.input-group input {
    width: 100%;
    background: #000;
    border: 1px solid #333;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.input-group input:focus { border-color: #fff; outline: none; }

.btn-save {
    background: #fff;
    color: #000;
    border: none;
    padding: 12px;
    width: 100%;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 13px;
    margin-top: 10px;
    transition: background 0.2s;
}
.btn-save:hover { background: #ddd; }

.btn-logout {
    width: 100%;
    background: transparent;
    color: #ef4444; /* Red for Logout */
    border: 1px solid #ef4444;
    padding: 14px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 13px;
    transition: background 0.2s;
}
.btn-logout:hover { background: rgba(239, 68, 68, 0.1); }

/* --- 5. CONTENT: HISTORY --- */
.history-grid { display: flex; flex-direction: column; gap: 12px; }

.hist-card {
    display: flex; gap: 15px;
    background: #111; border: 1px solid #333;
    padding: 12px; border-radius: 8px;
    text-decoration: none; color: inherit; align-items: center;
    transition: border-color 0.2s;
}
.hist-card:hover { border-color: #555; }

.hist-poster { 
    width: 55px; height: 80px; border-radius: 4px; 
    object-fit: cover; background: #222; flex-shrink: 0; 
}

.hist-info { 
    flex: 1; display: flex; flex-direction: column; 
    justify-content: center; min-width: 0; 
}

.hist-title { 
    font-size: 14px; font-weight: 700; color: #fff; 
    margin: 0 0 6px 0; white-space: nowrap; 
    overflow: hidden; text-overflow: ellipsis; 
}

.hist-meta { font-size: 11px; color: #888; margin-bottom: 8px; }

.hist-btn { 
    align-self: flex-start; padding: 4px 10px; 
    background: #fff; color: #000; font-size: 10px; 
    font-weight: 800; border-radius: 4px; text-transform: uppercase; 
}

/* --- 6. CONTENT: WALLET --- */
.wallet-box { 
    background: #111; border: 1px solid #333; border-radius: 12px; 
    padding: 30px; text-align: center; margin-bottom: 30px; 
}
.wallet-balance { 
    font-size: 48px; font-weight: 800; color: #fff; margin: 10px 0; 
    display: flex; align-items: center; justify-content: center; gap: 10px; 
}
.wallet-actions { display: flex; gap: 15px; margin-top: 20px; }
.w-btn { 
    flex: 1; padding: 14px; border-radius: 6px; font-weight: 700; 
    font-size: 13px; cursor: pointer; border: none; text-transform: uppercase; 
}
.w-btn.add { background: #fff; color: #000; }
.w-btn.redeem { background: transparent; border: 1px solid #fff; color: #fff; }

/* Transactions */
.trans-container { 
    background: #111; border-radius: 12px; border: 1px solid #333; overflow-x: auto; 
}
.trans-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px; }
.trans-table th { 
    text-align: left; color: #666; padding: 15px; 
    font-size: 11px; text-transform: uppercase; border-bottom: 1px solid #333; 
}
.trans-table td { padding: 15px; color: #ccc; border-bottom: 1px solid #222; }
