/* style-profile.css v2.1 - Added Color Picker */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #E50914; /* Merah MikuNime */
    --background-color: #0A0D14; /* Gelap Pekat */
    --surface-color: #18181b; /* Kartu Gelap */
    --surface-color-darker: #121212;
    --text-color: #e4e4e7;
    --text-color-heading: #FFFFFF;
    --border-color: rgba(255, 255, 255, 0.1);
    --success-color: #4ade80;
    --danger-color: #ef4444;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Outfit', sans-serif; /* Ganti font ke Outfit */
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 1rem;
    padding-bottom: 80px; 
}

.profile-page-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* --- GLOBAL CARD RESET (Clean Look - No Boxes) --- */
.profile-card, .xp-card, .info-card, .actions-card, .info-item {
    background-color: transparent !important; /* Hapus Background */
    border: none !important; /* Hapus Border */
    box-shadow: none !important; /* Hapus Bayangan */
    padding: 1rem 0; /* Kurangi padding samping */
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important; /* Garis tipis */
}

.profile-card h2 {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

/* --- Header Card (Glassmorphism Style) --- */
.profile-header-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
    padding: 1.5rem;
    margin-top: 80px; 
    margin-bottom: 2rem;
    display: flex;
    flex-direction: row; 
    align-items: center; 
    justify-content: flex-start; /* Sementara rata kiri dulu */
    gap: 20px; 
    position: relative;
    overflow: hidden;
}

/* Efek pantulan cahaya halus di background */
.profile-header-card::before {
    content: '';
    position: absolute;
    top: 0; left: -50%;
    width: 100%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.03), transparent);
    transform: skewX(-25deg);
    pointer-events: none;
}

/* ... (Kode Lain) ... */

/* Hapus animasi skeleton yang berlebihan, ganti jadi warna statis/simple */
.skeleton { 
    background-color: var(--surface-color-darker); /* Statis Gelap */
    /* animation: skeleton-loading ... (DIHAPUS) */
}

/* Hapus animasi XP Shine */
.xp-bar-shine { display: none; }

/* --- Profile Pic dengan Border Gradient Statis --- */
.profile-pic-container {
    position: relative;
    width: 90px;
    height: 90px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    
    /* Border Gradient Keren (Diam) */
    background: linear-gradient(135deg, #ff0000, #ffae00);
    border-radius: 50%;
    padding: 2px;
}

.profile-pic {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 2px solid var(--background-color);
    object-fit: cover;
    background: #000;
}

/* Tombol Edit (Kamera) Kecil & Mojok */
.edit-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem; /* Pas */
    padding: 5px;
    border-radius: 50%;
    border: 2px solid var(--background-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    
    opacity: 1; 
    z-index: 2;
}

/* --- Header Info Wrapper (Tengah) --- */
.header-info-wrapper {
    flex: 1; /* Ambil sisa ruang yang ada */
    min-width: 0; /* Mencegah overflow flex item */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; /* KUNCI: Rata kiri & sesuai konten (tidak stretch) */
    padding-right: 10px; /* Jarak aman ke Level */
}

/* Pastikan Level tidak tergencet atau terdorong */
.level-display {
    flex-shrink: 0; /* JANGAN MENGECIL/TERDORONG */
    /* sisa style lama tetap ikut dari class yang ada */
}

.username-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

#username-display {
    font-size: 1.8rem; /* Lebih Besar */
    font-weight: 900; /* SUPER TEBAL */
    color: white;
    letter-spacing: -0.5px; /* Rapat modern */
    margin: 0;
    line-height: 1.1;
}

#email-display {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 4px 0 10px 0; /* Jarak rapi ke role */
    opacity: 0.7;
}

/* Edit Icon (Simple) */
.edit-username-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
    cursor: pointer;
}

/* Hapus overlay upload yang ribet kalau tidak dipakai, atau sederhanakan */
.upload-overlay {
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
}

.profile-pic-container {
    position: relative;
    width: 120px;
    height: 120px;
    cursor: pointer;
    flex-shrink: 0;
    margin-bottom: 1rem;
}

.profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    object-fit: cover;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 20px rgba(0, 170, 255, 0.3);
}

.profile-pic-container:hover .profile-pic {
    filter: brightness(0.7);
}

/* .edit-icon lama dihapus */

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.progress-bar-wrapper {
    width: 70%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-inner {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: width 0.2s linear;
}

.progress-text {
    color: white;
    font-weight: 600;
    margin-top: 8px;
    font-size: 0.9rem;
}

.username-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

#username-display {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color-heading);
}

.edit-username-icon {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    opacity: 0.6;
    transition: all var(--transition-speed) ease;
}

.edit-username-icon:hover {
    opacity: 1;
    color: var(--primary-color);
}

.username-input-inline {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color-heading);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--primary-color);
    outline: none;
    width: 100%;
    text-align: center;
}

#email-display {
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 1rem;
}

