/* profile_system.css - FULL MERGED UNABRIDGED VERSION */

:root {
    --sidebar-bg: var(--dark-grey); /* Matching your 'Send a Thank You' button */
    --sidebar-text: #f9f9f9;
}

/* 1. THE TRIGGER (The "R" Button) 
   Positioned fixed to the screen edge, ignoring site containers.
*/
.profile-trigger-fixed {
    position: fixed;
    top: 20px;
    left: 10px; /* Initial state */
    cursor: pointer;
    z-index: 2001;
    /* CRITICAL: Must match sidebar timing and easing exactly */
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logic for both sibling possibilities to move trigger when sidebar is open */
.profile-sidebar.open ~ .profile-trigger-fixed,
.profile-sidebar.open + .profile-trigger-fixed {
    left: 290px;
}

/* Base shape for initials circle used in the trigger */
.user-avatar-circle {
    width: 45px;
    height: 45px;
    background: var(--sidebar-bg);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.user-avatar-circle:hover { 
    transform: scale(1.1); 
}

/* Reset page margins for logged-in users to accommodate fixed trigger */
body[data-logged-in="true"] .stats-subtle {
    margin-left: 0 !important; 
}

/* 2. THE SIDEBAR (Main Navigation Panel) */
.profile-sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Hidden state */
    width: 280px;
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 2000;
    /* Speed: 0.4s | Easing: cubic-bezier matching the 'push' feel */
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.profile-sidebar.open {
    left: 0;
}

.sidebar-menu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;         /* Tight gap for vertical flow */
    margin-top: 10px; /* Moves menu items closer to the top */
}

/* Labels: Language / Navigation */
.sidebar-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.6;
    margin: 15px 0 5px 10px;
    color: white;
}

/* Ensure trigger remains pushed when sidebar is active */
.sidebar-active .profile-trigger-fixed {
    left: 290px;
}

.sidebar-active .profile-trigger-fixed .user-avatar-circle {
    box-shadow: 2px 0 12px rgba(0,0,0,0.2);
}

/* Sidebar Buttons/Links */
.sidebar-link-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: left;
    text-decoration: none;
}

.sidebar-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Logout link specific styling */
.logout-link {
    margin-top: 5px !important; 
    color: #ff6b6b !important;
}

/* 3. THE PROFILE OVERLAY (The Content Panel that rolls out) */
.profile-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 50%; /* Default for Desktop */
    height: 100vh;
    background: white;
    z-index: 2100;
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
    transition: left 0.5s ease-in-out;
    padding: 40px 20px; 
    overflow-y: auto;
    color: #333;
    display: flex;
    flex-direction: column;
    
    transform: translateX(-105%); /* Start hidden off-screen */
    transition: transform 1.0s cubic-bezier(0.25, 0.8, 0.25, 1);
    visibility: hidden; /* Prevent interaction while hidden */

}

@media (max-width: 1024px) {
    .profile-overlay { 
        width: 100%; /* Mobile & Tablet */
    }
}

.profile-overlay.active { 
    left: 0; 
    transform: translateX(0);
    visibility: visible;
    
}

/* THE CLOSE BUTTON - Fixed inside the white panel */
.profile-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 2200; 
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.profile-close-btn::before {
    content: '\00d7'; /* The Unicode multiplication sign (X) */
    position: absolute;
    font-weight: 300;
    font-family: Arial, sans-serif;
    font-size: 2rem;
}

/* If FontAwesome DOES load, hide the CSS fallback so they don't overlap */
.profile-close-btn i {
    position: relative;
    z-index: 2;
}

.profile-close-btn:hover {
    background: #666;
    color: white;
    transform: rotate(90deg);
}

/* --- 4. IMAGE PROCESSING & IDENTITY LAYOUT --- */

/* Container must be relative for the menu position */
.avatar-container {
    position: relative;
    display: inline-block;
}

/* The Edit Button (Pen) */
.btn-edit-avatar {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--sidebar-bg);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    cursor: pointer;
    z-index: 10;
}

/* The Popup Menu */
.avatar-edit-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    width: 160px;
    display: none; /* Hidden by default */
    flex-direction: column;
    padding: 5px 0;
    z-index: 100;
    border: 1px solid #eee;
}

.avatar-edit-menu.active {
    display: flex;
}

/* Menu Items */
.menu-item {
    background: none;
    border: none;
    padding: 10px 15px;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.menu-item:hover {
    background: #f8f9fa;
}

.menu-item.text-danger {
    color: #e74c3c;
}

.menu-item i {
    width: 18px;
}

#profile-identity-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}


.profile-identity-centered {
    text-align: center;
    padding: 20px 0;
}

.avatar-action-btn {
    position: absolute;
    width: 28px;  /* Slightly smaller for elegance */
    height: 28px;
    border-radius: 50%;
    border: 2px solid #ffffff; /* Contrast border */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    background: var(--sidebar-bg);
}

/* 3 o'clock position (Right side) */
.btn-update-photo {
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    background-color: #2ecc71;
    color: white;
}

/* 6 o'clock position (Bottom side) */
.btn-remove-photo {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #e74c3c;
    color: white;
}



.avatar-action-btn:hover {
    transform: scale(1.1) ${ (props) => props.className === 'btn-update-photo' ? 'translateY(-50%)' : 'translateX(-50%)' };
    filter: brightness(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    background: #666;
}

.avatar-action-btn i {
    font-size: 12px; /* Adjust size as needed */
    color: #ffffff;
    display: block;
    pointer-events: none; /* Prevents icon from blocking the button click */
}


/* Center the "Add Image" link */
.add-image-link-wrapper {
    margin-top: 10px;
    display: block;
    width: 100%;
    text-align: center;
}

.add-image-link {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-block;
}

.expanded-avatar, .expanded-avatar-initial {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #555;
    color: white;
    font-size: 3rem;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Placeholder styling if image fails */
.profile-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--sidebar-bg);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* Name, Location, and Metadata */
.user-name-title {
    text-align: center;
    font-size: 1.8rem;
    margin: 10px 0 5px;
    color: #222;
    font-weight: bold;
}

.user-location {
    text-align: center;
    color: #666;
    font-size: 1rem;
    margin: 2px 0;
}

.user-meta {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin: 5px 0;
}

.profile-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 25px 0;
    width: 100%;
}

/* --- 5. ACTIVITY SECTIONS (Messages etc) --- */

.section-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Empty state / No Activity styling */
.no-activity-text {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}