/* ==========================================
   USER SIDEBAR - Menu lateral do usuário
   ========================================== */

/* === User Icon in Navbar === */
.user-icon-container {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.user-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--primary-glow);
}

.user-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px var(--primary-glow);
}

/* === User Sidebar === */
.user-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(20, 20, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 2px solid var(--primary);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-sidebar.open {
    right: 0;
}

.sidebar-content {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.sidebar-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
    box-shadow: 0 0 30px var(--primary-glow);
}

.sidebar-user-info h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.sidebar-user-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.sidebar-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.5rem;
}

.sidebar-close:hover {
    color: var(--primary);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-menu-item {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-menu-item:hover {
    background: rgba(233, 69, 96, 0.15);
    border-color: var(--primary);
    transform: translateX(-5px);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.2);
}

/* === Avatar Modal === */
.avatar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-modal .modal-content {
    background: rgba(20, 20, 40, 0.98);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--primary);
    box-shadow: 0 0 40px var(--primary-glow);
    text-align: center;
    min-width: 400px;
}

.avatar-modal h3 {
    color: var(--primary);
    margin-bottom: 2rem;
}

.btn-upload {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    margin-right: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--primary-glow);
}

.btn-close {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: rgba(233, 69, 96, 0.2);
    border-color: var(--primary);
}

/* === Chat Modal === */
.chat-modal .modal-content {
    background: rgba(20, 20, 40, 0.98);
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--primary);
    box-shadow: 0 0 40px var(--primary-glow);
    min-width: 500px;
    max-height: 80vh;
    overflow: hidden;
}

.chat-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h3 {
    color: var(--primary);
    margin: 0;
}

.chat-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.chat-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.chat-section input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.chat-section input:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-section button {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--primary-glow);
}

#friends-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.friend-item {
    background: rgba(233, 69, 96, 0.1);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.friend-item:hover {
    background: rgba(233, 69, 96, 0.2);
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.friend-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.friend-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    margin-left: 0.5rem;
}

.friend-status.pending {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

.friend-actions {
    display: flex;
    gap: 0.5rem;
}

.friend-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 0.4rem 0.6rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.friend-actions button:hover {
    background: rgba(233, 69, 96, 0.2);
    border-color: var(--primary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    max-height: 200px;
}

.message-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.message-item.received {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.message-item.sent {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.2);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.message-content {
    line-height: 1.5;
}

/* Notification */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification {
    animation: slideIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .user-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .avatar-modal .modal-content {
        min-width: 90%;
    }
    
    .chat-modal .modal-content {
        min-width: 90%;
    }
    
    .profile-modal .modal-content {
        min-width: 90%;
        padding: 1.5rem;
    }
}

/* =====================
   PROFILE MODAL
   ===================== */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-content {
    background: rgba(20, 20, 40, 0.98);
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--primary);
    box-shadow: 0 0 40px var(--primary-glow);
    min-width: 600px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-header h3 {
    color: var(--primary);
    margin: 0;
}

.profile-body {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
    box-shadow: 0 0 30px var(--primary-glow);
}

.btn-upload-avatar {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-upload-avatar:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--primary-glow);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group-profile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group-profile label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.profile-input,
.profile-textarea {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.profile-input:focus,
.profile-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.profile-input-disabled {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.03);
    cursor: not-allowed;
}

.profile-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-save-profile {
    flex: 1;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-save-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--primary-glow);
}

.btn-logout-profile {
    flex: 1;
    padding: 1rem;
    background: rgba(233, 69, 96, 0.2);
    color: var(--text-primary);
    border: 1px solid var(--primary);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout-profile:hover {
    background: rgba(233, 69, 96, 0.3);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .profile-body {
        grid-template-columns: 1fr;
    }
}