.role-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.role-biasa { background-color: #808080; color: white; }
.role-hard { background-color: #2575fc; color: white; }
.role-bawang { background-color: #ff8c00; color: white; }
.role-sepuh { background-color: #6a11cb; color: white; }
.role-admin { background: #d4af37; color: #121212; position: relative; overflow: hidden; }
.role-admin::after { content: ''; position: absolute; top: 0; transform: translateX(100%); width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent); animation: role-shimmer 2.5s infinite; }
.role-tuhan { font-weight: 900; background: linear-gradient(90deg, #ff0000, #ff7300, #002bff, #ff00c8, #ff0000); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: gradient-animation 5s linear infinite; }
@keyframes role-shimmer { 100% { transform: translateX(-100%); } }
@keyframes gradient-animation { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* --- XP Card (Glass Style) --- */
.xp-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    margin-bottom: 1.5rem;
}

.level-xp-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* .level-display CSS dihapus karena ganti desain teks simpel */

/* Update Tombol agar Icon rapi */
.actions-card .action-btn {
    /* ... style lama ... */
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 10px; /* Jarak Icon dan Teks */
}

.actions-card .action-btn i {
    font-size: 1.1rem; /* Ukuran Icon */
}

.xp-bar-container {
    height: 8px; /* Lebih tipis */
    background-color: rgba(255,255,255,0.1);
    border-radius: 10px;
}

/* --- Profile Pic dengan Border Gradient Statis --- */
.profile-pic-container {
    position: relative;
    width: 110px; /* FIXED SIZE: BESAR */
    height: 110px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    
    /* Border Gradient Keren (Diam) */
    background: linear-gradient(135deg, #ff0000, #ffae00); 
    border-radius: 50%;
    padding: 3px;
}

/* Hapus animasi rainbow */

.profile-pic {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 3px solid var(--background-color);
    object-fit: cover;
    background: #000;
}

/* Tombol Edit (Kamera) Kecil & Mojok */
.edit-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    
    background-color: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    padding: 5px;
    border-radius: 50%;
    border: 2px solid var(--background-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    
    opacity: 1; 
    z-index: 2;
}

/* Paksa XP Bar Merah */
#xp-bar-fill {
    background: #ff0000 !important; /* Fallback Merah */
    background-image: linear-gradient(90deg, #b30000, #ff0000) !important; /* Gradient Merah */
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.6) !important;
}

/* Animasi dihapus agar clean */
/* @keyframes xp-shine ... */ 

.xp-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

#xp-motivation {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--success-color);
    opacity: 0;
    transition: opacity 0.5s ease;
}

#xp-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
}

/* --- Customization Card (HIDDEN) --- */
.color-picker {
    display: none;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-start;
}
.color-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--surface-color);
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.color-circle:hover {
    transform: scale(1.1);
}
.color-circle.active {
    border-color: var(--text-color-heading);
    box-shadow: 0 0 10px var(--primary-color);
}


/* --- Info Grid (Bento Box Style) --- */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 Kolom */
    gap: 15px; /* Jarak antar kotak */
}

.info-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column; /* Icon atas, teks bawah */
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, background 0.2s;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.info-item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important; /* Reset border */
}

.info-label {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-label .material-icons {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.info-data {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color-heading);
    text-align: left; /* Rata kiri */
    word-break: break-all; /* Agar UID panjang tidak jebol */
}

/* --- Actions Card (Grid Layout) --- */
.actions-card {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 Kolom */
    gap: 12px;
    background: transparent !important; /* Transparan, biar tombol yang menonjol */
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 1rem;
}

.actions-card .action-btn {
    border-radius: 16px; /* Ganti Pill jadi Rounded Box agar cocok sama Grid */
    font-weight: 600;
    font-size: 0.95rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; /* Full width cell */
}

/* Tombol Logout (Danger) & Admin Full Width */
#logout-btn, #admin-panel-btn {
    grid-column: 1 / -1; /* Span semua kolom */
}

.action-btn.secondary { 
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: var(--text-color);
}

/* --- Skeleton Loader --- */
#skeleton-loader {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}
.skeleton { animation: skeleton-loading 1s linear infinite alternate; }
@keyframes skeleton-loading { 0% { background-color: hsl(210, 15%, 20%); } 100% { background-color: hsl(210, 15%, 25%); } }
.skeleton-card { background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; }
.skeleton-header { display: flex; flex-direction: column; align-items: center; padding: 2rem 1.5rem; }
.skeleton-pic { width: 120px; height: 120px; border-radius: 50%; margin-bottom: 1rem; }
.skeleton-text { height: 1rem; border-radius: 4px; margin-bottom: 0.75rem; }

/* --- Toast --- */
#toast-container { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.toast { padding: 12px 20px; border-radius: 8px; color: white; font-weight: 500; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); opacity: 0; transform: translateY(20px); transition: opacity 0.3s, transform 0.3s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.info { background-color: var(--primary-color); }
.toast.success { background-color: var(--success-color); }
.toast.error { background-color: var(--danger-color); }

/* --- Network Monitor (Hidden by default in new CSS) --- */
.network-monitor { display: none; }
