/* 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: #00aaff;
    --background-color: #0B0C10;
    --surface-color: #1F2833;
    --surface-color-darker: #161d25;
    --text-color: #C5C6C7;
    --text-color-heading: #FFFFFF;
    --border-color: #2c3a47;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 1rem;
    padding-bottom: 80px; /* Space for bottom nav */
}

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

/* --- Card Base Style --- */
.profile-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition-speed) ease;
}

.profile-card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color-heading);
    margin-bottom: 1rem;
}

/* --- Header Card --- */
.profile-header-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
}

.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 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    pointer-events: none;
}

.profile-pic-container:hover .edit-icon {
    opacity: 1;
}

.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 --- */
.level-xp-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.level-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
    border: 4px solid var(--surface-color);
    transition: all 0.4s ease;
}
.level-display span { font-size: 0.7rem; font-weight: 600; line-height: 1; }
#level-number { font-size: 1.5rem; font-weight: 700; line-height: 1; transition: font-size 0.4s ease; }

.xp-details {
    width: 100%;
}

.xp-bar-container {
    width: 100%;
    height: 12px;
    background-color: var(--surface-color-darker);
    border-radius: 6px;
    overflow: hidden;
}

#xp-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    border-radius: 6px;
    transition: width 0.5s ease-in-out, background-color var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.xp-bar-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    animation: xp-shine 2.5s infinite linear;
}
@keyframes xp-shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.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 --- */
.color-picker {
    display: flex;
    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 & Actions Cards --- */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-item {
    background-color: var(--surface-color-darker);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.info-label {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.info-data {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color-heading);
    word-break: break-all;
}

.actions-card .action-btn {
    display: block;
    width: 100%;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    margin-top: 1rem;
}
.actions-card .action-btn:first-child { margin-top: 0; }

.action-btn.primary { background-color: var(--primary-color); color: white; }
.action-btn.primary:hover { background-color: #0095e0; transform: translateY(-2px); }

.action-btn.secondary { background-color: var(--surface-color-darker); color: var(--text-color); border: 1px solid var(--border-color); }
.action-btn.secondary:hover { background-color: var(--border-color); }

.action-btn.danger { background-color: var(--danger-color); color: white; }
.action-btn.danger:hover { background-color: #c82333; transform: translateY(-2px); }

/* --- 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; }
