/* css/profile.css */

/* --- 🎨 PALET WARNA (Ganti di sini agar sama dengan Index/Lobby!) --- */
:root {
    /* Warna Utama (Biasanya warna tombol/header di Index) */
    --primary-color: #64b5f6;   /* Contoh: Biru Gelap Malam */
    
    /* Warna Aksen (Biasanya warna highlight/hover) */
    --accent-color: #219ebc;    /* Contoh: Biru Laut */
    
    /* Warna Background (Jika Index pakai warna solid) */
    --bg-gradient-1: #8ecae6;   /* Langit Cerah */
    --bg-gradient-2: #64b5f6;   /* Laut Dalam */
    
    /* Warna Teks */
    --text-main: #1e3a5a;
    --text-muted: #4a658a;
    
    /* Warna Kartu (Glassmorphism) */
    --card-bg: rgba(255, 255, 255, 0.95);
}

/* --- LAYOUT UTAMA --- */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
    overflow-y: auto;
    min-height: 100vh;
    /* Gunakan background dari variabel */
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
}

/* Container Background (Agar bisa ditumpuk dengan gambar dari lobby.css jika ada) */
.background-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    /* Jika Tuan pakai gambar di index.html, hapus baris 'background' di bawah ini */
    background: inherit; 
}

.profile-container {
    position: relative;
    width: 100%;
    max-width: 900px; 
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.profile-header-nav {
    margin-bottom: 20px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none; /* Penting agar link tidak bergaris bawah */
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(-5px);
}

/* --- KARTU PEMAIN (Responsive Card) --- */
.player-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* --- SIDEBAR (KIRI / ATAS) --- */
.card-sidebar {
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.avatar-frame {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #fff;
    /* Shadow mengikuti warna aksen */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); 
    overflow: hidden;
    background: #e0f7fa;
    margin-bottom: 15px;
    transition: transform 0.3s;
}

.avatar-frame:hover { transform: scale(1.05) rotate(3deg); }

.avatar-frame img { width: 100%; height: 100%; object-fit: cover; }

.user-identity h2 {
    margin: 10px 0 5px;
    color: var(--primary-color); /* Mengikuti tema */
    font-size: 26px;
    font-weight: 800;
}

.rank-badge {
    background: rgba(33, 158, 188, 0.1); /* Transparan dari warna aksen */
    color: var(--accent-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 20px;
}

/* Level Bar */
.level-wrapper { width: 100%; margin-bottom: 25px; }

.level-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.lvl-badge {
    background: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
}

.xp-bar-container {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    /* Gradient bar mengikuti tema */
    background: linear-gradient(90deg, var(--bg-gradient-1), var(--accent-color));
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.edit-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.edit-btn:hover { 
    background: var(--accent-color); 
    transform: translateY(-2px); 
}

/* --- CONTENT (KANAN / BAWAH) --- */
.card-content {
    padding: 40px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-title {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 15px 0;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    display: inline-block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: white;
    padding: 15px;
    border-radius: 16px;
    border: 1px solid #edf2f4;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: var(--accent-color);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* Warna stat tetap spesifik agar kontras */
.chat-color { background: #e0f7fa; color: #00bcd4; }
.heart-color { background: #ffebee; color: #ff5252; }
.fire-color { background: #fff3e0; color: #ff9800; }

.stat-data h3 {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0 0 2px 0;
    text-transform: uppercase;
}

.stat-data p {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
}

/* Badges */
.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.badge {
    width: 50px;
    height: 50px;
    background: #f1f3f5;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    transition: all 0.2s;
    filter: grayscale(100%);
    opacity: 0.6;
}

.badge.unlocked {
    background: #fff9db;
    border: 1px solid #ffe066;
    filter: grayscale(0%);
    opacity: 1;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.2);
}

.badge:hover { transform: scale(1.15) rotate(5deg); }

/* --- RESPONSIVE UNTUK DESKTOP (Width > 768px) --- */
@media (min-width: 768px) {
    .player-card {
        flex-direction: row;
        min-height: 450px;
    }

    .card-sidebar {
        width: 35%;
        max-width: 300px;
        border-bottom: none;
        border-right: 1px solid #eee;
        justify-content: center;
    }

    .card-content {
        width: 65%;
        padding: 50px;
    }
}

/* --- RESPONSIVE UNTUK HP KECIL --- */
@media (max-width: 480px) {
    .profile-container { padding: 10px; }
    .card-sidebar { padding: 30px 20px; }
    .stats-grid { grid-template-columns: 1fr; }
}